コード例 #1
0
ファイル: SettingsManager.cs プロジェクト: ye-man/M3D
 public static bool LoadPrinterViewFile(string filename, out PrintDetails.PrintJobObjectViewDetails printerview_settings)
 {
     try
     {
         var           textReader      = (TextReader) new StreamReader(filename);
         XmlSerializer classSerializer = PrintDetails.PrintJobObjectViewDetails.ClassSerializer;
         printerview_settings = (PrintDetails.PrintJobObjectViewDetails)classSerializer.Deserialize(textReader);
         textReader.Close();
         return(true);
     }
     catch (Exception ex)
     {
         printerview_settings = null;
         return(false);
     }
 }
コード例 #2
0
ファイル: SettingsManager.cs プロジェクト: ye-man/M3D
        public static bool SavePrintingObjectsDetails(string printerViewFile, List <PrintDetails.ObjectDetails> objectList)
        {
            var objectViewDetails = new PrintDetails.PrintJobObjectViewDetails(objectList);

            try
            {
                var textWriter = (TextWriter) new StreamWriter(printerViewFile);
                var namespaces = new XmlSerializerNamespaces();
                namespaces.Add(string.Empty, string.Empty);
                PrintDetails.PrintJobObjectViewDetails.ClassSerializer.Serialize(textWriter, objectViewDetails, namespaces);
                textWriter.Close();
            }
            catch (Exception ex)
            {
                return(false);
            }
            return(true);
        }
コード例 #3
0
ファイル: SettingsManager.cs プロジェクト: ye-man/M3D
 public static bool LoadPrinterView(string jobGuid, out PrintDetails.PrintJobObjectViewDetails printerview_settings)
 {
     return(SettingsManager.LoadPrinterViewFile(Path.Combine(M3D.Spooling.Core.Paths.QueuePath, jobGuid) + "_printerview.xml", out printerview_settings));
 }