Exemplo n.º 1
0
        private void OpenProject(string fileName)
        {
            SetupNewProject();
            using (var fs = new FileStream(fileName, FileMode.Open))
            {
                var de = new DeserializerEngine();
                object res = de.Deserialize(fs);
                root = (RootElement) res;
            }

            //var fs = new FileStream(fileName, FileMode.Open);
            //var sf = new BinaryFormatter
            //         {
            //             AssemblyFormat = FormatterAssemblyStyle.Simple,
            //             FilterLevel = TypeFilterLevel.Full,
            //             TypeFormat = FormatterTypeStyle.TypesAlways
            //         };

            //root = (RootElement) sf.Deserialize(fs);
            //fs.Close();
            FillTreeView();
            NotifyChange();
        }
Exemplo n.º 2
0
 private void SetupNewProject()
 {
     root = new RootElement();
     FillTreeView();
     elementEditors = new Dictionary<Element, Dictionary<string, Control>>();
 }
Exemplo n.º 3
0
        private void OpenProject(string fileName)
        {
            SetupNewProject();
            var fs = new FileStream(fileName, FileMode.Open);
            var sf = new BinaryFormatter
                     {
                         AssemblyFormat = FormatterAssemblyStyle.Simple,
                         FilterLevel = TypeFilterLevel.Full,
                         TypeFormat = FormatterTypeStyle.TypesAlways
                     };

            root = (RootElement) sf.Deserialize(fs);
            fs.Close();
            FillTreeView();
            NotifyChange();
        }