Ejemplo n.º 1
0
        private void LoadPrinterView(ModelLoadingManager.PrinterViewLoadData data)
        {
            if (data.printSettings.HasValue)
            {
                printerview.LoadM3DPrintSettings(data.printSettings);
            }

            foreach (PrintDetails.ObjectDetails other in data.printerview_settings.objectList)
            {
                var objectDetails = new PrintDetails.ObjectDetails(other)
                {
                    zipFileName            = data.zipfile,
                    printerSettingsXMLFile = null
                };
                var str = other.filename;
                if (!string.IsNullOrEmpty(data.directory))
                {
                    str = Path.Combine(data.directory, str);
                }

                LoadModelIntoPrinter(str, new ModelLoadingManager.OnModelLoadedDel(OnModelLoadedCallback), new ModelLoadingManager.LoadFailedCallback(OnPrinterViewModelLoadFailed), objectDetails);
            }
        }
Ejemplo n.º 2
0
        private void LoadPrinterView(PrintDetails.PrintJobObjectViewDetails printerview_settings, string printerSettingsXMLFile, string directory, string zipfile)
        {
            var printSettings = new PrintDetails.M3DSettings?();

            if (!string.IsNullOrEmpty(printerSettingsXMLFile))
            {
                printSettings = SettingsManager.LoadPrintJobInfoFile(printerSettingsXMLFile);
            }

            var data = new ModelLoadingManager.PrinterViewLoadData(printerview_settings, printSettings, directory, zipfile);

            if (printSettings.HasValue && settings.CurrentAppearanceSettings.ShowPrinterMismatchWarning && !PrinterObject.IsProfileMemberOfFamily(printSettings.Value.profileName, printerview.CurrentFamilyName))
            {
                var profileMismatchDialog = Resources.profileMismatchDialog;
                var profileName           = printSettings.Value.profileName;
                var currentFamilyName     = printerview.CurrentFamilyName;
                var newValue = string.Format(string.Format(Locale.GlobalLocale.T("T_ProfileMismatchDialog_Message"), profileName, currentFamilyName), profileName, currentFamilyName);
                messagebox.AddXMLMessageToQueue(new PopupMessageBox.MessageDataXML(new SpoolerMessage(), profileMismatchDialog.Replace("{MESSAGE}", newValue), new PopupMessageBox.XMLButtonCallback(TypeMismatchButtonCallback), data));
            }
            else
            {
                LoadPrinterView(data);
            }
        }