Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/18/10 17:23:09 (14 years ago)
Author:
cneumuel
Message:

some small refactorings (#1159)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/MainForm.cs

    r4171 r4254  
    77using System.Text;
    88using System.Windows.Forms;
    9 using HeuristicLab.Hive.Server.Properties;
    109
    11 namespace HeuristicLab.Hive.Server
    12 {
    13     public partial class MainForm : Form {
    14         public MainForm(Dictionary<string, Uri> addresses) {
    15           InitializeComponent();
    16           this.Visible = false;
    17           this.Hide();
     10namespace HeuristicLab.Hive.Server {
     11  public partial class MainForm : Form {
     12    public MainForm(Dictionary<string, Uri> addresses) {
     13      InitializeComponent();
    1814
    19           Uri uri;
    20           StringBuilder servicesTxt = new StringBuilder();
    21           addresses.TryGetValue(HeuristicLabHiveServerApplication.STR_ClientCommunicator, out uri);
    22           if (uri != null)
    23             servicesTxt.AppendLine(String.Format("Server Client: {0}", uri));
    24           addresses.TryGetValue(HeuristicLabHiveServerApplication.STR_ServerConsoleFacade, out uri);
    25           if (uri != null)
    26             servicesTxt.AppendLine(String.Format("Server Console: {0}", uri));
    27           addresses.TryGetValue(HeuristicLabHiveServerApplication.STR_ExecutionEngineFacade, out uri);
    28           if (uri != null)
    29             servicesTxt.AppendLine(String.Format("Execution Engine: {0}", uri));
     15      Uri uri;
     16      StringBuilder servicesTxt = new StringBuilder();
     17      addresses.TryGetValue(HeuristicLabHiveServerApplication.STR_ClientCommunicator, out uri);
     18      if (uri != null)
     19        servicesTxt.AppendLine(String.Format("Server Client: {0}", uri));
     20      addresses.TryGetValue(HeuristicLabHiveServerApplication.STR_ServerConsoleFacade, out uri);
     21      if (uri != null)
     22        servicesTxt.AppendLine(String.Format("Server Console: {0}", uri));
     23      addresses.TryGetValue(HeuristicLabHiveServerApplication.STR_ExecutionEngineFacade, out uri);
     24      if (uri != null)
     25        servicesTxt.AppendLine(String.Format("Execution Engine: {0}", uri));
    3026
    31           rtfServices.AppendText(servicesTxt.ToString());
     27      rtfServices.AppendText(servicesTxt.ToString());
    3228
    33           ni.Icon = Resources.HeuristicLab;
    34           ni.BalloonTipTitle = "HL Hive Server Services";
    35           ni.BalloonTipText = servicesTxt.ToString();
    36           ni.BalloonTipIcon = ToolTipIcon.Info;
    37           ni.Text = "HL Hive Server Services";
    38           ni.ShowBalloonTip(10000);
    39         }
     29      ni.Icon = HeuristicLab.Common.Resources.HeuristicLab.Icon;
     30      ni.BalloonTipTitle = "HL Hive Server Services";
     31      ni.BalloonTipText = servicesTxt.ToString();
     32      ni.BalloonTipIcon = ToolTipIcon.Info;
     33      ni.Text = "HL Hive Server Services";
     34      ni.ShowBalloonTip(10000);
     35    }
    4036
    41         private void CloseApp(object sender, EventArgs e) {
    42           Dispose();
    43         }
     37    private void CloseApp(object sender, EventArgs e) {
     38      this.Dispose();
     39      Application.Exit();
     40    }
    4441
    45         private void ShowInfo(object sender, EventArgs e) {
    46           this.Visible = true;
    47         }
     42    private void ShowInfo(object sender, EventArgs e) {
     43      this.Visible = true;
     44    }
    4845
    49         private void btnClose_Click(object sender, EventArgs e) {
    50           this.Visible = false;
    51         }
    52 
    53         private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {         
    54         }
    55 
     46    private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {
     47      e.Cancel = true;
     48      this.Visible = false;
    5649    }
     50  }
    5751}
Note: See TracChangeset for help on using the changeset viewer.