Пример #1
0
        private void XMLButtonCallback(ButtonWidget button, SpoolerMessage message, PopupMessageBox parentFrame, XMLFrame childFrame, object data)
        {
            var childElement = (ButtonWidget)childFrame.FindChildElement(301);

            if (button.ID == 301)
            {
                return;
            }

            settings.Settings.miscSettings.FileAssociations.ShowFileAssociationsDialog = !childElement.Checked;
            switch (button.ID)
            {
            case 101:
                FileAssociations.Set3DFileAssociation(".stl", "STL_M3D_Printer_GUI_file", ExecutablePath, "M3D file (.stl)", IconPath);
                FileAssociations.Set3DFileAssociation(".obj", "OBJ_M3D_Printer_GUI_file", ExecutablePath, "M3D file (.obj)", IconPath);
                break;

            case 102:
                FileAssociations.Delete3DFileAssociation(".stl", "STL_M3D_Printer_GUI_file");
                FileAssociations.Delete3DFileAssociation(".obj", "OBJ_M3D_Printer_GUI_file");
                break;
            }
            parentFrame.AllowMessages = allow_messages;
            parentFrame.CloseCurrent();
        }
Пример #2
0
        public AssociationsForm(SettingsManager settings, PopupMessageBox messagebox, IFileAssociations FileAssociations, string ExecutablePath, string IconPath)
        {
            allow_messages           = messagebox.AllowMessages;
            this.settings            = settings;
            this.FileAssociations    = FileAssociations;
            this.ExecutablePath      = ExecutablePath;
            this.IconPath            = IconPath;
            messagebox.AllowMessages = true;
            var associationsDialog = Resources.fileAssociationsDialog;

            messagebox.AddXMLMessageToQueue(new PopupMessageBox.MessageDataXML(new SpoolerMessage(), associationsDialog, new PopupMessageBox.XMLButtonCallback(XMLButtonCallback), null));
        }
Пример #3
0
        private static void XMLOnShow(PopupMessageBox parentFrame, XMLFrame childFrame, GUIHost host, object data)
        {
            var featuresDialogData = data as FeaturesDialog.ProFeaturesDialogData;

            ((TextWidget)childFrame.FindChildElement("FeaturePanel::Title")).Text = string.Format("{0} Features", featuresDialogData.printer.MyPrinterProfile.ProfileName);
            ((TextWidget)childFrame.FindChildElement("FeaturePanel::Desc")).Text  = string.Format("Here are the {0} features currently available for your printer.", featuresDialogData.printer.MyPrinterProfile.ProfileName);
            FeaturesDialog.featurePanel = new FeaturePanel(1004, host, featuresDialogData.spoolerConnection, featuresDialogData.printer)
            {
                Visible = true,
                Enabled = true
            };
            childFrame.FindChildElement(1003).AddChildElement(FeaturesDialog.featurePanel);
        }
Пример #4
0
 private static void XMLButtonCallback(ButtonWidget button, SpoolerMessage message, PopupMessageBox parentFrame, XMLFrame childFrame, object data)
 {
     parentFrame.CloseCurrent();
 }
Пример #5
0
 public static void Show(PopupMessageBox messagebox, SpoolerConnection spoolerConnection, PrinterObject printer)
 {
     messagebox.AddXMLMessageToQueue(new PopupMessageBox.MessageDataXML(Resources.FeaturesDialogFrame, new PopupMessageBox.XMLButtonCallback(FeaturesDialog.XMLButtonCallback), new ElementStandardDelegate(FeaturesDialog.XMLOnUpdateCallback), new PopupMessageBox.XMLOnShow(FeaturesDialog.XMLOnShow), new FeaturesDialog.ProFeaturesDialogData(spoolerConnection, printer)));
 }