예제 #1
0
            /// <summary>
            /// Attempts to save current configuration to a file.
            /// </summary>
            private KnownException TrySave(ConfigT cfg)
            {
                string         xmlOut;
                KnownException exception = Utils.Xml.TrySerialize(cfg, out xmlOut);

                if (exception == null && xmlOut != null)
                {
                    exception = cfgFile.TryWrite(xmlOut);
                }

                return(exception);
            }
예제 #2
0
        /// <summary>
        /// Creates a local duplicate of a file with a given name.
        /// </summary>
        public KnownException TryDuplicate(string newName)
        {
            string         data;
            KnownException exception = TryRead(out data);
            LocalFileIO    newFile;

            if (exception == null && data != null)
            {
                newFile   = new LocalFileIO(newName);
                exception = newFile.TryWrite(data);
            }

            return(exception);
        }