示例#1
0
        /// <summary>
        /// The load routine for the static data file collection
        /// </summary>
        /// <param name="PopulateNodeTrees"></param>
        /// <returns></returns>
        public new bool Load(int PopulateNodeTreeDepth = 0)
        {
            // Loads the static data and builds the trees representing the data files
            if (!DataDirectoryInfo.Exists)
            {
                return(false);
            }
            else
            {
                foreach (FileInfo dataFile in DataDirectoryInfo.GetFiles(targetFileExtension)) // .Reverse())
                {
                    Debug.Print("File evaluated {0}", dataFile.Name);

                    // Create a new HEStationonBlueprintFile and populate the path.
                    StationBlueprint_File tempBlueprintFile = new StationBlueprint_File(this, dataFile);
                    // Add the file to the Data Dictionary
                    DataDictionary.Add(dataFile.Name, tempBlueprintFile);

                    if (tempBlueprintFile.IsLoaded && !LoadError)
                    {
                        // if (PopulateNodeTreeDepth > 0) tempBlueprintFile.DataViewRootNode.CreateChildNodesFromjData(PopulateNodeTreeDepth);

                        if (tempBlueprintFile.RootNode == null)
                        {
                            throw new NullReferenceException();
                        }
                        else
                        {
                            RootNode.Nodes.Insert(0, tempBlueprintFile.RootNode);
                        }
                    }
                }
                return(true);
            }
        }
示例#2
0
 /// <summary>
 /// Constructor that takes a HEStationonBlueprintFile Owner Object and reference to the
 /// structure definitions object.
 /// </summary>
 /// <param name="ownerObject"></param>
 /// <param name="structureDefs"></param>
 public StationBlueprint(StationBlueprint_File ownerObject, StationBlueprint structureDefs) : this()
 {
     OwnerObject          = ownerObject ?? throw new NullReferenceException("passedParent was null.");
     StructureDefinitions = structureDefs; // ?? throw new NullReferenceException("structureDefs was null.");
     // __ObjectType = BlueprintObjectType.StationBlueprint;
     Version = StationBlueprintFormatVersion;
 }