示例#1
0
        protected override void OnStart(string[] args)
        {
            Trace.Listeners.Add(new TextWriterTraceListener(ConfigurationManager.AppSettings["TraceFile"]));
            Trace.AutoFlush = true;//每次写入日志后是否都将其保存到磁盘中
            //Console.WriteLine("正在启动");
            string _categoryName   = "MQ_Process";
            string _counterTPSName = "TPS";

            //Console.WriteLine("创建性能计数器");
            if (PerformanceCounterCategory.Exists(_categoryName))
            {
                PerformanceCounterCategory.Delete(_categoryName);
            }
            CounterCreationDataCollection ccdc = new CounterCreationDataCollection
            {
                new CounterCreationData(_counterTPSName, "TPS", PerformanceCounterType.RateOfCountsPerSecond32)
            };

            PerformanceCounterCategory.Create(_categoryName, "MQ_Process", PerformanceCounterCategoryType.MultiInstance,
                                              ccdc);

            //Console.WriteLine("创建MQ监听服务");
            PageViewProcess mp = new PageViewProcess("PVListener");
            EventProcess    ep = new EventProcess("EventListener");
            Task            t1 = Task.Factory.StartNew(delegate { mp.Receive(); });
            Task            t2 = Task.Factory.StartNew(delegate { ep.Receive(); });
            //Console.WriteLine("开始处理消息");
            //Task.WaitAll(t1, t2);
            //Console.Read();
        }
        private void checkBox_Fruit_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj => {
                ReturnValue.bKind = ReturnValue.bKind == true ? false : true;
                IsModified        = true;
                if (IsFruitModified)
                {
                    IsFruitModified  = false;
                    strModifiedFruit = "";
                }
                else
                {
                    IsFruitModified  = true;
                    strModifiedFruit = ReturnValue.strCommodity;
                }
            };

            tp.button_TouchUp(sender, e, Prs);


            //無効化されていた切り替えを有効に戻す

            CheckBox ch = (CheckBox)sender;

            ch.IsHitTestVisible = true;
        }
        /// <summary>
        /// ボタンタッチアップイベント時に呼び出して、キャプチャやe.Handledを制御して、指定されたメソッドを実行するメソッド
        /// <param name="sender">イベント送信元オブジェクト</param>
        /// <param name="e">タッチイベントパラメータ</param>
        /// <param name="Prs">実行するメソッド</param>
        /// </summary>
        public void button_TouchUp(object sender, TouchEventArgs e, EventProcess Prs)
        {
            FrameworkElement button = sender as FrameworkElement;

            if (button == null)
            {
                return;
            }

            //ポイントがまだ送信元オブジェクトの上にいるか判定する
            TouchPoint tp = e.GetTouchPoint(button);

            Rect bounds = new Rect(new Point(0, 0), button.RenderSize);

            if (bounds.Contains(tp.Position))
            {
                //System.Media.SystemSounds.Beep.Play();
                //TouchSound.Play();

                //指定されたメソッドを実行する
                Prs(sender);
            }



            button.ReleaseTouchCapture(e.TouchDevice);
            e.Handled = true;
        }
        private void button_send_TouchUp(object sender, TouchEventArgs e)
        {
            //MessageBox.Show("touch");

            EventProcess Prs = SaveCsvData;

            tp.button_TouchUp(sender, e, Prs);
        }
        private void Button_Enter_TouchDown(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                this.Close();
            };

            tp.button_TouchUp(sender, e, Prs);
        }
        private void button_Cancel_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                this.Close();
            };

            tp.button_TouchUp(sender, e, Prs);
        }
        private void button_DekidakaBackFolder_Clear_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                pwContext.pwBackFolderPath = "";
            };

            tp.button_TouchUp(sender, e, Prs);
        }
示例#8
0
        /// <summary>
        /// Параметры для процеса рассылка пошла
        /// </summary>
        /// <param name="eventProcess">Параметры для процесса</param>
        public static void SubscribeEventProcess(EventProcess eventProcess)
        {
            IHubContext context = GlobalHost.ConnectionManager.GetHubContext <SignalRinventory>();

            Loggers.Log4NetLogger.Info(new Exception("Параметры для процесса рассылка пошла: " + eventProcess.Id));
            SerializeJson json = new SerializeJson();

            context.Clients.All.SubscribeEventProcess(json.JsonLibaryIgnoreDate(eventProcess, "dd.MM.yyyy HH:mm"));
        }
        private void Button_Back_TouchDown(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                ReturnText = null;
                this.Close();
            };

            tp.button_TouchUp(sender, e, Prs);
        }
        private void Button_Del_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                ReturnText = "";
                this.Close();
            };

            tp.button_TouchUp(sender, e, Prs);
        }
        private void button_Cancel_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                result = MessageBoxResult.Cancel;
                this.Close();
            };

            tp.button_TouchUp(sender, e, Prs);
        }
        private void button_EndTime_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                ReturnValue.dtEndTime = DateTime.Now;
                IsModified            = true;
            };

            tp.button_TouchUp(sender, e, Prs);
        }
示例#13
0
        private void button_Enter_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                strTime = Dcx.iHour.ToString() + ":" + Dcx.iMinute.ToString();

                this.Close();
            };

            tp.button_TouchUp(sender, e, Prs);
        }
        private void textBox_Input_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                TextBox tbx = (TextBox)obj;

                FocusManager.SetFocusedElement(FocusManager.GetFocusScope(tbx), tbx);
            };

            tp.button_TouchUp(sender, e, Prs);
        }
示例#15
0
 private void OnEnable()
 {
     targetScript = target as EventProcess;
     if (targetScript.eventList == null)
     {
         targetScript.eventList = new List <EventComponent>();
     }
     currentEvent = EditorEventType.None;
     //有効化された時のイベント保持をする
     newEventList      = new List <EventComponent>(targetScript.eventList);
     eventListProperty = serializedObject.FindProperty("eventList");
 }
        private void button_select_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                Button bt = (Button)sender;

                ReturnText = (string)bt.Content.ToString();
                //MessageBox.Show(swContext.straButtonText[0].ToString());

                this.Close();
            };

            tp.button_TouchUp(sender, e, Prs);
        }
        private void checkBox_MultiDay_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj => {
                ReturnValue.bMulti = ReturnValue.bMulti == true ? false : true;
                IsModified         = true;
            };

            tp.button_TouchUp(sender, e, Prs);


            //無効化されていた切り替えを有効に戻す
            CheckBox ch = (CheckBox)sender;

            ch.IsHitTestVisible = true;
        }
示例#18
0
        public void Process(EventType eventType, EventProcess eventProcess, string awardName)
        {
            _logger.Log("EncourageEventProcessor-Process");
            switch (eventProcess)
            {
            case EventProcess.LockEvent:
                LockEvent(eventType, awardName);
                break;

            case EventProcess.UnLockEvent:
                UnLockeEvent(eventType, awardName);
                break;

            default:
                break;
            }
        }
        private void button_setting_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = obj =>
            {
                MainWindow mw = this;

                PreferenceWindow pw = new PreferenceWindow(mw);

                pw.Topmost = true;

                this.Grid_Opa.Visibility = Visibility.Visible;

                pw.ShowDialog();

                this.Grid_Opa.Visibility = Visibility.Collapsed;
            };

            tp.button_TouchUp(sender, e, Prs);
        }
示例#20
0
        //-----------------------------------------------------------------------------------------
        // Evénements
        //-----------------------------------------------------------------------------------------
        #region IEventProcess
        // Traite les événements
        public void ProcessEvent(object from, object _this, IEvent e)
        {
            //
            // Change
            // Action après le changement d'une entité
            //
            if (e is EntityChangeEvent)
            {
                EntityChangeEvent ev = e as EntityChangeEvent;
                // Concerne ce model ?
                if (ev.Model == app.appModel)
                {
                    if (ev.Entity is ObjectContent)
                    {
                        OnPropertyChanged("ObjectContentList");
                    }
                    if (ev.Entity is ParamContent)
                    {
                        CurParamContentList = new ObservableCollection <ParamContent>(curObjectContent.ParamContent);
                    }
                    if (ev.Entity is DatabaseSource)
                    {
                        OnPropertyChanged("CurDatabaseSource");
                    }
                }
            }

            //
            // Pré-Create
            // Préprare la création d'une nouvelle entité (avant édition des champs)
            //
            if (e is EntityPreCreateEvent)
            {
                EntityPreCreateEvent ev = e as EntityPreCreateEvent;

                // Alloue l'entité
                if (ev.Entity == null)
                {
                    ev.Entity = app.appModel.CreateEntity(ev.EntityName);
                }

                // Ajoute l'instance au model
                app.appModel.Add(ev.Entity);

                // Affecte le status de création
                ev.Entity.EntityState = EntityState.Added;

                // Initialise les données par défaut
                if (ev.Entity is IEntityPersistent)
                {
                    IEntityPersistent p = ev.Entity as IEntityPersistent;
                    //Affecte la source de données à la nouvelle entitée
                    p.Factory = app.appModel.project.Factory;
                }

                if (ev.Entity is ObjectContent)
                {
                    ObjectContent entity = ev.Entity as ObjectContent;
                    // Ajoute au projet en cours
                    app.Project.AddObjectContent(entity);
                    // Génére un identifiant unique
                    entity.Id = Guid.NewGuid().ToString("N");
                    foreach (var p in entity.ParamContent)
                    {
                        p.Id = Guid.NewGuid().ToString("N");
                    }
                }

                if (ev.Entity is ParamContent)
                {
                    ParamContent entity = ev.Entity as ParamContent;
                    CurObjectContent.AddParamContent(entity);
                    // Génére un identifiant unique
                    entity.Id = Guid.NewGuid().ToString("N");
                }

                if (ev.Entity is DatabaseSource)
                {
                    DatabaseSource entity = ev.Entity as DatabaseSource;
                    app.Project.AddDatabaseSource(entity);

                    if (app.States.SelectedDatabaseSourceId == null)
                    {
                        app.States.SelectedDatabaseSourceId = app.Project.DatabaseSource.First().Id;
                    }
                }

                // Actualise l'interface
                app.ProcessEvent(this, this, new EntityChangeEvent(e, ev.Entity, app.appModel));
            }

            //
            // Create
            // Crée la nouvelle entité (après édition des champs)
            //
            if (e is EntityCreateEvent)
            {
                EntityCreateEvent ev = e as EntityCreateEvent;
                if (ev.Entity != null)
                {
                    // Valide le status de création
                    ev.Entity.EntityState = EntityState.Unmodified;

                    // Actualise l'interface
                    app.ProcessEvent(this, this, new EntityChangeEvent(e, ev.Entity, app.appModel));
                }
            }

            //
            // Pré-Update
            // Les données de l'entité vont êtres modifiées
            //
            if (e is EntityPreUpdateEvent)
            {
                EntityPreUpdateEvent ev = e as EntityPreUpdateEvent;
                // si l'entité fait partie du model
                if (ev.Entity != null && app.appModel.Contains(ev.Entity))
                {
                    // Préviens l'application
                    app.ProcessEvent(this, this, new EntityChangeEvent(e, ev.Entity, app.appModel));
                }
            }

            //
            // Update
            // Les données de l'entité sont modifiées
            //
            if (e is EntityUpdateEvent)
            {
                EntityUpdateEvent ev = e as EntityUpdateEvent;
                // si l'entité fait partie du model
                if (ev.Entity != null && app.appModel.Contains(ev.Entity))
                {
                    // Test la validité des champs
                    if (ev.Entity is IEntityValidable)
                    {
                        string           error;
                        IEntityValidable v = ev.Entity as IEntityValidable;
                        if (!v.IsValid(out error))
                        {
                            app.ProcessException(new ApplicationException(error));
                            return;
                        }
                    }

                    // Valide le status de création
                    ev.Entity.EntityState = EntityState.Unmodified;

                    // Actualise l'interface
                    app.ProcessEvent(this, this, new EntityChangeEvent(e, ev.Entity, app.appModel));
                }
            }

            //
            // Delete
            // Supprime l'entité
            //
            if (e is EntityDeleteEvent)
            {
                EntityDeleteEvent ev = e as EntityDeleteEvent;
                // si l'entité fait partie du model
                if (ev.Entity != null && app.appModel.Contains(ev.Entity))
                {
                    // Supprime du model
                    app.appModel.Remove(ev.Entity);

                    // Actualise l'interface
                    app.ProcessEvent(this, this, new EntityChangeEvent(e, ev.Entity, app.appModel));
                }
            }

            // Implémente la gestion du copier coller
            EventProcess.ProcessCopyPasteEvents(app, this, app.appModel, from, _this, e);
        }
示例#21
0
        private void Textbox_NumberCopies_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = Textbox_NumberCopies_Press;

            tp.button_TouchUp(sender, e, Prs);
        }
        private void button_Clear_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = Clear_DataAsync;

            tp.button_TouchUp(sender, e, Prs);
        }
示例#23
0
        private void Textbox_Quantity_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = Textbox_Quantity_Press;

            tp.button_TouchUp(sender, e, Prs);
        }
        private void Edit_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = EditDataAsync;

            tp.button_TouchUp(sender, e, Prs);
        }
        private void button_Print_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = Button_Print_Press;

            tp.button_TouchUp(sender, e, Prs);
        }
 private void MakeEventProcessor()
 {
     event_process = new EventProcess(this);
     event_process.MakeEventProcessor();
 }
        private void button_LoadDekidaka_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = button_LoadDekidaka_Press;

            tp.button_TouchUp(sender, e, Prs);
        }
        private void button_DekidakaSaveFolder_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = button_DekidakaSaveFolder_Press;

            tp.button_TouchUp(sender, e, Prs);
        }
示例#29
0
        //-----------------------------------------------------------------------------------------
        // Evénements
        //-----------------------------------------------------------------------------------------
        #region IEventProcess
        // Traite les événements
        public void ProcessEvent(object from, object _this, IEvent e)
        {
            //
            // Model Change
            // Après le changement du model
            //
            if (e is ModelChangeEvent)
            {
                ModelChangeEvent ev = e as ModelChangeEvent;
                //Actualise l'interface
                UpdateUI();
                // Notifie les vues
                this.NotifyEvent(e);
            }

            //
            // Entity Change
            // Après le changement d'une entité
            //
            if (e is EntityChangeEvent)
            {
                EntityChangeEvent ev = e as EntityChangeEvent;
                //Actualise l'interface
                OnEntityChange(ev.Model, ev.Entity, ev.BaseEvent);
                // Notifie les vues
                this.NotifyEvent(e);
            }

            //
            // Pré-Create
            // Préprare la création d'une nouvelle entité (avant édition des champs)
            //
            if (e is EntityPreCreateEvent)
            {
                EntityPreCreateEvent ev = e as EntityPreCreateEvent;

                // Allocation
                if (ev.Entity == null)
                {
                    ev.Entity = app.appModel.CreateEntity(ev.EntityName);
                }

                // Affecte le status de création
                ev.Entity.EntityState = EntityState.Added;

                // Initialise les données par défaut
                if (ev.Entity is IEntityPersistent)
                {
                    IEntityPersistent p = ev.Entity as IEntityPersistent;
                    //Affecte la source de données à la nouvelle entitée
                    p.Factory = app.appModel.project.Factory;
                }

                if (ev.Entity is ObjectSyntax)
                {
                    ObjectSyntax entity = ev.Entity as ObjectSyntax;
                    // Ajoute au projet en cours
                    app.Project.AddObjectSyntax(entity);
                }


                if (ev.Entity is ParamSyntax)
                {
                    ParamSyntax entity = ev.Entity as ParamSyntax;
                    // Ajoute au projet en cours
                    app.Project.AddParamSyntax(entity);
                }

                if (ev.Entity is ObjectContent)
                {
                    ObjectContent entity = ev.Entity as ObjectContent;
                    // Ajoute au projet en cours
                    app.Project.AddObjectContent(entity);
                    // Génére un identifiant unique
                    entity.Id = Guid.NewGuid().ToString("N");
                    foreach (var p in entity.ParamContent)
                    {
                        p.Id = Guid.NewGuid().ToString("N");
                    }
                }

                if (ev.Entity is ParamContent)
                {
                    ParamContent entity = ev.Entity as ParamContent;
                    CurObjectContent.AddParamContent(entity);
                    // Génére un identifiant unique
                    entity.Id = Guid.NewGuid().ToString("N");
                }

                if (ev.Entity is SearchParams)
                {
                    SearchParams entity = ev.Entity as SearchParams;
                    app.Project.AddSearchParams(entity);
                }

                if (ev.Entity is DatabaseSource)
                {
                    DatabaseSource entity = ev.Entity as DatabaseSource;
                    app.Project.AddDatabaseSource(entity);

                    if (app.States.SelectedDatabaseSourceId == null)
                    {
                        app.States.SelectedDatabaseSourceId = app.Project.DatabaseSource.First().Id;
                    }
                }

                // Ajoute l'instance au model (notifie le controleur)
                app.appModel.Add(ev.Entity);
            }

            // Implémente la gestion du copier coller
            EventProcess.ProcessCopyPasteEvents(app, this, app.appModel, from, _this, e);

            /*
             *
             * //
             * // Change
             * // Action après le changement d'une entité
             * //
             * if (e is EntityChangeEvent)
             * {
             *  EntityChangeEvent ev = e as EntityChangeEvent;
             *  // Concerne ce model ?
             *  if (ev.Model == app.appModel)
             *  {
             *      if (ev.Entity is ObjectContent)
             *      {
             *          OnPropertyChanged("ObjectContentList");
             *      }
             *      if (ev.Entity is ParamContent)
             *      {
             *          CurParamContentList = new ObservableCollection<ParamContent>(curObjectContent.ParamContent);
             *      }
             *      if (ev.Entity is DatabaseSource)
             *      {
             *          OnPropertyChanged("CurDatabaseSource");
             *      }
             *  }
             * }*/
        }
        private void button_Enter_TouchUp(object sender, TouchEventArgs e)
        {
            EventProcess Prs = button_Enter_check;

            tp.button_TouchUp(sender, e, Prs);
        }