Inheritance: baseAction
Beispiel #1
0
        internal IEnumerable <IGroupAction> DeserializeGroupActionGroup(actionSubmenu actiongroup)
        {
            var ret = new List <IGroupAction>();

            foreach (var item in actiongroup.Items)
            {
                if (item is action)
                {
                    var i   = item as action;
                    var add = new GroupAction
                    {
                        Name          = i.menu,
                        Shortcut      = i.shortcut,
                        Execute       = i.execute,
                        BatchExecute  = i.batchExecute,
                        DefaultAction = bool.Parse([email protected]())
                    };
                    ret.Add(add);
                }
                if (item is actionSubmenu)
                {
                    var i        = item as actionSubmenu;
                    var addgroup = new GroupActionGroup {
                        Children = new List <IGroupAction>(), Name = i.menu
                    };
                    addgroup.Children = this.DeserializeGroupActionGroup(i);
                    ret.Add(addgroup);
                }
            }
            return(ret);
        }
Beispiel #2
0
 internal IEnumerable<IGroupAction> DeserializeGroupActionGroup(actionSubmenu actiongroup, bool isGroup)
 {
     var ret = new List<IGroupAction>();
     foreach (var item in actiongroup.Items)
     {
         if (item is action)
         {
             var i = item as action;
             var add = new GroupAction
             {
                 Name = i.menu,
                 Shortcut = i.shortcut,
                 Execute = i.execute,
                 BatchExecute = i.batchExecute,
                 ShowIf = i.showIf,
                 DefaultAction = bool.Parse([email protected]())
             };
             add.IsGroup = isGroup;
             ret.Add(add);
         }
         if (item is actionSubmenu)
         {
             var i = item as actionSubmenu;
             var addgroup = new GroupActionGroup { Children = new List<IGroupAction>(), Name = i.menu };
             addgroup.IsGroup = isGroup;
             addgroup.Children = this.DeserializeGroupActionGroup(i, isGroup);
             ret.Add(addgroup);
         }
     }
     return ret;
 }