Example #1
0
        /// <summary>
        /// Load a file from disk
        /// </summary>
        /// <param name="fileName">full path of fileName</param>
        /// <returns>object</returns>
        public static PrinterObject Load(string fileName)
        {
            PersistentDataObject po = null;
            FileInfo             fi = new FileInfo(fileName);

            if (fi.Exists)
            {
                if (PersistentDataObject.Load(fi, out po))
                {
                    return(po as PrinterObject);
                }
            }

            return(null);
        }
Example #2
0
        /// <summary>
        /// Load a file from disk
        /// </summary>
        /// <param name="fileName">full path of fileName</param>
        /// <returns>object</returns>
        public static Configuration Load(string fileName)
        {
            PersistentDataObject conf = null;
            FileInfo             fi   = new FileInfo(fileName);

            if (fi.Exists)
            {
                if (PersistentDataObject.Load(fi, out conf))
                {
                    return(conf as Configuration);
                }
            }

            return(null);
        }