public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, string description, bool includeAsDesignerVerb)
     : base(displayName, category, description)
 {
     this.actionList = actionList;
     this.memberName = memberName;
     this.includeAsDesignerVerb = includeAsDesignerVerb;
 }
示例#2
0
 public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, string description, bool includeAsDesignerVerb)
     : base(displayName, category, description)
 {
     _actionList           = actionList;
     MemberName            = memberName;
     IncludeAsDesignerVerb = includeAsDesignerVerb;
 }
示例#3
0
        public static List <DesignerActionItem> GetAllAttributedActionItems(this DesignerActionList actionList)
        {
            var fullAIList = new List <DesignerActionItem>();

            foreach (var mbr in actionList.GetType().GetMethods(allInstBind))
            {
                foreach (IActionGetItem attr in mbr.GetCustomAttributes(typeof(DesignerActionMethodAttribute), false))
                {
                    if (mbr.ReturnType == typeof(void) && mbr.GetParameters().Length == 0)
                    {
                        fullAIList.Add(attr.GetItem(actionList, mbr));
                    }
                    else
                    {
                        throw new FormatException("DesignerActionMethodAttribute must be applied to a method returning void and having no parameters.");
                    }
                }
            }
            foreach (var mbr in actionList.GetType().GetProperties(allInstBind))
            {
                foreach (IActionGetItem attr in mbr.GetCustomAttributes(typeof(DesignerActionPropertyAttribute), false))
                {
                    fullAIList.Add(attr.GetItem(actionList, mbr));
                }
            }
            fullAIList.Sort(CompareItems);
            return(fullAIList);
        }
 public LineInfo(DesignerActionList list, DesignerActionItem item, Line line)
 {
     Debug.Assert(line is not null);
     Line = line;
     Item = item;
     List = list;
 }
示例#5
0
        public static DesignerActionItemCollection GetFilteredActionItems(this DesignerActionList actionList, List <DesignerActionItem> fullAIList)
        {
            var col = new DesignerActionItemCollection();

            fullAIList.ForEach(ai => { if (CheckCondition(actionList, ai))
                                       {
                                           col.Add(ai);
                                       }
                               });

            // Add header items for displayed items
            var i = 0; string cat = null;

            while (i < col.Count)
            {
                var curCat = col[i].Category;
                if (string.Compare(curCat, cat, true) != 0)
                {
                    col.Insert(i++, new DesignerActionHeaderItem(curCat));
                    cat = curCat;
                }
                i++;
            }

            return(col);
        }
 internal override void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, ToolTip toolTip, ref int currentTabIndex)
 {
     _textItem       = (DesignerActionTextItem)actionItem;
     _label.Text     = StripAmpersands(_textItem.DisplayName);
     _label.Font     = GetFont();
     _label.TabIndex = currentTabIndex++;
     toolTip.SetToolTip(_label, _textItem.Description);
 }
		public void AddRange (DesignerActionList[] value)
		{
			if (value == null)
				throw new ArgumentNullException ("value");
			
			foreach (DesignerActionList actionList in value)
				Add (actionList);
		}
 internal override void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, ToolTip toolTip, ref int currentTabIndex)
 {
     _actionList = actionList;
     _methodItem = (DesignerActionMethodItem)actionItem;
     toolTip.SetToolTip(_linkLabel, _methodItem.Description);
     _linkLabel.Text = StripAmpersands(_methodItem.DisplayName);
     _linkLabel.AccessibleDescription = actionItem.Description;
     _linkLabel.TabIndex = currentTabIndex++;
 }
 public DesignerActionMethodItem(DesignerActionList actionList, string memberName,
                                 string displayName, string category, string description,
                                 bool includeAsDesignerVerb)
     : base(displayName, category, description)
 {
     this.action_list   = actionList;
     this.member_name   = memberName;
     this.designer_verb = includeAsDesignerVerb;
 }
		public SmartTagTransactions(string transactionname,DesignerActionList list,Control ctrl)
		{
			
			this.actionList = list;
			this.ctrl = ctrl;
			host = (IDesignerHost)this.actionList.GetService(typeof(IDesignerHost));
			this.transaction = host.CreateTransaction(transactionname);
			changeService = (IComponentChangeService)this.actionList.GetService(typeof(IComponentChangeService));
			changeService.OnComponentChanging(ctrl,null);                                                      
		}
 public void AddRange(DesignerActionList[] value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     for (int i = 0; i < value.Length; i++)
     {
         this.Add(value[i]);
     }
 }
示例#12
0
 private static bool CheckCondition(DesignerActionList actionList, DesignerActionItem ai)
 {
     if (ai.Properties["Condition"] != null)
     {
         var p = actionList.GetType().GetProperty((string)ai.Properties["Condition"], allInstBind, null, typeof(bool), Type.EmptyTypes, null);
         if (p != null)
         {
             return((bool)p.GetValue(actionList, null));
         }
     }
     return(true);
 }
示例#13
0
            internal override void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, ToolTip toolTip, ref int currentTabIndex)
            {
                _actionList      = actionList;
                _panelHeaderItem = (DesignerActionPanelHeaderItem)actionItem;

                _titleLabel.Text        = _panelHeaderItem.DisplayName;
                _titleLabel.TabIndex    = currentTabIndex++;
                _subtitleLabel.Text     = _panelHeaderItem.Subtitle;
                _subtitleLabel.TabIndex = currentTabIndex++;
                _subtitleLabel.Visible  = (_subtitleLabel.Text.Length != 0);

                // Force the font to update
                OnParentControlFontChanged(null, EventArgs.Empty);
            }
示例#14
0
 public void Remove(DesignerActionList actionList)
 {
     if (actionList == null)
     {
         throw new ArgumentNullException("actionList");
     }
     foreach (IComponent component in this.designerActionLists.Keys)
     {
         if (((DesignerActionListCollection)this.designerActionLists[component]).Contains(actionList))
         {
             this.Remove(component, actionList);
             break;
         }
     }
 }
        /// <summary>
        /// This will remove the all instances of the DesignerAction from  the 'comp' object.  If an alarm was set, it will be unhooked. This will also fire the DesignerActionChanged event.
        /// </summary>
        public void Remove(IComponent comp, DesignerActionList actionList)
        {
            if (comp == null)
            {
                throw new ArgumentNullException(nameof(comp));
            }
            if (actionList == null)
            {
                throw new ArgumentNullException(nameof(actionList));
            }
            if (!_designerActionLists.Contains(comp))
            {
                return;
            }

            DesignerActionListCollection actionLists = (DesignerActionListCollection)_designerActionLists[comp];

            if (!actionLists.Contains(actionList))
            {
                return;
            }

            if (actionLists.Count == 1)
            {
                //this is the last action for this object, remove the entire thing
                Remove(comp);
            }
            else
            {
                //remove each instance of this action
                ArrayList actionListsToRemove = new ArrayList(1);
                foreach (DesignerActionList t in actionLists)
                {
                    if (actionList.Equals(t))
                    {
                        //found one to remove
                        actionListsToRemove.Add(t);
                    }
                }

                foreach (DesignerActionList t in actionListsToRemove)
                {
                    actionLists.Remove(t);
                }

                OnDesignerActionListsChanged(new DesignerActionListsChangedEventArgs(comp, DesignerActionListsChangedType.ActionListsRemoved, GetComponentActions(comp)));
            }
        }
        /// <summary>
        /// This will remove the specified Designeraction from  the DesignerActionService. All alarms will be unhooked and the DesignerActionsChagned event will be fired.
        /// </summary>
        public void Remove(DesignerActionList actionList)
        {
            if (actionList == null)
            {
                throw new ArgumentNullException(nameof(actionList));
            }

            //find the associated component
            foreach (IComponent comp in _designerActionLists.Keys)
            {
                if (((DesignerActionListCollection)_designerActionLists[comp]).Contains(actionList))
                {
                    Remove(comp, actionList);
                    break;
                }
            }
        }
示例#17
0
 public void Remove(IComponent comp, DesignerActionList actionList)
 {
     if (comp == null)
     {
         throw new ArgumentNullException("comp");
     }
     if (actionList == null)
     {
         throw new ArgumentNullException("actionList");
     }
     if (this.designerActionLists.Contains(comp))
     {
         DesignerActionListCollection lists = (DesignerActionListCollection)this.designerActionLists[comp];
         if (lists.Contains(actionList))
         {
             if (lists.Count == 1)
             {
                 this.Remove(comp);
             }
             else
             {
                 ArrayList list = new ArrayList(1);
                 foreach (DesignerActionList list2 in lists)
                 {
                     if (actionList.Equals(list2))
                     {
                         list.Add(list2);
                     }
                 }
                 foreach (DesignerActionList list3 in list)
                 {
                     lists.Remove(list3);
                 }
                 this.OnDesignerActionListsChanged(new DesignerActionListsChangedEventArgs(comp, DesignerActionListsChangedType.ActionListsRemoved, this.GetComponentActions(comp)));
             }
         }
     }
 }
 public DesignerActionListCollection(DesignerActionList[] value)
 {
     this.AddRange(value);
 }
 public void Remove(DesignerActionList actionList)
 {
     if (actionList == null)
     {
         throw new ArgumentNullException("actionList");
     }
     foreach (IComponent component in this.designerActionLists.Keys)
     {
         if (((DesignerActionListCollection) this.designerActionLists[component]).Contains(actionList))
         {
             this.Remove(component, actionList);
             break;
         }
     }
 }
示例#20
0
 public bool Contains(DesignerActionList value)
 {
     throw null;
 }
示例#21
0
 public void Insert(int index, DesignerActionList value)
 {
     throw null;
 }
 public int IndexOf(DesignerActionList value)
 {
     return(base.List.IndexOf(value));
 }
示例#23
0
 public void Add(IComponent comp, DesignerActionList actionList)
 {
     this.Add(comp, new DesignerActionListCollection(actionList));
 }
示例#24
0
 public void Add(IComponent comp, DesignerActionList actionList)
 {
     throw new NotImplementedException();
 }
 public int IndexOf(DesignerActionList value)
 {
     return base.List.IndexOf(value);
 }
 public void CopyTo(DesignerActionList[] array, int index)
 {
     base.List.CopyTo(array, index);
 }
 public bool Contains(DesignerActionList value)
 {
     return base.List.Contains(value);
 }
示例#28
0
		public void Add (IComponent comp, DesignerActionList actionList)
		{
			throw new NotImplementedException ();
		}
 public int Add(DesignerActionList value)
 {
     return base.List.Add(value);
 }
 internal DesignerActionListCollection(DesignerActionList actionList)
 {
     this.Add(actionList);
 }
示例#31
0
 public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, string description) : this(actionList, memberName, displayName, category, description, false)
 {
 }
 public ListViewActionListAdapter(ObjectListViewDesigner designer, DesignerActionList wrappedList)
     : base(wrappedList.Component) {
     this.designer = designer;
     this.wrappedList = wrappedList;
 }
 public void Insert(int index, DesignerActionList value)
 {
     base.List.Insert(index, value);
 }
 internal override void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, ToolTip toolTip, ref int currentTabIndex)
 {
 }
示例#35
0
		public void Remove (DesignerActionList actionList)
		{
			throw new NotImplementedException ();
		}
 public void Insert(int index, DesignerActionList value)
 {
     base.List.Insert(index, value);
 }
 public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, bool includeAsDesignerVerb)
     : this(actionList, memberName, displayName, category, null, includeAsDesignerVerb)
 {
 }
示例#38
0
 public int Add(DesignerActionList value)
 {
     throw null;
 }
 public void Remove(DesignerActionList value)
 {
     base.List.Remove(value);
 }
示例#40
0
 public int IndexOf(DesignerActionList value)
 {
     throw null;
 }
 public void Add(IComponent comp, DesignerActionList actionList)
 {
     this.Add(comp, new DesignerActionListCollection(actionList));
 }
示例#42
0
 public void Remove(DesignerActionList value)
 {
     throw null;
 }
示例#43
0
 public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName) : this(actionList, memberName, displayName, null, null, false)
 {
 }
 public void Remove(IComponent comp, DesignerActionList actionList)
 {
     if (comp == null)
     {
         throw new ArgumentNullException("comp");
     }
     if (actionList == null)
     {
         throw new ArgumentNullException("actionList");
     }
     if (this.designerActionLists.Contains(comp))
     {
         DesignerActionListCollection lists = (DesignerActionListCollection) this.designerActionLists[comp];
         if (lists.Contains(actionList))
         {
             if (lists.Count == 1)
             {
                 this.Remove(comp);
             }
             else
             {
                 ArrayList list = new ArrayList(1);
                 foreach (DesignerActionList list2 in lists)
                 {
                     if (actionList.Equals(list2))
                     {
                         list.Add(list2);
                     }
                 }
                 foreach (DesignerActionList list3 in list)
                 {
                     lists.Remove(list3);
                 }
                 this.OnDesignerActionListsChanged(new DesignerActionListsChangedEventArgs(comp, DesignerActionListsChangedType.ActionListsRemoved, this.GetComponentActions(comp)));
             }
         }
     }
 }
 public void Remove(DesignerActionList value)
 {
     base.List.Remove(value);
 }
 public bool Contains(DesignerActionList value)
 {
     return(base.List.Contains(value));
 }
 internal override void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, System.Windows.Forms.ToolTip toolTip, ref int currentTabIndex)
 {
 }
示例#48
0
 public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, bool includeAsDesignerVerb) : this(actionList, memberName, displayName, category, null, includeAsDesignerVerb)
 {
 }
 internal override void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, System.Windows.Forms.ToolTip toolTip, ref int currentTabIndex)
 {
     this._textItem = (DesignerActionTextItem) actionItem;
     this._label.Text = DesignerActionPanel.StripAmpersands(this._textItem.DisplayName);
     this._label.Font = this.GetFont();
     this._label.TabIndex = currentTabIndex++;
     toolTip.SetToolTip(this._label, this._textItem.Description);
 }
 public int Add(DesignerActionList value)
 {
     return(base.List.Add(value));
 }
 private LineInfo ProcessTaskItem(DesignerActionList list, DesignerActionItem item)
 {
     Line line = null;
     if (item is DesignerActionMethodItem)
     {
         line = new MethodLine(this._serviceProvider, this);
     }
     else if (item is DesignerActionPropertyItem)
     {
         DesignerActionPropertyItem item2 = (DesignerActionPropertyItem) item;
         PropertyDescriptor propDesc = TypeDescriptor.GetProperties(list)[item2.MemberName];
         if (propDesc == null)
         {
             throw new InvalidOperationException(System.Design.SR.GetString("DesignerActionPanel_CouldNotFindProperty", new object[] { item2.MemberName, list.GetType().FullName }));
         }
         TypeDescriptorContext context = new TypeDescriptorContext(this._serviceProvider, propDesc, list);
         UITypeEditor editor = (UITypeEditor) propDesc.GetEditor(typeof(UITypeEditor));
         bool standardValuesSupported = propDesc.Converter.GetStandardValuesSupported(context);
         if (editor == null)
         {
             if (propDesc.PropertyType == typeof(bool))
             {
                 if (IsReadOnlyProperty(propDesc))
                 {
                     line = new TextBoxPropertyLine(this._serviceProvider, this);
                 }
                 else
                 {
                     line = new CheckBoxPropertyLine(this._serviceProvider, this);
                 }
             }
             else if (standardValuesSupported)
             {
                 line = new EditorPropertyLine(this._serviceProvider, this);
             }
             else
             {
                 line = new TextBoxPropertyLine(this._serviceProvider, this);
             }
         }
         else
         {
             line = new EditorPropertyLine(this._serviceProvider, this);
         }
     }
     else
     {
         if (!(item is DesignerActionTextItem))
         {
             return null;
         }
         if (item is DesignerActionHeaderItem)
         {
             line = new HeaderLine(this._serviceProvider, this);
         }
         else
         {
             line = new TextLine(this._serviceProvider, this);
         }
     }
     return new LineInfo(list, item, line);
 }
 public LineInfo(DesignerActionList list, DesignerActionItem item, System.ComponentModel.Design.DesignerActionPanel.Line line)
 {
     this.Line = line;
     this.Item = item;
     this.List = list;
 }
示例#53
0
 public void Remove(DesignerActionList actionList)
 {
     throw new NotImplementedException();
 }
 public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName)
     : this(actionList, memberName, displayName, null, null, false)
 {
 }
 internal override void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, System.Windows.Forms.ToolTip toolTip, ref int currentTabIndex)
 {
     this._actionList = actionList;
     this._methodItem = (DesignerActionMethodItem) actionItem;
     toolTip.SetToolTip(this._linkLabel, this._methodItem.Description);
     this._linkLabel.Text = DesignerActionPanel.StripAmpersands(this._methodItem.DisplayName);
     this._linkLabel.AccessibleDescription = actionItem.Description;
     this._linkLabel.TabIndex = currentTabIndex++;
 }
 public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, string description)
     : this(actionList, memberName, displayName, category, description, false)
 {
 }
 internal override void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, System.Windows.Forms.ToolTip toolTip, ref int currentTabIndex)
 {
     this._actionList = actionList;
     this._panelHeaderItem = (DesignerActionPanel.DesignerActionPanelHeaderItem) actionItem;
     this._titleLabel.Text = this._panelHeaderItem.DisplayName;
     this._titleLabel.TabIndex = currentTabIndex++;
     this._subtitleLabel.Text = this._panelHeaderItem.Subtitle;
     this._subtitleLabel.TabIndex = currentTabIndex++;
     this._subtitleLabel.Visible = this._subtitleLabel.Text.Length != 0;
     this.OnParentControlFontChanged(null, EventArgs.Empty);
 }
 internal override sealed void UpdateActionItem(DesignerActionList actionList, DesignerActionItem actionItem, System.Windows.Forms.ToolTip toolTip, ref int currentTabIndex)
 {
     this._actionList = actionList;
     this._propertyItem = (DesignerActionPropertyItem) actionItem;
     this._propDesc = null;
     this._typeDescriptorContext = null;
     this._value = this.PropertyDescriptor.GetValue(actionList);
     this.OnPropertyTaskItemUpdated(toolTip, ref currentTabIndex);
     this._pushingValue = true;
     try
     {
         this.OnValueChanged();
     }
     finally
     {
         this._pushingValue = false;
     }
 }
示例#59
0
 private void CacheColumnEditingActionList(IComponent component)
 {
     if (designerActionService != null && columnEditing == null)
     {
         try
         {
             DesignerActionListCollection designerActionList = designerActionService.GetComponentActions(component, ComponentActionsType.Component);
             foreach (System.ComponentModel.Design.DesignerActionList dList in designerActionList)
             {
                 if (dList.GetType().Name.Equals("DataGridViewColumnEditingActionList"))
                 {
                     this.columnEditing = dList;
                     break;
                 }
             }
         }
         catch { }
     }
 }