protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
 {
     UIDispatcher.Invoke(() => OnPropertyChanged(new PropertyChangedEventArgs(propertyName)));
 }
Beispiel #2
0
 public Task RunOnUIContextAsync(Action act)
 {
     return(UIDispatcher.RunAsync(act));
 }
 AttachProgramOptionsAggregatorFactoryImpl(UIDispatcher uiDispatcher, [ImportMany] IEnumerable <Lazy <AttachProgramOptionsProviderFactory, IAttachProgramOptionsProviderFactoryMetadata> > attachProgramOptionsProviderFactories)
 {
     this.uiDispatcher = uiDispatcher;
     this.attachProgramOptionsProviderFactories = attachProgramOptionsProviderFactories.ToArray();
 }
Beispiel #4
0
 /// <summary>
 /// Checks all changes, done via timer
 /// </summary>
 private void TimerCheckAllChanges(object state)
 {
     UIDispatcher.BeginInvoke(CheckMapLayerChanges);
 }
Beispiel #5
0
 /// <summary>
 /// Enqueues the given instructions with the given arguments on the main application dispatcher.
 /// This is a way to execute code in a fire-and-forget style
 /// </summary>
 /// <param name="priority">The priority.</param>
 /// <param name="action">The action.</param>
 /// <param name="args">The arguments.</param>
 public static void UIEnqueueInvoke(DispatcherPriority priority, Delegate action, params object[] args)
 {
     var task = UIDispatcher.InvokeAsync(priority, action, args);
 }
Beispiel #6
0
 private void BeginInvoke(Action action)
 {
     UIDispatcher.BeginInvoke(action);
 }
Beispiel #7
0
        protected virtual void Evaluate()
        {
            //Print some stuff if we're in debug mode
            if (DynamoViewModel.RunInDebug)
            {
            }

            // We have caught all possible exceptions in UpdateGraph call, I am
            // not certain if this try-catch block is still meaningful or not.
            try
            {
                Exception fatalException = null;
                bool      updated        = EngineController.UpdateGraph(ref fatalException);

                // If there's a fatal exception, show it to the user, unless of course
                // if we're running in a unit-test, in which case there's no user. I'd
                // like not to display the dialog and hold up the continuous integration.
                //
                if (IsTestMode == false && (fatalException != null))
                {
                    Action showFailureMessage = () => Nodes.Utilities.DisplayEngineFailureMessage(fatalException);

                    // The "Run" method is guaranteed to be called on a background
                    // thread (for Revit's case, it is the idle thread). Here we
                    // schedule the message to show up when the UI gets around and
                    // handle it.
                    //
                    if (UIDispatcher != null)
                    {
                        UIDispatcher.BeginInvoke(showFailureMessage);
                    }
                }

                // Currently just use inefficient way to refresh preview values.
                // After we switch to async call, only those nodes that are really
                // updated in this execution session will be required to update
                // preview value.
                if (updated)
                {
                    var nodes = DynamoViewModel.Model.HomeSpace.Nodes;
                    foreach (NodeModel node in nodes)
                    {
                        node.IsUpdated = true;
                    }
                }
            }
            catch (Exception ex)
            {
                /* Evaluation failed due to error */

                dynSettings.Controller.DynamoLogger.Log(ex);

                OnRunCancelled(true);

                //If we are testing, we need to throw an exception here
                //which will, in turn, throw an Assert.Fail in the
                //Evaluation thread.
                if (IsTestMode)
                {
                    throw new Exception(ex.Message);
                }
            }
        }
Beispiel #8
0
 public T GetViewModel <T>()
 {
     return(UIDispatcher.Execute <T>(() => ServiceProvider.GetService <T>()));
 }
 AutoShowLocalsWindow(UIDispatcher uiDispatcher, Lazy <ToolWindowsOperations> toolWindowsOperations, DebuggerSettings debuggerSettings)
 {
     this.uiDispatcher          = uiDispatcher;
     this.toolWindowsOperations = toolWindowsOperations;
     this.debuggerSettings      = debuggerSettings;
 }
Beispiel #10
0
 WatchVariablesWindowValueNodesProviderServiceImpl(UIDispatcher uiDispatcher, Lazy <WatchWindowExpressionsSettings> watchWindowExpressionsSettings)
 {
     this.uiDispatcher = uiDispatcher;
     this.watchWindowExpressionsSettings = watchWindowExpressionsSettings;
     providers = new WatchVariablesWindowValueNodesProvider[WatchWindowsHelper.NUMBER_OF_WATCH_WINDOWS];
 }
Beispiel #11
0
 private protected UIDispatcherObject(UIDispatcher dispatcher, string?name = null) : base(dispatcher.Service, name)
 {
     _dispatcher   = dispatcher;
     _parentThread = dispatcher.ParentThread;
 }
Beispiel #12
0
 public ValueNodesProviderImpl(VariablesWindowValueNodesProvider variablesWindowValueNodesProvider, UIDispatcher uiDispatcher, Lazy <DbgManager> dbgManager, Lazy <DbgLanguageService> dbgLanguageService, Lazy <DbgCallStackService> dbgCallStackService)
 {
     this.variablesWindowValueNodesProvider = variablesWindowValueNodesProvider ?? throw new ArgumentNullException(nameof(variablesWindowValueNodesProvider));
     this.uiDispatcher        = uiDispatcher ?? throw new ArgumentNullException(nameof(uiDispatcher));
     this.dbgManager          = dbgManager ?? throw new ArgumentNullException(nameof(dbgManager));
     this.dbgLanguageService  = dbgLanguageService ?? throw new ArgumentNullException(nameof(dbgLanguageService));
     this.dbgCallStackService = dbgCallStackService ?? throw new ArgumentNullException(nameof(dbgCallStackService));
     evalContextInfo          = new EvalContextInfo();
 }
Beispiel #13
0
 private void OnCanExecuteChanged()
 {
     UIDispatcher.Invoke(CanExecuteChanged, this, EventArgs.Empty);
 }
Beispiel #14
0
 public void Execute(object parameter)
 {
     UIDispatcher.Invoke(action);
 }
Beispiel #15
0
 public virtual async Task __FTC_Event_ImagePreviewTop_Entry()
 {
     ICollection <int> ribbonMenuEventId = new List <int> {
     };
     await UIDispatcher.InvokeAsync(() => ShowFrame("Pixstock.Applus.Containers.ImagePreviewTop", ribbonMenuEventId));
 }
Beispiel #16
0
 BookmarksListSettingsListener(UIDispatcher uiDispatcher, ISettingsService settingsService, BookmarkLocationSerializerService bookmarkLocationSerializerService)
 {
     this.uiDispatcher    = uiDispatcher;
     this.settingsService = settingsService;
     this.bookmarkLocationSerializerService = bookmarkLocationSerializerService;
 }
Beispiel #17
0
 public virtual async Task __FTC_Event_ImagePreviewTop_Exit()
 {
     ICollection <int> ribbonMenuEventId = new List <int> {
     };
     await UIDispatcher.InvokeAsync(() => HideFrame(ribbonMenuEventId));
 }
Beispiel #18
0
 private static void OnDisconnected()
 {
     UIDispatcher.Invoke(Disconnected);
     _current = null;
     UIDispatcher.Invoke(CurrentChanged);
 }
Beispiel #19
0
 WpfMemLeakWorkaround(UIDispatcher uiDispatcher, WatchContentFactory watchContentFactory)
 {
     this.uiDispatcher        = uiDispatcher;
     this.watchContentFactory = watchContentFactory;
 }
Beispiel #20
0
 private static void LoginSucceed(Client obj)
 {
     currentLogin = null;
     _current     = obj;
     UIDispatcher.Invoke(CurrentChanged);
 }
 DotNetReferenceNavigatorImpl(UIDispatcher uiDispatcher, IDocumentTabService documentTabService, Lazy <DbgMetadataService> dbgMetadataService)
 {
     this.uiDispatcher       = uiDispatcher;
     this.documentTabService = documentTabService;
     this.dbgMetadataService = dbgMetadataService;
 }
Beispiel #22
0
 BufferFileCreator(Lazy <HexBufferFileServiceFactory> hexBufferFileServiceFactory, UIDispatcher uiDispatcher)
 {
     this.hexBufferFileServiceFactory = hexBufferFileServiceFactory;
     this.uiDispatcher = uiDispatcher;
 }
Beispiel #23
0
 /// <summary>
 /// Synchronously invokes the given instructions on the main application dispatcher.
 /// </summary>
 /// <param name="priority">The priority. Set it to Normal by default.</param>
 /// <param name="action">The action.</param>
 public static void UIInvoke(DispatcherPriority priority, Action action)
 {
     UIDispatcher.InvokeAsync(priority, action, null).GetAwaiter().GetResult();
 }
Beispiel #24
0
 // UI thread
 public ModuleListener(HexBufferFileServiceFactory hexBufferFileServiceFactory, IHexBufferInfo hexBufferInfo, UIDispatcher uiDispatcher)
 {
     uiDispatcher.VerifyAccess();
     this.hexBufferInfo   = hexBufferInfo;
     this.uiDispatcher    = uiDispatcher;
     runtimes             = new List <DbgRuntime>();
     moduleReferences     = new Dictionary <HexPosition, int>();
     addedModules         = new HashSet <DbgModule>();
     hexBufferFileService = hexBufferFileServiceFactory.Create(hexBufferInfo.Buffer);
     hexBufferInfo.UnderlyingProcessChanged += HexBufferInfo_UnderlyingProcessChanged;
     hexBufferInfo.Buffer.Disposed          += Buffer_Disposed;
     OnProcessChanged_UI();
 }
Beispiel #25
0
 WpfCurrentStatementUpdater(UIDispatcher uiDispatcher, Lazy <IAppWindow> appWindow, DbgCallStackService dbgCallStackService, Lazy <ReferenceNavigatorService> referenceNavigatorService)
     : base(dbgCallStackService, referenceNavigatorService)
 {
     this.uiDispatcher = uiDispatcher;
     this.appWindow    = appWindow;
 }
Beispiel #26
0
 public void EndGame()
 {
     UIDispatcher.Invoke(GameEnd);
 }
 ValueNodesVMFactoryImpl_DbgManagerStartListener(UIDispatcher uiDispatcher, Lazy <ValueNodesVMFactoryImpl> valueNodesVMFactoryImpl)
 {
     this.uiDispatcher            = uiDispatcher;
     this.valueNodesVMFactoryImpl = valueNodesVMFactoryImpl;
 }
 LanguageEditValueProviderFactoryImpl(UIDispatcher uiDispatcher, EditValueProviderService editValueProviderService)
 {
     this.uiDispatcher             = uiDispatcher;
     this.editValueProviderService = editValueProviderService;
 }
 DeleteBreakpointsInRemovedModules(UIDispatcher uiDispatcher, Lazy <IDocumentTabService> documentTabService, Lazy <IModuleIdProvider> moduleIdProvider)
 {
     this.uiDispatcher       = uiDispatcher;
     this.documentTabService = documentTabService;
     this.moduleIdProvider   = moduleIdProvider;
 }
 ReferenceNavigatorServiceImpl(UIDispatcher uiDispatcher, [ImportMany] IEnumerable <Lazy <ReferenceNavigator, IReferenceNavigatorMetadata> > referenceNavigators, [ImportMany] IEnumerable <Lazy <ReferenceConverter, IReferenceConverterMetadata> > referenceConverters)
 {
     this.uiDispatcher        = uiDispatcher;
     this.referenceNavigators = referenceNavigators.OrderBy(a => a.Metadata.Order).ToArray();
     this.referenceConverters = referenceConverters.OrderBy(a => a.Metadata.Order).ToArray();
 }