Esempio n. 1
0
        public bool ShouldAutoShow(IComponent component)
        {
            if (_serviceProvider != null)
            {
                if (_serviceProvider.GetService(typeof(DesignerOptionService)) is DesignerOptionService opts)
                {
                    PropertyDescriptor p = opts.Options.Properties["ObjectBoundSmartTagAutoShow"];
                    if (p != null && p.PropertyType == typeof(bool) && !(bool)p.GetValue(null))
                    {
                        return(false);
                    }
                }
            }

            if (_designerActionService != null)
            {
                DesignerActionListCollection coll = _designerActionService.GetComponentActions(component);
                if (coll != null && coll.Count > 0)
                {
                    for (int i = 0; i < coll.Count; i++)
                    {
                        if (coll[i].AutoShow)
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
Esempio n. 2
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 { }
     }
 }