Ejemplo n.º 1
0
        void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            Storyboard sb = new Storyboard();

            sb            = Application.Current.Resources["ButtonPressAnimation"] as Storyboard;
            sb.Completed += new EventHandler(delegate(object obj, EventArgs es) { sb.Stop(); });
            Storyboard.SetTarget(sb, ButtonSaveTransform);
            sb.Begin();

            if (!string.IsNullOrEmpty(TextBoxDefaultWidth.Text))
            {
                IsolatedStorageManager.SaveIntoIsolatedStorage("DefaultWidth", Convert.ToInt32(TextBoxDefaultWidth.Text));
            }

            if (!string.IsNullOrEmpty(TextBoxDefaultHeight.Text))
            {
                IsolatedStorageManager.SaveIntoIsolatedStorage("DefaultHeight", Convert.ToInt32(TextBoxDefaultHeight.Text));
            }

            if (!string.IsNullOrEmpty(TextBoxMinimumWidth.Text))
            {
                IsolatedStorageManager.SaveIntoIsolatedStorage("MinimumWidth", Convert.ToInt32(TextBoxMinimumWidth.Text));
            }

            if (!string.IsNullOrEmpty(TextBoxMinimumHeight.Text))
            {
                IsolatedStorageManager.SaveIntoIsolatedStorage("MinimumHeight", Convert.ToInt32(TextBoxMinimumHeight.Text));
            }

            IsolatedStorageManager.SaveIntoIsolatedStorage("ResizeWithBrowser", CheckboxResizeWithBrowser.IsChecked);

            IsolatedStorageManager.SaveIntoIsolatedStorage("MaintainAspectRatio", CheckboxMaintainAspectRatio.IsChecked);

            IsolatedStorageManager.SaveIntoIsolatedStorage("ForceIPv4", CheckboxForceIPv4.IsChecked);

            if (!string.IsNullOrEmpty(TextBoxNumberOfMessagesOnMonitor.Text))
            {
                IsolatedStorageManager.SaveIntoIsolatedStorage("NumberOfMessagesOnMonitor", Convert.ToInt32(TextBoxNumberOfMessagesOnMonitor.Text));
            }

            LoadSettingsFromIsolatedStorage();

            SystemMessages sm = new SystemMessages(new Message()
            {
                UserMessage = "Successfully Saved System Settings", SystemMessage = string.Empty, UserMessageType = MessageType.Success
            },
                                                   ButtonType.OkOnly);

            sm.ShowPopup();
        }
Ejemplo n.º 2
0
        void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            if (IsValid())
            {
                IsolatedStorageManager.SaveIntoIsolatedStorage("ForceIPv4", (bool)CheckboxForceIPv4.IsChecked);
                IsolatedStorageManager.SaveIntoIsolatedStorage("NumberOfMessages", TextBoxNumberOfMessagesOnMonitor.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("InputMonitoringPoints", TextBoxLastSettings.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("NumberOfDataPointsToPlot", TextBoxNumberOfDataPoints.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("DataResolution", TextBoxFramesPerSecond.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("LagTime", TextBoxLagTime.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("LeadTime", TextBoxLeadTime.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("UseLocalClockAsRealtime", (bool)CheckboxUseLocalClockAsRealtime.IsChecked);
                IsolatedStorageManager.SaveIntoIsolatedStorage("IgnoreBadTimestamps", (bool)CheckboxIngnoreBadTimestamps.IsChecked);
                IsolatedStorageManager.SaveIntoIsolatedStorage("ChartRefreshInterval", TextBoxChartRefreshInterval.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("StatisticsDataRefreshInterval", TextBoxStatisticsDataRefreshInterval.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("MeasurementsDataRefreshInterval", TextBoxMeasurementsDataRefreshInterval.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("DisplayXAxis", (bool)CheckboxDisplayXAxis.IsChecked);
                IsolatedStorageManager.SaveIntoIsolatedStorage("DisplayFrequencyYAxis", (bool)CheckboxDisplayFrequencyAxis.IsChecked);
                IsolatedStorageManager.SaveIntoIsolatedStorage("DisplayPhaseAngleYAxis", (bool)CheckboxDisplayPhaseAngleAxis.IsChecked);
                IsolatedStorageManager.SaveIntoIsolatedStorage("DisplayVoltageYAxis", (bool)CheckboxDisplayVoltageAxis.IsChecked);
                IsolatedStorageManager.SaveIntoIsolatedStorage("DisplayCurrentYAxis", (bool)CheckboxDisplayCurrentAxis.IsChecked);
                IsolatedStorageManager.SaveIntoIsolatedStorage("FrequencyRangeMin", TextBoxFrequencyRangeMin.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("FrequencyRangeMax", TextBoxFrequencyRangeMax.Text);
                IsolatedStorageManager.SaveIntoIsolatedStorage("DisplayLegend", (bool)CheckboxDisplayLegend.IsChecked);

                LoadSettingsFromIsolatedStorage();

                SystemMessages sm = new SystemMessages(new Message()
                {
                    UserMessage = "Successfully Saved System Settings", SystemMessage = string.Empty, UserMessageType = MessageType.Success
                },
                                                       ButtonType.OkOnly);
                sm.Owner = Window.GetWindow(this);
                sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                sm.ShowPopup();
            }
        }