private void loadPrimaryRingySettings() { if (!File.Exists(path: settingsPath + "PrimaryRingySettings.dds")) { createNewPrimaryRingySettings(); } // Loading settings from PrimaryRingySettings.dds file try { FileStream primaryRingySettingsInput = new FileStream(settingsPath + "PrimaryRingySettings.dds", FileMode.Open, FileAccess.Read); BinaryFormatter primaryRingySettingsReader = new BinaryFormatter(); currentPrimaryRingySettings = new PrimaryRingySettings(); currentPrimaryRingySettings = (PrimaryRingySettings)primaryRingySettingsReader.Deserialize(primaryRingySettingsInput); primaryRingySettingsInput.Close(); } catch (Exception loadPrimaryRingySettingsException) { MessageBox.Show( messageBoxText: "Can't open/find PrimaryRingySettings.dds file in Settings directory. PrimaryRingySettings.dds file might be corrupted or deleted.", caption: "ERROR", button: MessageBoxButton.OK, icon: MessageBoxImage.Error); } }
private void ringyOptionsWindow_defaultButton_Click(object sender, EventArgs eventArgs) { currentPrimaryRingySettings = new PrimaryRingySettings(); savePrimaryRingySettings(); refreshRingy(); ringyOptionsWindow.Close(); ringyOptionsWindow = new RingyOptionsWindow(ref currentRingyIconSettings, currentPrimaryRingySettings.logoImageLocation); setValueForRingyOptionsWindow(); setEventHandlerForRingyOptionsWindow(); }
private void createNewPrimaryRingySettings() { try { currentPrimaryRingySettings = new PrimaryRingySettings(); savePrimaryRingySettings(); } catch (Exception createNewPrimaryRingySettingsException) { MessageBox.Show( messageBoxText: "Can't create PrimaryRingySettings.dds file in Settings directory. Make sure that the filesystem isn't write protected.", caption: "ERROR", button: MessageBoxButton.OK, icon: MessageBoxImage.Error); } }
public AnimatedIcon(string imageLocation, string iconTitle, string target, int iconNo, PrimaryRingySettings primaryRingySettings) : base(imageLocation, (int)Math.Sqrt(STANDARD_ICON_DIMENSION) * 12, (int)Math.Sqrt(STANDARD_ICON_DIMENSION) * 12) { this.iconTitle = iconTitle; this.target = target; this.hoaverEffect = primaryRingySettings.hoaverEffect; this.clickEffect = "None"; this.showIconLabel = primaryRingySettings.showIconLabel; int row = 0, column = 0; switch (iconNo) { case 1: row = 0; column = 1; break; case 2: row = 0; column = 2; break; case 3: row = 1; column = 2; break; case 4: row = 2; column = 2; break; case 5: row = 2; column = 1; break; case 6: row = 2; column = 0; break; case 7: row = 1; column = 0; break; case 8: row = 0; column = 0; break; } Grid.SetColumn(element: this, value: column); Grid.SetRow(element: this, value: row); setToolTip(); setEventHandler(); }