Esempio n. 1
0
        private void OnRefreshDesignerActions(object sender, EventArgs e)
        {
            //NOTE: Make sure that we dont invalidate the workflow here. Workflow will be invalidated when'
            //the designer actions are refreshed on idle thread. Putting invalidation logic here causes the validation
            //to go haywire as before the idle message comes in we start getting to DesignerActions thru the paiting
            //logic to show smart tags. This causes problems and ConfigErrors appear everywhere on designer intermittently

            //PROBLEM: ConfigErrors appearing on the entire design surface
            //This is due to a race condition between the validation triggered during painting
            //logic and validation triggered when we try to access the DesignerActions from RefreshTask handler
            //In the validation logic we try to get to the types while doing so we Refresh the code compile unit
            //in typesystem which in turn triggers CodeDomLoader.Refresh. In this we remove types, call refresh handler
            //and add new types. While doing this after the remove types but before addtypes, call is made to the drawing
            //logic in which we try to grab the designer actions which triggers another set of validations hence now we
            //always call UpdateWindow after invalidatewindow so that the validation will always get triggered on painting thread.
            //NOTE: PLEASE DO NOT CHANGE SEQUENCE IN WHICH THE FOLLOWING HANDLERS ARE ADDED
            //THE PROBLEM CAN BE ALSO FIXED BY TRIGGERING VALIDATION IN RefreshDesignerActions ITSELF
            //FOR NOW THE REFRESH FIX WILL CAUSE MINIMAL IMPACT IN THE LIGHT OF M3

            WorkflowView workflowView = this.serviceProvider.GetService(typeof(WorkflowView)) as WorkflowView;

            if (this.refreshDesignerActionsHandler != null)
            {
                if (workflowView != null)
                {
                    workflowView.Idle -= this.refreshDesignerActionsHandler;
                }
                this.refreshDesignerActionsHandler = null;
            }

            DesignerHelpers.RefreshDesignerActions(this.serviceProvider);

            IPropertyValueUIService propertyValueService = this.serviceProvider.GetService(typeof(IPropertyValueUIService)) as IPropertyValueUIService;

            if (propertyValueService != null)
            {
                propertyValueService.NotifyPropertyValueUIItemsChanged();
            }

            RefreshTasks();
        }
        private void OnRefreshDesignerActions(object sender, EventArgs e)
        {
            WorkflowView view = this.serviceProvider.GetService(typeof(WorkflowView)) as WorkflowView;

            if (this.refreshDesignerActionsHandler != null)
            {
                if (view != null)
                {
                    view.Idle -= this.refreshDesignerActionsHandler;
                }
                this.refreshDesignerActionsHandler = null;
            }
            DesignerHelpers.RefreshDesignerActions(this.serviceProvider);
            IPropertyValueUIService service = this.serviceProvider.GetService(typeof(IPropertyValueUIService)) as IPropertyValueUIService;

            if (service != null)
            {
                service.NotifyPropertyValueUIItemsChanged();
            }
            this.RefreshTasks();
        }