Example #1
0
 private void ApplyDateTimeSettings(GraphDateTimeSettings settings)
 {
     showDate_ToolStripMenuItem.Checked      = settings.ShowDate;
     use24HourTime_ToolStripMenuItem.Checked = settings.Use24Hour;
     showAMPM_ToolStripMenuItem.Checked      = settings.ShowAMPM;
     showAMPM_ToolStripMenuItem.Enabled      = !settings.Use24Hour;
     AxisX.LabelStyle.Format = settings.DateTimeFormat;
 }
Example #2
0
        private void LoadDateTimeSettings()
        {
            // Load the serialized settings list
            string serializedSettingsList = Properties.Settings.Default.DateFormats;
            var    settingsList           = LegacySerializer.DeserializeXml <Collection <GraphDateTimeSettings> >(serializedSettingsList);

            // Find the settings that apply to this graph
            GraphDateTimeSettings settings = settingsList.FirstOrDefault(n => n.GraphType == this.GetType().Name.ToString());

            if (settings == null)
            {
                settings = new GraphDateTimeSettings(this);
            }

            ApplyDateTimeSettings(settings);
        }
Example #3
0
        private void timeOptions_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Load the serialized settings list
            string serializedSettingsList = Properties.Settings.Default.DateFormats;
            var    settingsList           = LegacySerializer.DeserializeXml <Collection <GraphDateTimeSettings> >(serializedSettingsList);

            // Find the settings that apply to this graph
            GraphDateTimeSettings settings = settingsList.FirstOrDefault(n => n.GraphType == this.GetType().Name.ToString());

            if (settings == null)
            {
                settings = new GraphDateTimeSettings(this);
                settingsList.Add(settings);
            }

            settings.ShowDate  = showDate_ToolStripMenuItem.Checked;
            settings.Use24Hour = use24HourTime_ToolStripMenuItem.Checked;
            settings.ShowAMPM  = showAMPM_ToolStripMenuItem.Checked;

            ApplyDateTimeSettings(settings);
            Properties.Settings.Default.DateFormats = LegacySerializer.SerializeXml(settingsList).ToString();
            Properties.Settings.Default.Save();
        }