protected override void ShowReminderAlerts(object sender, ReminderEventArgs e) {
     if (_remindersForm == null) {
         _remindersForm = new RemindersForm(Application, (SchedulerStorage)sender);
         _remindersForm.Disposed += RemindersFormDisposed;
     }
     ((System.Windows.Forms.Form)Application.MainWindow.Template).Invoke((Action)(() => _remindersForm.OnReminderAlert(e)));
 }
示例#2
0
 private void OnReminder(ReminderEventArgs args)
 {
     lock (this)
     {
         foreach (KeyValuePair <Instrument, Dictionary <DateTime, Daily> > kvp1 in dailyBars.ToList())
         {
             Instrument instrument = kvp1.Key;
             Dictionary <DateTime, Daily> dailyBox = kvp1.Value;
             foreach (KeyValuePair <DateTime, Daily> kvp2 in dailyBox.ToList())
             {
                 DateTime barDateTime = kvp2.Key;
                 Daily    daily       = kvp2.Value;
                 DZHQuote lastQuote   = lastQuotes[instrument.Symbol];
                 if (lastQuote.Time.Date == barDateTime)
                 {
                     daily.High   = lastQuote.High;
                     daily.Low    = lastQuote.Low;
                     daily.Close  = lastQuote.Price;
                     daily.Volume = (long)lastQuote.TotalVolume;
                     ((DZHBarFactory)this.factory).EmitNewBar(daily, instrument);//必须使用barfactory激活事件
                 }
                 dailyBox.Remove(barDateTime);
             }
             if (dailyBox.Count == 0)
             {
                 dailyBars.Remove(instrument);
             }
         }
         ((DZHBarFactory)this.factory).EmitNewBarSlice(BarSize.Day);
     }
 }
示例#3
0
 public static void OnReminderSent(object sender, ReminderEventArgs args)
 {
     Console.WriteLine(
         $"Reminder ({args.Reminder.Id}) at " +
         $"{args.Reminder.DateTime:F} sent received with " +
         $"message {args.Reminder.Message}"
         );
 }
 protected override void ShowReminderAlerts(object sender, ReminderEventArgs e) {
     var view = (DashboardView)Application.CreateView(Application.FindModelView("ReminderFormView"));
     var showViewParameters = new ShowViewParameters(view);
     var dashboardViewItems = view.GetItems<DashboardViewItem>().First();
     showViewParameters.TargetWindow = TargetWindow.NewWindow;
     dashboardViewItems.ControlCreated += DashboardViewItemsOnControlCreated;
     Application.ShowViewStrategy.ShowView(showViewParameters, new ShowViewSource(Application.MainWindow, null));            
 }
示例#5
0
        private void InstrumentOutPool(ReminderEventArgs args)
        {
            Instrument inst = (Instrument)args.Data;

            if (this.items.ContainsKey(inst))
            {
                this.RemoveInstrument(inst);
            }
        }
        private void OnReminder(ReminderEventArgs args)
        {
            Dictionary <long, Dictionary <IFIXInstrument, Bar> > barFinishedStore = new Dictionary <long, Dictionary <IFIXInstrument, Bar> >();

            Monitor.Enter(this);
            try
            {
                foreach (KeyValuePair <IFIXInstrument, Dictionary <BarType, Dictionary <long, object> > > kvp1 in barStore.ToList())
                {
                    IFIXInstrument instrument = kvp1.Key;
                    Dictionary <BarType, Dictionary <long, object> > barCabinet = barStore[instrument];

                    if (barCabinet.ContainsKey(BarType.Time))
                    {
                        Dictionary <long, object> barBox = barCabinet[BarType.Time];
                        foreach (KeyValuePair <long, object> kvp2 in barBox.ToList())
                        {
                            long    num     = kvp2.Key;
                            BarData barData = (BarData)kvp2.Value;
                            if (barData.RealyEndTime == args.SignalTime)
                            {
                                if (!barFinishedStore.ContainsKey(num))
                                {
                                    barFinishedStore.Add(num, new Dictionary <IFIXInstrument, Bar>());
                                }
                                Dictionary <IFIXInstrument, Bar> barFinishedCabinet = barFinishedStore[num];
                                barFinishedCabinet.Add(instrument, barData.Bar);
                                barBox.Remove(num);
                            }
                        }
                        if (barBox.Count == 0)
                        {
                            barCabinet.Remove(BarType.Time);
                        }
                    }
                    if (barCabinet.Count == 0)
                    {
                        barStore.Remove(instrument);
                    }
                }
            }
            finally
            {
                Monitor.Exit(this);
            }
            foreach (KeyValuePair <long, Dictionary <IFIXInstrument, Bar> > kvp3 in barFinishedStore)
            {
                long barSize = kvp3.Key;
                Dictionary <IFIXInstrument, Bar> barFinishedCabinet = kvp3.Value;
                foreach (KeyValuePair <IFIXInstrument, Bar> pair in barFinishedCabinet)
                {
                    this.EmitNewBar(pair.Value, pair.Key);
                }
                this.EmitNewBarSlice(barSize);
            }
            this.times.Remove(args.SignalTime);
        }
示例#7
0
 protected override void ShowReminderAlerts(object sender, ReminderEventArgs e)
 {
     if (_remindersForm == null)
     {
         _remindersForm           = new RemindersForm(Application, (SchedulerStorage)sender);
         _remindersForm.Disposed += RemindersFormDisposed;
     }
     ((System.Windows.Forms.Form)Application.MainWindow.Template).Invoke((Action)(() => _remindersForm.OnReminderAlert(e)));
 }
        private void schedulerStorage1_ReminderAlert(object sender, ReminderEventArgs e)
        {
            for (int i = 0; i < e.AlertNotifications.Count; i++)
            {
                ReminderAlertNotification reminderAlertNotification = e.AlertNotifications[i];

                reminderAlertNotification.Ignore  = !reminderAlertNotification.ActualAppointment.ResourceId.Equals(currentUserId);
                reminderAlertNotification.Handled = true;
            }
        }
        protected override void ShowReminderAlerts(object sender, ReminderEventArgs e)
        {
            var view = (DashboardView)Application.CreateView(Application.FindModelView("ReminderFormView"));
            var showViewParameters = new ShowViewParameters(view);
            var dashboardViewItems = view.GetItems <DashboardViewItem>().First();

            showViewParameters.TargetWindow    = TargetWindow.NewWindow;
            dashboardViewItems.ControlCreated += DashboardViewItemsOnControlCreated;
            Application.ShowViewStrategy.ShowView(showViewParameters, new ShowViewSource(Application.MainWindow, null));
        }
示例#10
0
        protected override void ShowReminderAlerts(object sender, ReminderEventArgs e)
        {
            var view = (DashboardView)Application.CreateView(Application.FindModelView("ReminderFormView"));
            var showViewParameters = new ShowViewParameters(view)
            {
                TargetWindow = TargetWindow.NewWindow
            };

            Application.ShowViewStrategy.ShowView(showViewParameters, new ShowViewSource(Application.MainWindow, null));
        }
示例#11
0
    protected void ASPxScheduler1_ReminderAlert(object sender, ReminderEventArgs e)
    {
        Appointment app = ASPxScheduler1.Storage.CreateAppointment(AppointmentType.Normal);

        app.Subject = "Created from the appointment with customfield Price = " + e.AlertNotifications[0].ActualAppointment.CustomFields["Price"]
                      + " on alert";
        app.Start    = e.AlertNotifications[0].ActualAppointment.Start.AddHours(2);
        app.Duration = TimeSpan.FromHours(4);
        ASPxScheduler1.Storage.Appointments.Add(app);
        e.AlertNotifications[0].Reminder.Dismiss();
        e.AlertNotifications[0].Handled = true;
    }
示例#12
0
        private void nAMLprxZKC(ReminderEventArgs obj0)
        {
            SortedList sortedList = new SortedList();

            lock (this)
            {
                foreach (DictionaryEntry item_1 in new Hashtable(this.A3ELH6L4QJ))
                {
                    IFIXInstrument local_2 = (IFIXInstrument)item_1.Key;
                    Hashtable      local_3 = (Hashtable)item_1.Value;
                    SortedList     local_4 = local_3[BarType.Time] as SortedList;
                    if (local_4 != null)
                    {
                        foreach (DictionaryEntry item_0 in new SortedList(local_4))
                        {
                            long local_6 = (long)item_0.Key;
                            Bar  local_7 = (Bar)item_0.Value;
                            if (local_7.BeginTime.AddSeconds(local_6) == obj0.SignalTime)
                            {
                                local_7.EndTime = obj0.SignalTime;
                                ArrayList local_8 = sortedList[local_6] as ArrayList;
                                if (local_8 == null)
                                {
                                    local_8 = new ArrayList();
                                    sortedList.Add(local_6, local_8);
                                }
                                local_8.Add(new KeyValuePair <IFIXInstrument, Bar>(local_2, local_7));
                                local_4.Remove(local_6);
                            }
                        }
                        if (local_4.Count == 0)
                        {
                            local_3.Remove(BarType.Time);
                        }
                        if (local_3.Count == 0)
                        {
                            this.A3ELH6L4QJ.Remove(local_2);
                        }
                    }
                }
            }
            foreach (DictionaryEntry dictionaryEntry in sortedList)
            {
                long num = (long)dictionaryEntry.Key;
                foreach (KeyValuePair <IFIXInstrument, Bar> keyValuePair in (ArrayList)dictionaryEntry.Value)
                {
                    this.EmitNewBar(keyValuePair.Value, keyValuePair.Key);
                }
                this.EmitNewBarSlice(num);
            }
            this.NJNLAPvWPO.Remove(obj0.SignalTime);
        }
示例#13
0
 private void OnClock(ReminderEventArgs args)
 {
     if (args.SignalTime > Clock.Now)
     {
         return;
     }
     this.stopValue = this.portfolio.GetValue();
     this.strategy.ClosePortfolio();
     if (this.stopStrategy)
     {
         this.strategy.IsActive = false;
     }
     this.Complete(StopStatus.Executed);
 }
示例#14
0
 private void AaPRYK2epA(ReminderEventArgs e)
 {
     if (e.SignalTime > Clock.Now)
     {
         return;
     }
     this.FuNRz16ilo = this.ElNRan0isi.GetValue();
     this.sKmRoRmeN5.ClosePortfolio();
     if (this.RUQiAxBBaC)
     {
         this.sKmRoRmeN5.IsActive = false;
     }
     this.aH7RuF48ZR(StopStatus.Executed);
 }
        private void SchedulerStorage1_ReminderAlert(object sender, ReminderEventArgs e)
        {
            // Create a new appointment.
            Appointment app = schedulerStorage1.CreateAppointment(AppointmentType.Normal);

            app.Subject  = "Created on alert from appointment w/Price = " + e.AlertNotifications[0].ActualAppointment.CustomFields["CustomPrice"];
            app.Start    = e.AlertNotifications[0].ActualAppointment.Start.AddHours(2);
            app.Duration = TimeSpan.FromHours(4);
            schedulerStorage1.Appointments.Add(app);

            // Modify the appointment for which the alert is triggered.
            e.AlertNotifications[0].ActualAppointment.LabelKey = 3;

            // Prevent the event from being fired one more time.
            e.AlertNotifications[0].ActualAppointment.Reminder.Dismiss();
        }
示例#16
0
        private void OnReminderAlert(object sender, ReminderEventArgs e)
        {
            //Add your custom action here. For example, show the Reminders form:
            myEmployeeInfo = ACMSLogic.Staff.Ultis.EmployeeInfo(System.Convert.ToInt32(e.AlertNotifications[0].ActualAppointment.CustomFields["nEmployeeID"]));
            strHP          = myEmployeeInfo["strContactNo"].ToString();
            string       strSubject = e.AlertNotifications[0].ActualAppointment.Subject.ToString();
            StreamWriter SW;

            SW = File.CreateText(@"\\192.168.0.121\c$\Program Files\V-SMS Lite Edition\V-CharonLite\COW\out_going\MyTextFile.txt");
            //SW = File.CreateText(@"C:\MyTextFile.txt");
            SW.WriteLine(strHP + "\t" + strSubject);
            SW.Close();

            RemindersForm form = new RemindersForm((SchedulerStorage)sender);

            form.OnReminderAlert(e);
        }
        void schedulerControl1_RemindersFormShowing(object sender, RemindersFormEventArgs e)
        {
            ReminderAlertNotificationCollection alerts = new ReminderAlertNotificationCollection();

            foreach (ReminderAlertNotification alert in e.AlertNotifications)
            {
                if (alert.ActualAppointment.StatusKey.ToString() == "1")
                {
                    alerts.Add(alert);
                }
            }
            if (alerts.Count > 0)
            {
                RemindersForm     remindersForm = new RemindersForm((SchedulerControl)sender);
                ReminderEventArgs args          = new ReminderEventArgs(alerts);
                remindersForm.FormClosed += new FormClosedEventHandler(remindersForm_FormClosed);
                remindersForm.OnReminderAlert(args);
            }
            e.Handled = true;
        }
示例#18
0
 private void doJobs(ReminderEventArgs args)
 {
     if (this.jobs != null)
     {
         this.jobThread = new Thread(new ThreadStart(this.jobs.Run));
         this.jobThread.Start();
         this.jobThread.Join();
         if (this.jobThread.ThreadState == ThreadState.Aborted || this.closed)
         {
             if (this.autoEvent != null)
             {
                 this.autoEvent.Set();
             }
             Console.WriteLine("作业被中断执行。");
             return;
         }
         //如果没有完成且小于偿试的次数,N分钟后继续启动
         if ((!this.jobs.Finished) && (this.jobs.Times < maxTimes))
         {
             Clock.AddReminder(this.jobEventHandler, Clock.Now.Add(interval), null);
         }
         else
         {
             if (this.autoEvent != null)
             {
                 this.autoEvent.Set();
             }
             if (this.jobs.Finished)
             {
                 Console.WriteLine("所有作业执行完毕");
             }
             else if (this.jobs.Times >= maxTimes)
             {
                 Console.WriteLine("偿试多次后仍然无法完成。");
             }
         }
     }
 }
 protected virtual void ShowReminderAlerts(object sender, ReminderEventArgs e) { }
示例#20
0
 private static void OnReminderFailed(object sender, ReminderEventArgs args) =>
 Logger.LogWarning(
     $"Reminder ({args.Reminder.Id}) at " +
     $"{args.Reminder.DateTime:F} sent failed with " +
     $"message {args.Reminder.Message}"
     );
 public void NotifyLackOfActiveTask(object obj, ReminderEventArgs args)
 {
     Console.WriteLine("There is no Active Task.");
 }
        void storage_ReminderAlert(object sender, ReminderEventArgs e)
        {
            ReminderAlertNotificationCollection reminders = e.AlertNotifications;

            ASPxCallback1.JSProperties["cpReminders"] = reminders;
        }
示例#23
0
 protected abstract void ShowReminderAlerts(object sender, ReminderEventArgs e);
示例#24
0
 protected abstract void ShowReminderAlerts(object sender, ReminderEventArgs e);
示例#25
0
 private void Clock_Reminder(ReminderEventArgs args)
 {
     this.Cancel();
 }
示例#26
0
 private void OnClock(ReminderEventArgs args)
 {
     this.fStopPrice = this.fInstrument.Price();
     this.Complete(StopStatus.Executed);
 }
示例#27
0
 static void Storage_ReminderAlert(object sender, ReminderEventArgs e)
 {
 }
示例#28
0
 protected override void ShowReminderAlerts(object sender, ReminderEventArgs e) {
     var view = (DashboardView)Application.CreateView(Application.FindModelView("ReminderFormView"));
     var showViewParameters = new ShowViewParameters(view){TargetWindow = TargetWindow.NewWindow};
     Application.ShowViewStrategy.ShowView(showViewParameters, new ShowViewSource(Application.MainWindow, null));            
 }
 private void MxtPRD9hCH(ReminderEventArgs e)
 {
     this.lCXP6mCfhb(e.Data as NewOrderSingle);
 }
示例#30
0
		private void OnReminder(ReminderEventArgs args)
		{
			this.OnTimer(args.SignalTime, args.Data);
		}
示例#31
0
 private static void OnReminderSent(object sender, ReminderEventArgs args) =>
 Logger.LogInformation(
     $"Reminder ({args.Reminder.Id}) at " +
     $"{args.Reminder.DateTime:F} sent received with " +
     $"message {args.Reminder.Message}"
     );
 private void t99PErAC3Y(ReminderEventArgs e)
 {
     this.E3jPCDq9jY(e.Data as OrderCancelRequest);
 }
 private void gFqPLKYI6J(ReminderEventArgs e)
 {
     this.M9IPlabLYo(e.Data as OrderCancelReplaceRequest);
 }
示例#34
0
 private void xT1FyAqCPT(ReminderEventArgs obj0)
 {
     this.XNWFfvowtr();
 }
示例#35
0
 protected virtual void ShowReminderAlerts(object sender, ReminderEventArgs e)
 {
 }
 public void NotifyIntervalPassed(object obj, ReminderEventArgs args)
 {
     Console.WriteLine("{0} minutes have passed in the task: {1}, are you still working in the same task?", args.TheReminder.Interval, args.TheTask.Description);
 }
示例#37
0
 /// <summary>
 /// Raises ReminderNotification event.
 /// </summary>
 /// <param name="e">Event arguments</param>
 protected virtual void OnReminderNotification(ReminderEventArgs e)
 {
     ReminderEventHandler h = ReminderNotification;
     if (h != null)
         h(this, e);
 }
示例#38
0
		private void OnReminder(ReminderEventArgs args)
		{
			HashSet<object> hashSet;
			if (this.timers.TryGetValue(args.SignalTime, out hashSet))
			{
				this.timers.Remove(args.SignalTime);
				foreach (object current in hashSet)
				{
					this.OnTimer(args.SignalTime, current);
				}
			}
		}
示例#39
0
        private void OnReminderAlert(object sender, ReminderEventArgs e)
        {
            //Add your custom action here. For example, show the Reminders form:
            myEmployeeInfo = ACMSLogic.Staff.Ultis.EmployeeInfo(System.Convert.ToInt32(e.AlertNotifications[0].ActualAppointment.CustomFields["nEmployeeID"]));
            strHP = myEmployeeInfo["strContactNo"].ToString();
            string strSubject = e.AlertNotifications[0].ActualAppointment.Subject.ToString();
            StreamWriter SW;
            SW = File.CreateText(@"\\192.168.0.121\c$\Program Files\V-SMS Lite Edition\V-CharonLite\COW\out_going\MyTextFile.txt");
            //SW = File.CreateText(@"C:\MyTextFile.txt");
            SW.WriteLine(strHP + "\t" + strSubject);
            SW.Close();

            RemindersForm form = new RemindersForm((SchedulerStorage)sender);
            form.OnReminderAlert(e);
        }