public override void StartOperations(Vault vaultPersistent)
        {
            BackgroundDispatcher = new BackgroundDispatcher <TSecureConfiguration>(this);

            EventDispatcher = new EventDispatcher <TSecureConfiguration>(this);

            ValidatorDispatcher = new ValidatorDispatcher <TSecureConfiguration>(this);

            if (this.GetType().IsDefined(typeof(UseLicensingAttribute)))
            {
                var content = License?.Content <LicenseContentBase>();

                BackgroundDispatcher = new LicensedDispatcher(BackgroundDispatcher, content);

                EventDispatcher = new LicensedDispatcher(EventDispatcher, content);

                ValidatorDispatcher = new LicensedDispatcher <IEnumerable <ValidationFinding> >(ValidatorDispatcher, content);
            }

            BackgroundDispatcher.IncludeAssemblies(IncludeAssemblies());
            EventDispatcher.IncludeAssemblies(IncludeAssemblies());
            ValidatorDispatcher.IncludeAssemblies(IncludeAssemblies());

            base.StartOperations(vaultPersistent);
        }
        /// <summary>
        /// Registers background operations
        /// </summary>
        protected override void StartApplication()
        {
            TaskQueueBackgroundOperationManager = new TaskQueueBackgroundOperationManager(
                this,
                this.GetType().FullName.Replace(".", "-") + " - BackgroundOperations"
                );

            try
            {
                BackgroundDispatcher.Dispatch();
            }
            catch (Exception e)
            {
                SysUtils.ReportErrorMessageToEventLog("Could not dispatch the background operations.", e);
                return;
            }

            base.StartApplication();
        }
Ejemplo n.º 3
0
        public override void StartOperations(Vault vaultPersistent)
        {
            BackgroundDispatcher = new BackgroundDispatcher <TConfig>(this);

            EventDispatcher = new EventDispatcher <TConfig>(this);

            ValidatorDispatcher = new ValidatorDispatcher <TConfig>(this);

            if (this.GetType().IsDefined(typeof(UseLicensingAttribute)))
            {
                BackgroundDispatcher = new LicensedDispatcher(BackgroundDispatcher, licenseContent);

                EventDispatcher = new LicensedDispatcher(EventDispatcher, licenseContent);

                ValidatorDispatcher = new LicensedDispatcher <IEnumerable <ValidationFinding> >(ValidatorDispatcher, licenseContent);
            }

            //Left out the call to base.StartOperations() for testing purposes.
        }
Ejemplo n.º 4
0
        public void Dispose()
        {
            if (this._pipelineDispatcher != null)
            {
                this._pipelineDispatcher.Dispose();
                this._pipelineDispatcher = null;
            }

            if (this._backgroundDispatcher != null)
            {
                this._backgroundDispatcher.Dispose();
                this._backgroundDispatcher = null;
            }

            if (this._gameThreadDispatcher != null)
            {
                this._gameThreadDispatcher.Dispose();
                this._gameThreadDispatcher = null;
            }
        }
Ejemplo n.º 5
0
 private void OnPresentationSourceChanged(object sender, SourceChangedEventArgs e)
 {
     if (e.OldSource != null && e.NewSource != null)
     {
         return;
     }
     if (e.OldSource != null)
     {
         if (_backgroundDispatcher == null)
         {
             return;
         }
         _backgroundDispatcher.BeginInvoke(new Action(DisconnectHostedVisualFromSourceWorker));
     }
     else
     {
         if (e.NewSource == null)
         {
             return;
         }
         if (!_initializedOnce)
         {
             _initializedOnce = true;
             if (_backgroundDispatcher == null)
             {
                 var dispatcherName = DispatcherGroup;
                 if (string.IsNullOrEmpty(dispatcherName))
                 {
                     dispatcherName = "ElementContainer" + Guid.NewGuid();
                 }
                 _backgroundDispatcher = BackgroundDispatcher.GetBackgroundDispatcher(dispatcherName, StackSize);
             }
             _backgroundDispatcher.BeginInvoke(new Action(CreateHostedVisualWorker));
         }
         else
         {
             _backgroundDispatcher.BeginInvoke(new Action(ConnectHostedVisualToSourceWorker));
         }
     }
 }
Ejemplo n.º 6
0
 public DispatchManager(IDecalEventsProxy decalEventsProxy)
 {
     this._backgroundDispatcher = new BackgroundDispatcher();
     this._gameThreadDispatcher = new GameThreadDispatcher(decalEventsProxy);
     this._pipelineDispatcher = new PipelineDispatcher(decalEventsProxy);
 }
Ejemplo n.º 7
0
 private void btnStart_Click(object sender, RoutedEventArgs e)
 {
     prg.Value = prg.Minimum;
     Stop      = false;
     BackgroundDispatcher.BeginInvoke(new Action(Start));
 }