private void InfiniumNotifyList_ItemClicked(object sender, string FormName) { if (FormName == "MessagesForm") { MessagesButton_Click(null, null); if (NotifyForm != null) { NotifyForm.Close(); NotifyForm.Dispose(); NotifyForm = null; } ActiveNotifySystem.FillUpdates(); InfiniumNotifyList.ItemsDataTable = ActiveNotifySystem.ModulesUpdatesDataTable; InfiniumNotifyList.InitializeItems(); return; } Thread T = new Thread(delegate() { SplashWindow.CreateSplash(); }); T.Start(); while (!SplashForm.bCreated) { ; } if (NotifyForm != null) { NotifyForm.Close(); NotifyForm.Dispose(); NotifyForm = null; } Form ModuleForm = null; //check if running Form Form = InfiniumMinimizeList.GetForm(FormName); if (Form != null) { TopForm = Form; Form.ShowDialog(); } else { Type CAType = Type.GetType("Infinium." + FormName); ModuleForm = (Form)Activator.CreateInstance(CAType, this); TopForm = ModuleForm; ModuleForm.ShowDialog(); } ActiveNotifySystem.FillUpdates(); InfiniumNotifyList.ItemsDataTable = ActiveNotifySystem.ModulesUpdatesDataTable; InfiniumNotifyList.InitializeItems(); }
private void FuckingNotify() { //try //{ InfiniumNotifyList.ItemsDataTable = ActiveNotifySystem.ModulesUpdatesDataTable; InfiniumNotifyList.InitializeItems(); if (TopForm != null) { if (TopForm.Name == "MessagesForm") { using (Stream str = Properties.Resources.MESSAGENOTIFY) { using (SoundPlayer snd = new SoundPlayer(str)) { snd.Play(); } } } else { using (Stream str = Properties.Resources._01_01) { using (SoundPlayer snd = new SoundPlayer(str)) { snd.Play(); } } } } else { using (Stream str = Properties.Resources._01_01) { using (SoundPlayer snd = new SoundPlayer(str)) { snd.Play(); } } } //если открытый модуль типа InfiniumForm if (TopForm != null) { if (TopForm.GetType().BaseType.Name == "InfiniumForm") { ((InfiniumForm)TopForm).OnANSUpdate(); } } if (TopForm != null) { if (ActiveNotifySystem.ModulesDataTable.Select("ModuleID = " + ActiveNotifySystem.iCurrentModuleID)[0]["FormName"].ToString() == TopForm.Name) { if (GetActiveWindow() == TopForm.Handle) { return; } } } if (GetActiveWindow() == Handle)//только звук { return; } //показываем всплывающее окно if (NotifyForm.bShowed == true) { if (NotifyForm != null) { NotifyForm.Close(); } int ModuleID = 0; int MoreCount = 0; int Count = ActiveNotifySystem.GetLastModuleUpdate(ref ModuleID, ref MoreCount); NotifyForm = new NotifyForm(this, ref ActiveNotifySystem, ModuleID, Count, MoreCount); NotifyForm.Show(); } else { int ModuleID = 0; int MoreCount = 0; int Count = ActiveNotifySystem.GetLastModuleUpdate(ref ModuleID, ref MoreCount); NotifyForm = new NotifyForm(this, ref ActiveNotifySystem, ModuleID, Count, MoreCount); NotifyForm.Show(); } //} //catch (Exception e) //{ // MessageBox.Show(e.Message); //} }