/// ------------------------------------------------------------------------------------ private void LoadToolbarAndContextMenus() { if (App.DesignMode) { return; } if (_tmAdapter != null) { _tmAdapter.Dispose(); } _tmAdapter = AdapterHelper.CreateTMAdapter(); if (_tmAdapter != null) { var defs = new[] { FileLocator.GetFileDistributedWithApplication(App.ConfigFolderName, "CVChartsTMDefinition.xml") }; _tmAdapter.Initialize(this, App.MsgMediator, App.ApplicationRegKeyPath, defs); _tmAdapter.AllowUpdates = true; } // Give the chart Phone search toolbar button a default image. var childItemProps = _tmAdapter.GetItemProperties("tbbChartPhoneSearchAnywhere"); var parentItemProps = _tmAdapter.GetItemProperties("tbbChartPhoneSearch"); if (parentItemProps != null && childItemProps != null) { parentItemProps.Image = childItemProps.Image; parentItemProps.Visible = true; parentItemProps.Update = true; _tmAdapter.SetItemProperties("tbbChartPhoneSearch", parentItemProps); } }
/// ------------------------------------------------------------------------------------ protected override void OnFormClosing(FormClosingEventArgs e) { App.MsgMediator.RemoveColleague(this); Visible = false; App.UnloadDefaultMenu(m_mainMenuAdapter); m_mainMenuAdapter.Dispose(); m_mainMenuAdapter = null; Controls.Remove(m_view); base.OnFormClosing(e); }
/// ------------------------------------------------------------------------------------ private void LoadToolbar() { if (m_tmAdapter != null) { m_tmAdapter.Dispose(); } m_tmAdapter = AdapterHelper.CreateTMAdapter(); if (WordListGrid != null) { WordListGrid.TMAdapter = m_tmAdapter; } if (m_tmAdapter != null) { m_tmAdapter.LoadControlContainerItem += m_tmAdapter_LoadControlContainerItem; var defs = new[] { FileLocator.GetFileDistributedWithApplication(App.ConfigFolderName, "DataCorpusTMDefinition.xml") }; m_tmAdapter.Initialize(this, App.MsgMediator, App.ApplicationRegKeyPath, defs); m_tmAdapter.AllowUpdates = true; } }