Exemplo n.º 1
0
        public static N0183DefnCollection LoadInternal()
        {
            Assembly asm    = Assembly.GetExecutingAssembly();
            Stream   stream = asm.GetManifestResourceStream("OpenSkipperApplication.Resources.N0183Defns.N0183Dfn.xml");

            N0183DefnCollection newDefns = XmlFileSerializer.Deserialize(stream);

            newDefns.FileType = FileTypeEnum.Internal; // No filename set, instead we set type to internal
            return(newDefns);
        }
Exemplo n.º 2
0
 public static bool LoadN0183Defns(string fileName)
 {
     if ((N0183DefnCol != null) && !N0183DefnCol.IsChanged(fileName))
     {
         return(false);
     }
     N0183DefnCol = N0183DefnCollection.LoadFromFile(fileName);
     Settings.Default.N0183Path = fileName;
     Settings.Default.Save();
     return(true);
 }
Exemplo n.º 3
0
        // File IO
        public static N0183DefnCollection LoadFromFile(string fileName)
        {
            fileName = CommonRoutines.ResolveFileNameIfEmpty(fileName, DefDefnFile);
            if (fileName == "")
            {
                return(LoadInternal());
            }

            N0183DefnCollection n0183DefnCol = XmlFileSerializer.Deserialize(fileName);

            if (n0183DefnCol != null)
            {
                n0183DefnCol.FileName = fileName;
                n0183DefnCol.FileType = FileTypeEnum.NativeXMLFile;
                return(n0183DefnCol);
            }

            return(LoadInternal());
        }