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(); }
private void MessagesFrameButtonCallback(ButtonWidget button) { if (!initialized) { return; } switch (button.ID) { case 201: settings.CurrentAppearanceSettings.StartFullScreen = button.Checked; break; case 203: settings.ShowAllWarnings = button.Checked; break; case 205: var startupPath = Application.StartupPath; IFileAssociations fileAssociations = settings.FileAssociations; if (button.Checked) { fileAssociations.Set3DFileAssociation(".stl", "STL_M3D_Printer_GUI_file", Application.ExecutablePath, "M3D file (.stl)", startupPath + "/Resources/Data\\GUIImages\\M3D32x32Icon.ico"); fileAssociations.Set3DFileAssociation(".obj", "OBJ_M3D_Printer_GUI_file", Application.ExecutablePath, "M3D file (.obj)", startupPath + "/Resources/Data\\GUIImages\\M3D32x32Icon.ico"); break; } fileAssociations.Delete3DFileAssociation(".stl", "STL_M3D_Printer_GUI_file"); fileAssociations.Delete3DFileAssociation(".obj", "OBJ_M3D_Printer_GUI_file"); break; case 209: settings.CurrentAppearanceSettings.ShowPrinterMismatchWarning = button.Checked; break; } }