예제 #1
0
        private void GetFolderSelect(TextBlock textBlock, TypeSelect select)
        {
            FolderBrowserDialog folderBrowser = new FolderBrowserDialog();

            if (select == TypeSelect.JPG)
            {
                folderBrowser.RootFolder = System.Environment.SpecialFolder.MyComputer;
            }
            else if (jpgDir != null && select == TypeSelect.RAW)
            {
                // Folder browser will start from the same directory that the user set for Jpg files
                folderBrowser.SelectedPath = jpgDir.FullName;
            }
            if (folderBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (select == TypeSelect.JPG)
                {
                    jpgDir         = new DirectoryInfo(folderBrowser.SelectedPath);
                    textBlock.Text = "The selected folder is: " + jpgDir.FullName;
                }
                // Using else if instead if, if I'll need to add another file type
                else if (select == TypeSelect.RAW)
                {
                    rawDir         = new DirectoryInfo(folderBrowser.SelectedPath);
                    textBlock.Text = "The selected folder is: " + rawDir.FullName;
                }
            }
            else
            {
                MessageBox.Show("Problem occured during folder selection, please try again.");
            }
        }
예제 #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataView dv = (DataView)TypeSelect.Select(DataSourceSelectArguments.Empty);

        if ((string)dv.Table.Rows[0][1] == "Small Event")
        {
            TagUpdate0.Update();
        }
        else
        {
            TagUpdate.Update();
        }
        BalanceInsert.Insert();
        Response.Redirect("~/client/ClientAccount.aspx?bbb=" + 1);
    }
예제 #3
0
        private void TypeOK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DanoEventArgs DEA = new DanoEventArgs();
                DEA.DanoParameters.Add(Convert.ToInt32(IntensityTextBox.Text));
                DEA.DanoParameters.Add(TypeSelect.GetSelectedItem());
                DEA.DanoParameters.Add(MousePosition);

                if (OptionalApplicationSettings_PressureBox.Text == string.Empty)
                {
                    // Add a placeholder in the case the pressure has not been specified.
                    DEA.DanoParameters.Add(1000);
                }
                else
                {
                    int Pressure = Convert.ToInt32(OptionalApplicationSettings_PressureBox.Text);

                    if (Pressure < 0 || Pressure > 2147483647)
                    {
                        Error.Throw("Warning!", "Pressure must be between 0mbar and 2,147,483,647mbar", ErrorSeverity.Warning, 414);
                        return;
                    }

                    DEA.DanoParameters.Add(Pressure);
                }


                OKHit(this, DEA);
            }
            catch (OverflowException err)
            {
#if DEBUG
                Error.Throw("Error!", $"All numerical storm data must be between -2,147,483,647mph and 2,147,483,647mph inclusive.\n\n{err}", ErrorSeverity.Error, 413);
#else
                Error.Throw("Error!", $"All numerical storm data must be between -2,147,483,647mph and 2,147,483,647mph inclusive.", ErrorSeverity.Error, 413);
#endif
            }
            catch (FormatException err)
            {
                // For (pre-)beta only
#if DEBUG
                Error.Throw("Error!", $"All numerical storm data must be valid!\n\n{err}", ErrorSeverity.Error, 414);
#else
                Error.Throw("Error!", $"All numerical storm data must be valid!", ErrorSeverity.Error, 414);
#endif
            }
        }
예제 #4
0
 private void TypeSelect_Loaded(object sender, RoutedEventArgs e)
 {
     // wow visual studio added a tostring format helper, when did they do that?
     SeasonStartTimeText.Text = StartTime.ToString("yyyy-MM-dd HH:mm:ss");
     TypeSelect.Setup(TypeNames);
 }