Exemplo n.º 1
0
 public OutlookProcessor() : base(null, false)
 {
     _tracer = new Tracer("OutlookProcessor");
     try
     {
         OutlookSession.Init(this);
         OnSettingsChanged(null, null);
         IdlePeriod       = Settings.IdlePeriod * 60000;
         ThreadName       = "Outlook AsyncProcessor";
         ThreadPriority   = ThreadPriority.Normal;
         ThreadStarted   += new EventHandler(_outlookProcessor_ThreadStarted);
         ThreadFinished  += new EventHandler(_outlookProcessor_ThreadFinished);
         ProcessMessages  = true;
         ExceptionHandler = new AsyncExceptionHandler(HandleException);
         _UIManager       = Core.UIManager;
         _UIManager.RegisterIndicatorLight("Outlook", this, 10,
                                           OutlookPlugin.LoadIconFromAssembly("OutlookPlugin.Icons.outlook_idle.ico"),
                                           OutlookPlugin.LoadIconFromAssembly("OutlookPlugin.Icons.outlook_busy.ico"),
                                           OutlookPlugin.LoadIconFromAssembly("OutlookPlugin.Icons.outlook_stuck.ico"));
         _UIManager.MainWindowClosing += new System.ComponentModel.CancelEventHandler(_UIManager_MainWindowClosing);
         StartThread();
         _inited = true;
     }
     catch (Exception exception)
     {
         SetLastException(exception);
     }
 }
Exemplo n.º 2
0
        private AsyncExceptionHandler CreateExceptionHandler()
        {
            exceptionHandler            = new AsyncExceptionHandler(this.Dispatcher);
            exceptionHandler.Exception += (sender, e) =>
            {
                var    exception  = e.Value;
                string ownMessage = string.Empty;


                switch (exception.Message)
                {
                case "Aggregation for Data Collection not possible!":
                    ownMessage = "This error means that no single parameter is selected for Data Collection evaluation.\n" +
                                 "To fix this error go to \"Data Collection - Configuration\" window\n" +
                                 "[Evaluation -> Files -> Data collection -> Configuration -> Configuration]\n" +
                                 "end select at least one parameter to evaluation";
                    break;
                }

                var result = MessageBox.Show(this,
                                             "An error occured. The following information might help you decide to try to continue your work or not."
                                             + "\n\nOriginal exception: " + exception.Message
                                             + (string.IsNullOrWhiteSpace(ownMessage) ? string.Empty : "\n\nRemark: " + ownMessage)
                                             + "\n\nPress [Yes] to try again or [No] to try to continue."
                                             , exception.GetType().ToString(), MessageBoxButton.YesNo, MessageBoxImage.Error);

                e.Param.Value = (result == MessageBoxResult.Yes);
            };

            return(exceptionHandler);
        }
Exemplo n.º 3
0
        internal ForEach(IEnumerable <T> collection, MethodProcessor <T> method, int initialDegreeOfParallelism, AsyncExceptionHandler <T> exceptionHandler)
        {
            _collection       = collection;
            _method           = method;
            _exceptionHandler = exceptionHandler;

            _gate = new AsyncCounterGate(initialDegreeOfParallelism);
        }
Exemplo n.º 4
0
        public Analyst(ProjectManager clerk, ShadowMaker shadowMaker, AsyncExceptionHandler exceptionHandler)
        {
            this.aex = exceptionHandler;

            this.shadowMaker = shadowMaker;

            this.clerk = clerk;
            this.Host  = new ReportBindingSource(shadowMaker, exceptionHandler, clerk);

            //this.Host.DrawModel += new EventHandler<EventArgs<UserControl, bool>>(Host_DrawModel);
            this.Host.DrawPoints             += new EventHandler <EventArgs <UserControl> >(Host_DrawPoints);
            this.Host.DrawCounters           += new EventHandler <EventArgs <UserControl> >(Host_DrawCounters);
            this.Host.GenerateCountersReport += new EventHandler <EventArgs <DataTableEx, Dispatcher> >(Host_GenerateCountersReport);
            this.Host.GenerateTrTimesReport  += new EventHandler <EventArgs <DataTableEx, Dispatcher> >(Host_GenerateTrTimesReport);

            this.Host.DrawSections += new EventHandler <EventArgs <UserControl> >(Host_DrawSections);
            this.Host.DrawTrTimes  += new EventHandler <EventArgs <UserControl> >(Host_DrawTrTimes);
        }
Exemplo n.º 5
0
 public void setAsyncExceptionHandler(AsyncExceptionHandler handler)
 {
     this._javaWorkingMemory.setAsyncExceptionHandler(handler);
 }
Exemplo n.º 6
0
 IBuilder <T> IWhenExceptionHelper <IBuilder <T>, T> .WhenExceptionAsync(AsyncExceptionHandler <T> exceptionHandler)
 {
     return(WhenException(exceptionHandler));
 }
Exemplo n.º 7
0
 IBuilderWithInitialDegreeOfParallelism <T> IWhenExceptionHelper <IBuilderWithInitialDegreeOfParallelism <T>, T> .WhenExceptionAsync(AsyncExceptionHandler <T> exceptionHandler)
 {
     return(WhenException(exceptionHandler));
 }
Exemplo n.º 8
0
 private Impl <T> WhenException(AsyncExceptionHandler <T> exceptionHandler)
 {
     ExceptionHandler = exceptionHandler ?? throw new ArgumentNullException(nameof(exceptionHandler));
     return(this);
 }
Exemplo n.º 9
0
 public ProjectManager(Dispatcher disp, AsyncExceptionHandler exceptionHandler)
 {
     this.aex            = exceptionHandler;
     this.defaultContext = disp;
 }
Exemplo n.º 10
0
 public void setAsyncExceptionHandler(AsyncExceptionHandler handler)
 {
     this._javaWorkingMemory.setAsyncExceptionHandler(handler);
 }
Exemplo n.º 11
0
 public Experimenter(string modelName, ProjectManager manager, AsyncExceptionHandler exceptionHandler)
 {
     this.aex       = exceptionHandler;
     this.modelName = modelName;
     this.manager   = manager;
 }
Exemplo n.º 12
0
 public void SetExceptionHandler(AsyncExceptionHandler handler)
 {
     ExceptionHandler = handler;
 }