Exemplo n.º 1
0
        public static PrintDetails.M3DSettings?LoadPrintJobInfo(string jobGuid)
        {
            PrintDetails.M3DSettings?nullable = SettingsManager.LoadPrintJobInfoFile(Path.Combine(M3D.Spooling.Core.Paths.QueuePath, jobGuid) + "_printersettings.xml");
            if (!nullable.HasValue)
            {
                return(nullable);
            }

            PrintDetails.M3DSettings m3Dsettings = nullable.Value;
            m3Dsettings.jobGuid = jobGuid;
            return(new PrintDetails.M3DSettings?(m3Dsettings));
        }
Exemplo n.º 2
0
        public static bool SavePrintJobInfo(string printerSettingsFile, JobParams jobParams, PrinterObject printer, string slicerProfileName, List <Slicer.General.KeyValuePair <string, string> > userKeyValuePairList)
        {
            var m3Dsettings = new PrintDetails.M3DSettings(jobParams, printer, slicerProfileName, userKeyValuePairList);

            try
            {
                var textWriter = (TextWriter) new StreamWriter(printerSettingsFile);
                var namespaces = new XmlSerializerNamespaces();
                namespaces.Add(string.Empty, string.Empty);
                PrintDetails.M3DSettings.ClassSerializer.Serialize(textWriter, m3Dsettings, namespaces);
                textWriter.Close();
            }
            catch (Exception ex)
            {
                return(false);
            }
            return(true);
        }