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)

Location:
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3
Files:
6 deleted
5 edited

Legend:

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

    r4171 r4254  
    7878  </PropertyGroup>
    7979  <ItemGroup>
     80    <Reference Include="HeuristicLab.Common.Resources-3.3">
     81      <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     82    </Reference>
    8083    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
    8184      <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     
    133136      <SubType>Designer</SubType>
    134137    </EmbeddedResource>
    135     <EmbeddedResource Include="Properties\Resources.resx">
    136       <Generator>ResXFileCodeGenerator</Generator>
    137       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    138       <SubType>Designer</SubType>
    139     </EmbeddedResource>
    140     <Compile Include="Properties\Resources.Designer.cs">
    141       <AutoGen>True</AutoGen>
    142       <DependentUpon>Resources.resx</DependentUpon>
    143       <DesignTime>True</DesignTime>
    144     </Compile>
    145138    <None Include="Properties\AssemblyInfo.frame" />
    146139    <None Include="HeuristicLab.snk" />
    147     <None Include="Properties\Settings.settings">
    148       <Generator>SettingsSingleFileGenerator</Generator>
    149       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    150     </None>
    151     <Compile Include="Properties\Settings.Designer.cs">
    152       <AutoGen>True</AutoGen>
    153       <DependentUpon>Settings.settings</DependentUpon>
    154       <DesignTimeSharedInput>True</DesignTimeSharedInput>
    155     </Compile>
    156140  </ItemGroup>
    157141  <ItemGroup>
     
    164148      <Name>HeuristicLab.Hive.Server.Core-3.3</Name>
    165149    </ProjectReference>
    166   </ItemGroup>
    167   <ItemGroup>
    168     <None Include="Resources\HeuristicLab.ico" />
    169150  </ItemGroup>
    170151  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/HeuristicLabHiveServerApplication.cs

    r4253 r4254  
    3030using HeuristicLab.Hive.Contracts.Interfaces;
    3131using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Hive.Server.Core;
    3233
    3334namespace HeuristicLab.Hive.Server {
     
    162163      baseAddrDict.Add(STR_ExecutionEngineFacade, StartService(Services.ExecutionEngineFacade, addresses[index], WcfSettings.DEFAULTPORT));
    163164
    164       // [chn] why is lifecyclemanager instantiated here?? shouldnt Core.ServiceLocator be used?
    165       IEnumerable<ILifecycleManager> lifecycleManagers = ApplicationManager.Manager.GetInstances<ILifecycleManager>();
    166       if (lifecycleManagers.Count() > 0) {
    167         ILifecycleManager lifecycleManager = lifecycleManagers.First();
     165      ILifecycleManager lifecycleManager = ServiceLocator.GetLifecycleManager();
    168166
    169         lifecycleManager.Init();
     167      lifecycleManager.Init();
    170168
    171         // [chn] remove gui code here, how to display any response from server?
    172         Form mainForm = new MainForm(baseAddrDict);
    173         Application.Run(mainForm);
     169      Form mainForm = new MainForm(baseAddrDict);
     170      Application.Run();
    174171
    175         lifecycleManager.Shutdown();
    176       }
     172      lifecycleManager.Shutdown();
     173     
    177174      StopService(Services.All);
    178175    }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/HeuristicLabHiveServerPlugin.cs

    r4171 r4254  
    2929  [Plugin("HeuristicLab.Hive.Server", "3.3")]
    3030  [PluginFile("HeuristicLab.Hive.Server-3.3.dll", PluginFileType.Assembly)]
     31  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3132  [PluginDependency("HeuristicLab.Hive.Contracts", "3.3")]
    3233  [PluginDependency("HeuristicLab.Hive.Server.Core", "3.3")]
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/MainForm.Designer.cs

    r4042 r4254  
    5151          // rtfServices
    5252          //
     53          this.rtfServices.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     54                      | System.Windows.Forms.AnchorStyles.Left)
     55                      | System.Windows.Forms.AnchorStyles.Right)));
    5356          this.rtfServices.Location = new System.Drawing.Point(12, 25);
    5457          this.rtfServices.Name = "rtfServices";
    5558          this.rtfServices.ReadOnly = true;
    56           this.rtfServices.Size = new System.Drawing.Size(280, 121);
     59          this.rtfServices.Size = new System.Drawing.Size(377, 129);
    5760          this.rtfServices.TabIndex = 1;
    5861          this.rtfServices.Text = "";
     
    9699          this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    97100          this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    98           this.ClientSize = new System.Drawing.Size(304, 166);
     101          this.ClientSize = new System.Drawing.Size(401, 166);
    99102          this.Controls.Add(this.rtfServices);
    100103          this.Controls.Add(this.label1);
    101           this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
    102104          this.Name = "MainForm";
    103           this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
    104105          this.Text = "Hive Server";
    105106          this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
  • 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.