public TagArchiveNodeSource(string name, GameDefinition game, IDocumentManager documentManager,
                             DefaultState defaultState)
     : this(name, game, documentManager, DisplayItems.AllExtractedItems,
            defaultState)
 {
     ;
 }
        public TagArchiveNodeSource(string name, GameDefinition game, IDocumentManager documentManager,
                                    DisplayItems items, DefaultState defaultState)
            : base(name)
        {
            this.game          = game;
            Library.FileAdded += new EventHandler <LibraryFileActionArgs>(Library_FileAdded);
            this.items         = items;

            // Add NodeTypes
            if ((items & DisplayItems.AllExtractedItems) > 0)
            {
                AddNodeType(CreateNodeType <RootNodeType>(defaultState));

                FolderNodeType folder = CreateNodeType <FolderNodeType>(Resources.folder16, Resources.folder_closed16);
                AddNodeType(folder);

                FileNodeType file = CreateNodeType <FileNodeType>(Resources.document16);
                file.AddNodeState(new DocumentOpenState(documentManager, game.GameID, TagLocation.Archive, Resources.document_view16, Resources.document_view16, Color.Blue, Color.White));
                AddNodeType(file);

                ObjectFileNodeType objectFile = CreateNodeType <ObjectFileNodeType>(Resources.data16);
                objectFile.AddNodeState(new DocumentOpenState(documentManager, game.GameID, TagLocation.Archive, Resources.data_view16, Resources.data_view16, Color.Blue, Color.White));
                AddNodeType(objectFile);

                ModelFileNodeType modelFile = CreateNodeType <ModelFileNodeType>(Resources.cube_molecule16);
                modelFile.AddNodeState(new DocumentOpenState(documentManager, game.GameID, TagLocation.Archive, Resources.cube_molecule_view16, Resources.cube_molecule_view16, Color.Blue, Color.White));
                AddNodeType(modelFile);

                SbspFileNodeType sbspFile = CreateNodeType <SbspFileNodeType>(Resources.environment16);
                sbspFile.AddNodeState(new DocumentOpenState(documentManager, game.GameID, TagLocation.Archive, Resources.environment_view16, Resources.environment_view16, Color.Blue, Color.White));
                AddNodeType(sbspFile);

                ScenarioFileNodeType scenarioFile = CreateNodeType <ScenarioFileNodeType>(Resources.earth16);
                scenarioFile.AddNodeState(new DocumentOpenState(documentManager, game.GameID, TagLocation.Archive, Resources.earth_view16, Resources.earth_view16, Color.Blue, Color.White));
                AddNodeType(scenarioFile);

                AttachedScriptNodeType attachedScript = CreateNodeType <AttachedScriptNodeType>(Resources.text_code_colored16);
                attachedScript.AddNodeState(new DocumentOpenState(documentManager, game.GameID, TagLocation.Archive, Resources.text_view16, Resources.text_view16, Color.Blue, Color.White));
                AddNodeType(attachedScript);
            }

            if ((items & DisplayItems.AllUnextractedItems) > 0)
            {
                AddNodeType(CreateNodeType <UnextractedRootNodeType>(defaultState));

                UnextractedFolderNodeType unextractedfolder = CreateNodeType <UnextractedFolderNodeType>(
                    new DefaultState(Resources.folder16, Resources.folder_closed16, Color.Gray, Color.White));
                AddNodeType(unextractedfolder);

                UnextractedFileNodeType unextractedfile = CreateNodeType <UnextractedFileNodeType>(
                    new DefaultState(Resources.document_text16, Resources.document_text16, Color.Gray, Color.White));
                AddNodeType(unextractedfile);
            }
        }
        public TagArchiveObjectViewNodeSource(string name, GameDefinition game, IDocumentManager documentManager,
                                              DisplayItems items, DefaultState defaultState, bool loadDependencies)
            : base(name)
        {
            this.game             = game;
            this.items            = items;
            this.loadDependencies = loadDependencies;
            Library.FileAdded    += new EventHandler <LibraryFileActionArgs>(Library_FileAdded);

            if ((items & DisplayItems.AllExtractedItems) > 0)
            {
                AddNodeType(CreateNodeType <ObjectViewRootNodeType>(defaultState));

                HLTGroupNodeType groups = CreateNodeType <HLTGroupNodeType>(
                    new DefaultState(Resources.book_open16, Resources.book_blue16, Color.Black, Color.White));
                AddNodeType(groups);

                HLTNodeType htlType = CreateNodeType <HLTNodeType>(Resources.data16);
                htlType.AddNodeState(
                    new DocumentOpenState(documentManager, game.GameID, TagLocation.Archive, Resources.data_view16, Resources.data_view16, Color.Blue, Color.White));
                AddNodeType(htlType);

                TagNodeType tagType = CreateNodeType <TagNodeType>(Resources.document_up16);
                tagType.AddNodeState(
                    new DocumentOpenState(documentManager, game.GameID, TagLocation.Archive, Resources.document_view16, Resources.document_view16, Color.Blue,
                                          Color.White));
                AddNodeType(tagType);
            }
            if ((items & DisplayItems.AllUnextractedItems) > 0)
            {
                AddNodeType(CreateNodeType <UnextractedObjectViewRootNodeType>(defaultState));

                UnextractedHLTGroupNodeType unextractedHLTGroup = CreateNodeType <UnextractedHLTGroupNodeType>(
                    new DefaultState(Resources.book_open16, Resources.book_blue16, Color.Gray, Color.White));
                AddNodeType(unextractedHLTGroup);

                UnextractedHLTNodeType unextractedHLT = CreateNodeType <UnextractedHLTNodeType>(
                    new DefaultState(Resources.data16, Resources.data16, Color.Gray, Color.White));
                AddNodeType(unextractedHLT);
            }
        }
 public TagArchiveObjectViewNodeSource(string name, GameDefinition game,
                                       IDocumentManager documentManager, DisplayItems items, DefaultState defaultState)
     : this(name, game, documentManager, items, defaultState, true)
 {
     ;
 }
示例#5
0
        /// <summary>
        /// Creates a NodeType object, automatically adding a default NodeState with the
        /// specified icon and the default text colors.
        /// </summary>
        protected T CreateNodeType <T>(Bitmap expandedIcon, Bitmap collapsedIcon) where T : NodeType
        {
            DefaultState state = new DefaultState(expandedIcon, collapsedIcon, Color.Black, Color.White);

            return(CreateNodeType <T>(state));
        }