예제 #1
0
        void LoadSheet(string filename)
        {
            string      path  = Path.GetDirectoryName(filename);
            SheetLegacy sheet = new SheetLegacy();

            Console.WriteLine("Loading {0}", filename);
            sheet.LoadFromFile(filename, null);
            Sheets.Add(sheet);

            AllComponents.AddRange(sheet.Components);   //*** AR

            // get subsheets
            if (sheet.SubSheets != null)
            {
                foreach (SheetSpecLegacy spec in sheet.SubSheets)
                {
                    filename = Path.Combine(path, spec.Filename.Value);

                    if (Sheets.Find(x => x.Filename == spec.Filename.Value) == null)
                    {
                        LoadSheet(filename);
                    }
                }
            }
        }
예제 #2
0
        public bool LoadFromFile(string filename)
        {
            Sheets        = new List <SheetLegacy>();
            AllComponents = new List <ComponentBase>();

            LoadSheet(filename);

            if (Sheets.Count > 0)
            {
                MainSheet = Sheets[0];
            }

            //
            filename = Path.ChangeExtension(filename, ".cmp");
            if (File.Exists(filename))
            {
                LoadCmpFile(filename);
            }

            return(true);
        }