private void SelectObject(object value, bool canAddOther) { if (value == null) { CurrentList.SelectedIndex = -1; return; } string type = AddonTool.ExtractAddonName(value); if (type != null) { if (m_addonHolderIndexes.ContainsKey(type.ToLower())) { int index = m_addonHolderIndexes[type.ToLower()]; m_objectCache[index] = value; CurrentList.SelectedIndex = index; // call on change event, even if index is the same CurrentList_SelectedIndexChanged(this, EventArgs.Empty); return; } } if (canAddOther) { object[] newcache = new object[m_objectCache.Length + 1]; Array.Copy(m_objectCache, newcache, m_objectCache.Length); m_objectCache = newcache; CurrentItems.Add(value); m_objectCache[m_objectCache.Length - 1] = value; CurrentList.SelectedIndex = m_objectCache.Length - 1; } }
protected virtual void OnChangedSelectedObject(EventArgs ev) { infoBoxFrame1.InfoText = AddonTool.ExtractDesctiption(SelectedObject) ?? ""; if (ChangedSelectedObject != null) { ChangedSelectedObject(this, EventArgs.Empty); } }
void FileNameEditorFrame_Disposed(object sender, EventArgs e) { var place = (IFilePlace)addonSelectFrame1.SelectedObject; if (place != null && !String.IsNullOrEmpty(place.GetVirtualFile())) { m_lastSelectedTypes[m_obj.DirectionIsSave] = AddonTool.ExtractAddonName(place); } }
void DataStoreFrame_Disposed(object sender, EventArgs e) { var ds = DataStore; if (ds != null) { m_lastSelectedAddons[ds.Mode] = AddonTool.ExtractAddonName(ds); } //if (m_chooser != null) m_chooser.Dispose(); }
//public CopyDbWizard(CopyDbJobCommand command) //{ // InitializeComponent(); // m_source = command.Source; // m_target = command.Target; //} void CopyDbWizard_Disposed(object sender, EventArgs e) { if (m_source != null) { Async.SafeClose(m_source.Connection); } if (addonSelectFrame1.SelectedObject != null) { m_lastSelectedAddon = AddonTool.ExtractAddonName(addonSelectFrame1.SelectedObject); } }