Пример #1
0
        public CTCFile Create()
        {
            #region Standard group Init
            // Make sure to initialize the default groups
            this.packageGroup = this.PackageGroup;
            #endregion

            #region New Menu creation
            // Create the new menus first before creating any command
            BuildMenuGroups();
            #endregion

            #region Command creation
            // Templates commands must be created first than recipe commands
            // becuase a template can steal the command bars from the recipe it is related to
            BuildTemplateCommands();
            // Build recipes commands
            BuiltRecipeCommands();
            #endregion

            #region Build CTC Tree
            NewGroup[] newGroupsArray = new NewGroup[newGroups.Values.Count];
            newGroups.Values.CopyTo(newGroupsArray, 0);
            MenuGroup[] menuGroupsArray = new MenuGroup[menus.Values.Count];
            menus.Values.CopyTo(menuGroupsArray, 0);
            CMDPlacement[] placementsArray = new CMDPlacement[placements.Count];
            placements.Values.CopyTo(placementsArray, 0);
            Button[] buttonsArray = new Button[buttons.Count];
            buttons.CopyTo(buttonsArray);
            Visibility[] visibiltiesArray = new Visibility[visibilities.Count];
            visibilities.CopyTo(visibiltiesArray);
            CTCFile ctcFile = new CTCFile(
                new CMDSSection(guidRecipeFrameworkPkg,
                                new MenusSubSection(menuGroupsArray),
                                new NewGroupsSubSection(newGroupsArray),
                                new ButtonsSubSection(buttonsArray),
                                new BitmapsSubSection(new CTCBitmap[] { ctcBitmap })),
                new CMDUsedSection(),
                new CMDPlacementSection(placementsArray),
                new VisibilitySection(visibiltiesArray),
                new KeybindingsSection());
            return(ctcFile);

            #endregion
        }
Пример #2
0
 public CTCGenerator(CTCFile ctcFile, TextWriter textWriter)
 {
     this.ctcFile    = ctcFile;
     this.textWriter = textWriter;
 }