1.0-northcote/cs/Sharpen/frmSharpen.cs
/// <summary>
/// Opens a file using an <see cref="System.Windows.Forms.OpenFileDialog"/> and sets the UI if successful.
/// </summary>
Opens a file using an  and sets the UI if successful.
Opens a file using an and sets the UI if successful .
private void OpenFile()
        {
            if (this.dfoOpen.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    this.filePerms = new FileIOPermission(FileIOPermissionAccess.Read, dfoOpen.FileName);
                    this.filePerms.Demand();
                    this.encounter.SetEnergies(this.dfoOpen.FileName);
                    this.encounter.SetInteractionEnergies();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, this.sharpenTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    if (this.encounter.EnergyCount >= 3)
                    {
                        this.encounter.SetInteractionEnergies();
                    }
                }
                finally
                {
                    this.ResetUi();
                    this.SetUi();
                }
            }
        }
private void OpenFile ( ) { if ( this . dfoOpen . ShowDialog ( ) == DialogResult . OK ) { try { this . filePerms = new FileIOPermission ( FileIOPermissionAccess . Read , dfoOpen . FileName ) ; this . filePerms . Demand ( ) ; this . encounter . SetEnergies ( this . dfoOpen . FileName ) ; this . encounter . SetInteractionEnergies ( ) ; } catch ( Exception ex ) { MessageBox . Show ( ex . Message , this . sharpenTitle , MessageBoxButtons . OK , MessageBoxIcon . Warning ) ; if ( this . encounter . EnergyCount >= 3 ) { this . encounter . SetInteractionEnergies ( ) ; } } finally { this . ResetUi ( ) ; this . SetUi ( ) ; } } }
Opens a file using an  and sets the UI if successful.
Opens a file using an and sets the UI if successful .