コード例 #1
0
        private void DoSave()
        {
            check = null;
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            // Set filter options and filter index.
            saveFileDialog1.Filter      = "Binary Files (.bin)|*.bin|All Files (*.*)|*.*";
            saveFileDialog1.FilterIndex = 1;

            // Call the ShowDialog method to show the dialog box.
            bool?userClickedOK = saveFileDialog1.ShowDialog();

            // Process input if the user clicked OK.
            if (userClickedOK == true)
            {
                System.IO.Stream fileStream = saveFileDialog1.OpenFile();
                firm.Patch(fileStream);
                fileStream.Close();
                SendEvent("SaveFile", firm.ModelVersion, firm.PatchesString);
            }
        }
コード例 #2
0
        private void bSaveFirmware_Click(object sender, RoutedEventArgs e)
        {
            if (CanSave)
            {
                bool hasBeta  = firm.Patches.Any(p => p.Enabled && p.PatchStatus == PatchLevel.Beta);
                bool hasAlpha = firm.Patches.Any(p => p.Enabled && p.PatchStatus == PatchLevel.Alpha);

                var AlphaWarn = "\n\nAlpha patches may not have been tested by anybody, and may damage your camera in an unrecoverable way.\n\nIt is recommend You do not use those patch";
                var BetaWarn  = "\n\nBeta patches have been tested but may have strange side effects, worse case the camera should be recoverable";
                if (hasAlpha && hasBeta)
                {
                    check = new CheckWindow();
                    check.TextBox.Text    = "You have selected Alpha & Beta patches:" + AlphaWarn + BetaWarn;
                    check.OKButton.Click += (s, o) => { DoSave(); };
                    check.Show();
                }
                else if (hasAlpha)
                {
                    check = new CheckWindow();
                    check.TextBox.Text    = "You have selected Alpha patches:" + AlphaWarn;
                    check.OKButton.Click += (s, o) => { DoSave(); };
                    check.Show();
                }
                else if (hasBeta)
                {
                    check = new CheckWindow();
                    check.TextBox.Text    = "You have selected Beta patches:" + BetaWarn;
                    check.OKButton.Click += (s, o) => { DoSave(); };
                    check.Show();
                }
                else
                {
                    DoSave();
                }
            }
        }
コード例 #3
0
        private void DoSave()
        {
            check = null;
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            // Set filter options and filter index.
            saveFileDialog1.Filter = "Binary Files (.bin)|*.bin|All Files (*.*)|*.*";
            saveFileDialog1.FilterIndex = 1;

            // Call the ShowDialog method to show the dialog box.
            bool? userClickedOK = saveFileDialog1.ShowDialog();

            // Process input if the user clicked OK.
            if (userClickedOK == true)
            {
                System.IO.Stream fileStream = saveFileDialog1.OpenFile();
                firm.Patch(fileStream);
                fileStream.Close();
                SendEvent("SaveFile", firm.ModelVersion, firm.PatchesString);
            }
        }
コード例 #4
0
        private void bSaveFirmware_Click(object sender, RoutedEventArgs e)
        {
            if (CanSave)
            {
                bool hasBeta = firm.Patches.Any(p => p.Enabled && p.PatchStatus == PatchLevel.Beta);
                bool hasAlpha = firm.Patches.Any(p => p.Enabled && p.PatchStatus == PatchLevel.Alpha);

                var AlphaWarn = "\n\nAlpha patches may not have been tested by anybody, and may damage your camera in an unrecoverable way.\n\nIt is recommend You do not use those patch";
                var BetaWarn = "\n\nBeta patches have been tested but may have strange side effects, worse case the camera should be recoverable";
                if (hasAlpha && hasBeta)
                {
                    check = new CheckWindow();
                    check.TextBox.Text = "You have selected Alpha & Beta patches:" + AlphaWarn + BetaWarn;
                    check.OKButton.Click += (s,o) => { DoSave(); };
                    check.Show();
                }
                else if (hasAlpha)
                {
                    check = new CheckWindow();
                    check.TextBox.Text = "You have selected Alpha patches:" + AlphaWarn;
                    check.OKButton.Click += (s, o) => { DoSave(); };
                    check.Show();
                }
                else if (hasBeta)
                {
                    check = new CheckWindow();
                    check.TextBox.Text = "You have selected Beta patches:" + BetaWarn;
                    check.OKButton.Click += (s, o) => { DoSave(); };
                    check.Show();
                }
                else
                {
                    DoSave();
                }
            }
        }