private void btnChat_Click(object sender, RoutedEventArgs e) { if ((null == m_chatWnd) || (m_chatWnd.IsDefunct)) { m_chatWnd = new ChatWnd(m_games, m_storeManager); m_chatWnd.Owner = this; } m_chatWnd.Show(); }
public MainWindow() { m_config = new CCBConfig(); m_games = new CCBGameData(); m_templates = new List <CCBGameTemplate>(); m_storeManager = new CCBStoreManager(); m_deleteEnabled = false; m_deleteUsed = false; m_onCharacterListUpdateD = new DOnCharacterListUpdate(OnCharacterListUpdate); m_onAddingNewEntityModeD = new DOnAddingNewEntityMode(OnAddingNewEntityMode); m_onCreateNewGameD = new DOnCreateNewGame(OnCreateNewGame); m_onCreateNewTemplateD = new DOnCreateNewTemplate(OnCreateNewTemplate); m_gameAdderEntry = new CCBTreeViewGameAdder(); m_worker = new BackgroundWorker(); m_worker.WorkerReportsProgress = true; m_timer = new Timer(133337); m_timer.Elapsed += new ElapsedEventHandler(OnTimer); m_timer.Start(); m_chatWnd = null; InitializeComponent(); try { m_config.Initialize(); CCBLogConfig.InitLogging(m_config); tbStatus.Text = System.String.Format("{0} [v{1}]", m_config.DocPath, System.Environment.Version.ToString()); } catch (System.Reflection.TargetInvocationException ex) { System.Diagnostics.Debug.WriteLine("Error caught in Main."); System.Diagnostics.Debug.WriteLine(ex.ToString()); } m_worker.ProgressChanged += new ProgressChangedEventHandler(Worker_OnProgressChanged); m_worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Worker_OnPersistenceCompleted); m_loaderD = new DoWorkEventHandler(Worker_Load); m_worker.DoWork += m_loaderD; m_worker.RunWorkerAsync(m_config); SetDefaultView(); AddOrMoveAdder(); }