Yeah I was right, SetupSettingsFrame does it in the form shown below which is called from SetupControls which is called from SetupForm which is called from Setup, so if you can get in behind that code being called i.e. behind Jiwa setup you should just need to set the combobox called SettingsUltraComboEditor and given the form is setup before a plugin gets called it should be as simple as doing it there in the form plugin setup.
So just work out which one on the combo items in list is your setting and set the select item index accordingly. By the way the items in the combo are of type Infragistics.Win.ValueListItem and the datavalue will be the setting just cast it back from an object if you need it and the displaytext will be what the combo is showing which is what you are looking for anyway in your previous code.
- Code: Select all
private void SetupSettingsFrame()
{
IEnumerator enumerator = null;
bool flag = this._IsDisplaying;
try
{
this._IsDisplaying = true;
this.SettingsUltraComboEditor.DropDownStyle = DropDownStyle.DropDownList;
string str = "";
object obj = str;
this.Manager.JLib.GetProfileKey(this.Manager.Database.JiwaLoginUserID, string.Concat("BatchPrintUI.", base.Name), "Settings", ref obj);
str = Conversions.ToString(obj);
int count = -1;
try
{
enumerator = this.BatchPrint.Settings.GetEnumerator();
while (enumerator.MoveNext())
{
Setting current = (Setting)enumerator.Current;
this.SettingsUltraComboEditor.Items.Add(current, current.Name);
if (Operators.CompareString(current.Name.Trim(), str.Trim(), false) != 0)
{
continue;
}
count = checked(this.SettingsUltraComboEditor.Items.Count - 1);
}
}
finally
{
if (enumerator is IDisposable)
{
(enumerator as IDisposable).Dispose();
}
}
if (count != -1)
{
this.SettingsUltraComboEditor.SelectedIndex = count;
}
else if (this.SettingsUltraComboEditor.Items.Count <= 0)
{
this.SettingsUltraComboEditor.SelectedIndex = 0;
}
else
{
this.SettingsUltraComboEditor.SelectedIndex = checked(this.SettingsUltraComboEditor.Items.Count - 1);
}
}
finally
{
this._IsDisplaying = flag;
}
}