Пример #1
0
        public void DesignerCommandSet_Ctor_Default()
        {
            var set = new DesignerCommandSet();

            Assert.Null(set.ActionLists);
            Assert.Null(set.Verbs);
        }
        protected override void GetComponentDesignerActions(IComponent component, DesignerActionListCollection actionLists)
        {
            if (component == null)
            {
                throw new ArgumentNullException("component");
            }
            if (actionLists == null)
            {
                throw new ArgumentNullException("actionLists");
            }
            IServiceContainer site = component.Site as IServiceContainer;

            if (site != null)
            {
                DesignerCommandSet service = (DesignerCommandSet)site.GetService(typeof(DesignerCommandSet));
                if (service != null)
                {
                    DesignerActionListCollection lists = service.ActionLists;
                    if (lists != null)
                    {
                        actionLists.AddRange(lists);
                    }
                }
                if ((actionLists.Count == 0) || ((actionLists.Count == 1) && (actionLists[0] is ControlDesigner.ControlDesignerActionList)))
                {
                    DesignerVerbCollection verbs = service.Verbs;
                    if ((verbs != null) && (verbs.Count != 0))
                    {
                        DesignerVerb[] array = new DesignerVerb[verbs.Count];
                        verbs.CopyTo(array, 0);
                        actionLists.Add(new DesignerActionVerbList(array));
                    }
                }
            }
        }
Пример #3
0
        public void DesignerCommandSet_GetCommands_Invoke_ReturnsNull(string name)
        {
            var set = new DesignerCommandSet();

            Assert.Null(set.GetCommands(name));
        }