private void PopupWindowShowAction_OpenControlingObject_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { var os = Application.CreateObjectSpace() as XPObjectSpace; var configs = os.Session.Query <ConfigurationStatic>().Where(x => x.ExpiredOn == null).ToList(); var obj = new Configuration(); var view = Application.CreateDetailView(os, obj); e.DialogController.AcceptAction.Executed += (s, ee) => { HS.GetConfiguration(); os.CommitChanges(); }; CreateViewItems(view, configs); e.View = view; }
void RunService() { var mailGeneratorThread = new Thread(StartMailGeneratorTread); mailGeneratorThread.SetApartmentState(ApartmentState.STA); var smsGeneratorThread = new Thread(StartSmsGeneratorThread); var emailSenderThred = new Thread(StartEmailSender); var smsSenderThread = new Thread(StartSmsSender); try { while (true) { HS.GetConfiguration(); if (!mailGeneratorThread.CheckThreadState()) { mailGeneratorThread.Start(); } if (!smsGeneratorThread.CheckThreadState()) { smsGeneratorThread.Start(); } if (!emailSenderThred.CheckThreadState()) { emailSenderThred.Start(); } if (!smsSenderThread.CheckThreadState()) { smsSenderThread.Start(); } Thread.Sleep(10000); } } catch (Exception ex) { HS.CreateExceptionLog(ex.Message, ex.ToString(), 10); RunService(); } }