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; } }
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)); }
private void CreateMessagesFrame(GUIHost host) { var interfaceframeMessages = Resources.interfaceframe_messages; messagesFrame = new XMLFrame(); messagesFrame.Init(host, interfaceframeMessages, new ButtonCallback(MessagesFrameButtonCallback)); messagesFrame.ID = 1002; messagesFrame.CenterHorizontallyInParent = true; messagesFrame.RelativeY = 0.1f; messagesFrame.RelativeWidth = 0.95f; messagesFrame.RelativeHeight = 0.9f; messagesFrame.BGColor = new Color4(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); messagesFrame.Visible = false; messagesFrame.Enabled = false; childFrame.AddChildElement(messagesFrame); messagesFrame.Refresh(); startFullScreenButton = (ButtonWidget)messagesFrame.FindChildElement(201); showAllWarningsButton = (ButtonWidget)messagesFrame.FindChildElement(203); printerMismatchButton = (ButtonWidget)messagesFrame.FindChildElement(209); var childElement1 = (ButtonWidget)messagesFrame.FindChildElement(205); var childElement2 = (TextWidget)messagesFrame.FindChildElement(204); IFileAssociations fileAssociations = settings.FileAssociations; if (fileAssociations == null) { return; } var str1 = fileAssociations.ExtensionOpenWith(".stl"); var str2 = fileAssociations.ExtensionOpenWith(".obj"); if (str1 != null && str2 != null && (str1.Contains(Application.ExecutablePath) && str2.Contains(Application.ExecutablePath))) { childElement1.Checked = true; } childElement1.ImageHasFocusColor = new Color4(100, 230, byte.MaxValue, byte.MaxValue); }
public SettingsManager(IFileAssociations fileAssociations) { this.fileAssociations = fileAssociations; LoadSettings(); }
public SnippetOrganizer(ISnippyOptions options, IFileAssociations fileAssociations) { _options = options; _fileAssociations = fileAssociations; Load(); }
private void InitializePlatformSpecificObjects() { myFileAssociations = null; myStopShutdown = new WinStopShutdown(Handle); myFileAssociations = new WinFileAssociations(); }