/// <summary>
        /// Invokes the editor for the columns of the designed ImageListView.
        /// </summary>
        public void EditColumns()
        {
            // IComponentChangeService is used to pass change notifications to the designer
            IComponentChangeService ccs = (IComponentChangeService)GetService(typeof(IComponentChangeService));

            // Get the collection editor
            columnProperty = GetPropertyByName("Columns");
            UITypeEditor editor = (UITypeEditor)columnProperty.GetEditor(typeof(UITypeEditor));
            object       value  = imageListView.Columns;

            // Notify the designers of the change
            if (ccs != null)
            {
                ccs.OnComponentChanging(imageListView, columnProperty);
            }

            // Edit the value
            value = editor.EditValue(this, this, value);
            imageListView.Columns = (ImageListView.ImageListViewColumnHeaderCollection)value;

            // Notify the designers of the change
            if (ccs != null)
            {
                ccs.OnComponentChanged(imageListView, columnProperty, null, null);
            }

            designerService.Refresh(Component);
        }
 /// <summary>
 /// Refreshes the component.
 /// </summary>
 internal void RefreshComponent()
 {
     if (DesignerActionUIService != null)
     {
         DesignerActionUIService.Refresh(ZeroitToxicButton);
     }
 }
Example #3
0
 /// <summary>
 /// Refreshes the contets of designer smart tag panel.
 /// </summary>
 public void RefreshDesigner()
 {
     if (m_DesignerService != null)
     {
         m_DesignerService.Refresh(Component);
     }
 }
Example #4
0
        private void OnOrientationClick(object sender, EventArgs e)
        {
            // Cast to the correct type
            DesignerVerb verb = sender as DesignerVerb;

            // Double check the source is the expected type
            if (verb != null)
            {
                // Decide on the new orientation required
                Orientation orientation = verb.Text.Equals("Horizontal orientation") ? Orientation.Horizontal : Orientation.Vertical;

                // Decide on the next action to take given the new setting
                if (orientation == Orientation.Vertical)
                {
                    _action = "Horizontal orientation";
                }
                else
                {
                    _action = "Vertical orientation";
                }

                // Get access to the actual Orientation propertry
                PropertyDescriptor orientationProp = TypeDescriptor.GetProperties(_trackBar)["Orientation"];

                // If we succeeded in getting the property
                // Update the actual property with the new value
                orientationProp?.SetValue(_trackBar, orientation);

                // Get the user interface service associated with actions
                DesignerActionUIService service = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;

                // If we managed to get it then request it update to reflect new action setting
                service?.Refresh(_trackBar);
            }
        }
Example #5
0
        // This method creates a Timer component using the
        // IDesignerHost.CreateComponent method. It also
        // creates an event handler for the Timer component's
        // tick event.
        private void CreateTimer()
        {
            if (_host != null)
            {
                IEventBindingService    eventBindingService     = UIDesigner_Service.IEventBindingService_FromHost(_host);
                DesignerActionUIService designerActionUIService = UIDesigner_Service.DesignerActionUIService_FromHost(_host);

                //if (this.relatedDesigner.createdTimer == null)
                {
                    // Create and configure the Timer object.
                    _createdTimer = _host.CreateComponent(typeof(Timer)) as Timer;
                    if (_createdTimer == null)
                    {
                        return;                        // ================================================
                    }
                    Timer t = _createdTimer;
                    t.Interval = 1000;
                    t.Enabled  = true;

                    EventDescriptorCollection eventColl = TypeDescriptor.GetEvents(t, new Attribute[0]);
                    if (eventColl != null)
                    {
                        var eventDescriptor = eventColl["Tick"] as EventDescriptor;
                        if (eventDescriptor != null)
                        {
                            PropertyDescriptor propertyDescriptor = eventBindingService.GetEventProperty(eventDescriptor);
                            propertyDescriptor.SetValue(t, "timer_Tick");
                        }
                    }

                    designerActionUIService.Refresh(_createdTimer);
                }
            }
        }
Example #6
0
 /// <summary>
 /// Refreshes the component.
 /// </summary>
 internal void RefreshComponent()
 {
     if (DesignerActionUIService != null)
     {
         DesignerActionUIService.Refresh(colUserControl);
     }
 }
Example #7
0
 internal void RefreshComponent()
 {
     if (DesignerActionUIService != null)
     {
         DesignerActionUIService.Refresh(ButtonBar);
     }
 }
        private void OnCheckedClick(object sender, EventArgs e)
        {
            // Cast to the correct type
            DesignerVerb verb = sender as DesignerVerb;

            // Double check the source is the expected type
            if (verb != null)
            {
                // Decide on the new orientation required
                bool isChecked = verb.Text.Equals("Uncheck the button");

                // Decide on the next action to take given the new setting
                if (isChecked)
                {
                    _action = "Uncheck the button";
                }
                else
                {
                    _action = "Check the button";
                }

                // Get access to the actual Orientation propertry
                PropertyDescriptor checkedProp = TypeDescriptor.GetProperties(_checkButton)["Checked"];

                // If we succeeded in getting the property
                // Update the actual property with the new value
                checkedProp?.SetValue(_checkButton, !isChecked);

                // Get the user interface service associated with actions
                DesignerActionUIService service = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;

                // If we managed to get it then request it update to reflect new action setting
                service?.Refresh(_checkButton);
            }
        }
Example #9
0
        private void OnLinkVisitedClick(object sender, EventArgs e)
        {
            // Cast to the correct type
            DesignerVerb verb = sender as DesignerVerb;

            // Double check the source is the expected type
            if (verb != null)
            {
                // Invert the visited setting
                _linkLabel.LinkVisited = !_linkLabel.LinkVisited;

                // Decide on the next action to take given the new setting
                if (_linkLabel.LinkVisited)
                {
                    _action = "Link has not been visited";
                }
                else
                {
                    _action = "Link has been visited";
                }

                // Get the user interface service associated with actions
                DesignerActionUIService service = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;

                // If we managed to get it then request it update to reflect new action setting
                service?.Refresh(_linkLabel);
            }
        }
Example #10
0
            public void SwapColors()
            {
                Color c = _sep.Color1;

                _sep.Color1 = _sep.Color2;
                _sep.Color2 = c;
                designerActionSvc.Refresh(_sep);
            }
        public void Commit()
        {
            changeService.OnComponentChanged(ctrl, null, null, null);
            this.transaction.Commit();
            DesignerActionUIService designerActionUISvc =
                (DesignerActionUIService)this.actionList.GetService(typeof(DesignerActionUIService));

            designerActionUISvc.Refresh(this.actionList.Component);
        }
        private void RefreshDisplay()
        {
            DesignerActionUIService service = (DesignerActionUIService)GetService(typeof(DesignerActionUIService));

            if (service != null)
            {
                service.Refresh(SuperMarquee);
            }
        }
Example #13
0
        /// <summary>
        /// Refresh the smart tag added of component.
        /// </summary>
        private void RefreshSmartTag()
        {
            DesignerActionUIService actionUIService = (DesignerActionUIService)GetService(typeof(DesignerActionUIService));

            if (actionUIService != null)
            {
                actionUIService.Refresh(Component);
            }
        }
Example #14
0
        internal void RefreshDesigner()
        {
            DesignerActionUIService das = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;

            if (das != null)
            {
                das.Refresh(this.WizardControl);
            }
        }
Example #15
0
        internal void RefreshDesigner()
        {
            DesignerActionUIService das = GetService <DesignerActionUIService>();

            if (das != null)
            {
                das.Refresh(Control);
            }
        }
            /// <summary>
            /// Makes the frame movable.
            /// </summary>
            public void EnableMoving()
            {
                FrameType frameType = control.SerializationObject as FrameType;

                if (frameType != null)
                {
                    //frameType.movable = true;

                    ScriptsType scripts = GetScripts(frameType, true);

                    if (scripts != null)
                    {
                        // Retrieve current OnMouseDown event
                        string currentOnDown = (scripts.Events.ContainsKey(EventChoice.OnMouseDown)) ? scripts.Events[EventChoice.OnMouseDown] : String.Empty;

                        // Append start move script, if not found
                        if (!currentOnDown.Contains(FrameDesigner.startMoveScript))
                        {
                            currentOnDown += FrameDesigner.startMoveScript;
                        }

                        // Set the event handler
                        scripts.Events[EventChoice.OnMouseDown] = currentOnDown;

                        // Retrieve current OnMouseUp event
                        string currentOnUp = (scripts.Events.ContainsKey(EventChoice.OnMouseUp)) ? scripts.Events[EventChoice.OnMouseUp] : String.Empty;

                        // APpend stop move script, if not found
                        if (!currentOnUp.Contains(FrameDesigner.stopMoveScript))
                        {
                            currentOnUp += FrameDesigner.stopMoveScript;
                        }

                        // Set the event handler
                        scripts.Events[EventChoice.OnMouseUp] = currentOnUp;
                    }

                    // Raise ComponentChangedEvent
                    this.OnComponentChanged(EventArgs.Empty);

                    // Refresh the Designer Action UI
                    designerActionUIService.Refresh(this.Component);
                }
            }
        private void RefreshComponent(int index, WizardStep value)
        {
            DesignerActionUIService service = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;

            if (service == null)
            {
                return;
            }
            service.Refresh(Control);
        }
Example #18
0
        private void RefreshComponent(object sender, EventArgs e)
        {
            DesignerActionUIService service = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;

            if (service == null)
            {
                return;
            }
            service.Refresh(Control);
        }
Example #19
0
        /// <summary>
        /// Invokes the editor for the columns of the designed ImageListView.
        /// </summary>
        public void EditColumns()
        {
            // TODO: Column editing cannot be undone in the designer.
            property = TypeDescriptor.GetProperties(imageListView)["Columns"];
            UITypeEditor editor = (UITypeEditor)property.GetEditor(typeof(UITypeEditor));
            object       value  = imageListView.Columns;// property.GetValue(imageListView);

            value = editor.EditValue(this, this, value);
            SetProperty("Columns", value);
            designerService.Refresh(Component);
        }
Example #20
0
        private void RefreshComponent()
        {
            DesignerActionUIService service = (DesignerActionUIService)GetService(typeof(DesignerActionUIService));

            if (service == null)
            {
                return;
            }

            service.Refresh(Control);
        }
        public void InverceAlignment()
        {
            switch (customText.TextAlignment)
            {
            case ContentAlignment.MiddleLeft:
            case ContentAlignment.BottomLeft:
            case ContentAlignment.TopLeft:
                customText.TextAlignment = ContentAlignment.MiddleRight;
                break;

            case ContentAlignment.MiddleRight:
            case ContentAlignment.BottomRight:
            case ContentAlignment.TopRight:
                customText.TextAlignment = ContentAlignment.MiddleLeft;
                break;
            }
            //обновляем диалог тега
            service.Refresh(customText);
        }
            private void OnCollapsedActionClick(object sender, EventArgs e)
            {
                DesignerActionItem verb = sender as DesignerActionItem;

                if (verb != null)
                {
                    bool collapsed = verb.DisplayName.Equals("Collapse");
                    this.actionName = collapsed?"Uncollapse":"Collapse";
                    PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this.ownerComponent)["Collapsed"];
                    if ((descriptor != null) && (((bool)descriptor.GetValue(this.ownerComponent)) != collapsed))
                    {
                        descriptor.SetValue(this.ownerComponent, collapsed);
                    }
                    DesignerActionUIService service = (DesignerActionUIService)this.owner.GetService(typeof(DesignerActionUIService));
                    if (service != null)
                    {
                        service.Refresh(this.ownerComponent);
                    }
                }
            }
            private void OnOrientationActionClick(object sender, EventArgs e)
            {
                DesignerActionItem verb = sender as DesignerActionItem;

                if (verb != null)
                {
                    Orientation orientation = verb.DisplayName.Equals("Horizontal")?Orientation.Horizontal:Orientation.Vertical;
                    this.actionName = orientation == Orientation.Horizontal?"Vertical":"Horizontal";
                    PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this.ownerComponent)["Orientation"];
                    if ((descriptor != null) && (((Orientation)descriptor.GetValue(this.ownerComponent)) != orientation))
                    {
                        descriptor.SetValue(this.ownerComponent, orientation);
                    }
                    DesignerActionUIService service = (DesignerActionUIService)this.owner.GetService(typeof(DesignerActionUIService));
                    if (service != null)
                    {
                        service.Refresh(this.ownerComponent);
                    }
                }
            }
Example #24
0
        private void OnVisibleClick(object sender, EventArgs e)
        {
            // Cast to the correct type
            DesignerVerb verb = sender as DesignerVerb;

            // Find out if this is the first or second header verb
            bool header1 = (verb == _visible1);

            // The new visible value should be the opposite of the current value
            bool newVisible = !(header1 ? _headerGroup.HeaderVisiblePrimary : _headerGroup.HeaderVisibleSecondary);

            // Assign the new text to the correct header text
            if (header1)
            {
                _text1 = (newVisible ? "Hide primary header" : "Show primary header");
            }
            else
            {
                _text2 = (newVisible ? "Hide secondary header" : "Show secondary header");
            }

            if (header1)
            {
                _headerGroup.HeaderVisiblePrimary = newVisible;
            }
            else
            {
                _headerGroup.HeaderVisibleSecondary = newVisible;
            }

            // Get the user interface service associated with actions
            DesignerActionUIService service = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;

            // If we managed to get it then request it update to reflect new action setting
            if (service != null)
            {
                service.Refresh(_headerGroup);
            }
        }
 /// <summary>
 /// Add a new page to the navigator.
 /// </summary>
 public void AddPage()
 {
     _designer.AddPage();
     _serviceDesignerAction.Refresh(_navigator);
 }