Changeset 6827 for trunk/sources/HeuristicLab.Optimizer
- Timestamp:
- 09/25/11 21:02:58 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3
- Files:
-
- 12 added
- 2 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/FileManager.cs
r5445 r6827 60 60 if (openFileDialog.ShowDialog() == DialogResult.OK) { 61 61 foreach (string filename in openFileDialog.FileNames) { 62 (( OptimizerMainForm)MainFormManager.MainForm).SetAppStartingCursor();62 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor(); 63 63 ContentManager.LoadAsync(filename, LoadingCompleted); 64 64 } … … 76 76 } 77 77 finally { 78 (( OptimizerMainForm)MainFormManager.MainForm).ResetAppStartingCursor();78 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).ResetAppStartingCursor(); 79 79 } 80 80 } … … 92 92 SaveAs(view); 93 93 else { 94 (( OptimizerMainForm)MainFormManager.MainForm).SetAppStartingCursor();94 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor(); 95 95 SetEnabledStateOfContentViews(content, false); 96 96 ContentManager.SaveAsync(content, content.Filename, true, SavingCompleted); … … 117 117 118 118 if (saveFileDialog.ShowDialog() == DialogResult.OK) { 119 (( OptimizerMainForm)MainFormManager.MainForm).SetAppStartingCursor();119 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor(); 120 120 SetEnabledStateOfContentViews(content, false); 121 121 if (saveFileDialog.FilterIndex == 1) { … … 131 131 SetEnabledStateOfContentViews(content, true); 132 132 if (error != null) throw error; 133 MainFormManager.GetMainForm<Optimizer MainForm>().UpdateTitle();133 MainFormManager.GetMainForm<OptimizerDockingMainForm>().UpdateTitle(); 134 134 } 135 135 catch (Exception ex) { … … 137 137 } 138 138 finally { 139 (( OptimizerMainForm)MainFormManager.MainForm).ResetAppStartingCursor();139 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).ResetAppStartingCursor(); 140 140 } 141 141 } 142 142 143 143 private static void SetEnabledStateOfContentViews(IStorableContent content, bool enabled) { 144 Optimizer MainForm mainForm = MainFormManager.GetMainForm<OptimizerMainForm>();144 OptimizerDockingMainForm mainForm = MainFormManager.GetMainForm<OptimizerDockingMainForm>(); 145 145 if (mainForm.InvokeRequired) 146 146 mainForm.Invoke((Action<IStorableContent, bool>)SetEnabledStateOfContentViews, content, enabled); -
trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj
r6092 r6827 117 117 <EmbeddedResource Include="Documents\VNS_TSP.hl" /> 118 118 <EmbeddedResource Include="Documents\PSO_Schwefel.hl" /> 119 <EmbeddedResource Include="MainFormTypeSelectionDialog.resx"> 120 <DependentUpon>MainFormTypeSelectionDialog.cs</DependentUpon> 121 </EmbeddedResource> 122 <EmbeddedResource Include="OptimizerDockingMainForm.resx"> 123 <DependentUpon>OptimizerDockingMainForm.cs</DependentUpon> 124 </EmbeddedResource> 119 125 <None Include="HeuristicLabOptimizerPlugin.cs.frame" /> 126 <Compile Include="OptimizerSingleDocumentMainForm.cs"> 127 <SubType>Form</SubType> 128 </Compile> 129 <Compile Include="OptimizerSingleDocumentMainForm.Designer.cs"> 130 <DependentUpon>OptimizerSingleDocumentMainForm.cs</DependentUpon> 131 </Compile> 132 <Compile Include="MainFormTypeSelectionDialog.cs"> 133 <SubType>Form</SubType> 134 </Compile> 135 <Compile Include="MainFormTypeSelectionDialog.Designer.cs"> 136 <DependentUpon>MainFormTypeSelectionDialog.cs</DependentUpon> 137 </Compile> 138 <Compile Include="MenuItems\ChangeMainFormTypeMenuItem.cs" /> 139 <Compile Include="MenuItems\ChangeMainFormTypeSeperator.cs" /> 140 <Compile Include="OptimizerMultipleDocumentMainForm.cs"> 141 <SubType>Form</SubType> 142 </Compile> 143 <Compile Include="OptimizerMultipleDocumentMainForm.Designer.cs"> 144 <DependentUpon>OptimizerMultipleDocumentMainForm.cs</DependentUpon> 145 </Compile> 120 146 <Compile Include="CreateExperimentDialog.cs"> 121 147 <SubType>Form</SubType> … … 160 186 <DependentUpon>NewItemDialog.cs</DependentUpon> 161 187 </Compile> 162 <Compile Include="Optimizer MainForm.cs">163 <SubType>Form</SubType> 164 </Compile> 165 <Compile Include="Optimizer MainForm.Designer.cs">166 <DependentUpon>Optimizer MainForm.cs</DependentUpon>188 <Compile Include="OptimizerDockingMainForm.cs"> 189 <SubType>Form</SubType> 190 </Compile> 191 <Compile Include="OptimizerDockingMainForm.Designer.cs"> 192 <DependentUpon>OptimizerDockingMainForm.cs</DependentUpon> 167 193 </Compile> 168 194 <Compile Include="Properties\AssemblyInfo.cs" /> -
trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLabOptimizerPlugin.cs.frame
r6548 r6827 21 21 22 22 using System.Windows.Forms; 23 using HeuristicLab.Optimizer.Properties; 23 24 using HeuristicLab.PluginInfrastructure; 24 25 … … 42 43 internal class HeuristicLabOptimizerApplication : ApplicationBase { 43 44 public override void Run() { 44 OptimizerMainForm mainForm = new OptimizerMainForm(typeof(IOptimizerUserInterfaceItemProvider)); 45 mainForm.ShowContentInViewHost = true; 46 Application.Run(mainForm); 45 HeuristicLab.MainForm.WindowsForms.MainForm mainForm = null; 46 47 if (Settings.Default.MainFormType == OptimizerMainFormTypes.DockingMainForm) { 48 mainForm = new OptimizerDockingMainForm(typeof(IOptimizerUserInterfaceItemProvider)); 49 } else if (Settings.Default.MainFormType == OptimizerMainFormTypes.MultipleDocumentMainForm) { 50 mainForm = new OptimizerMultipleDocumentMainForm(typeof(IOptimizerUserInterfaceItemProvider)); 51 } else if (Settings.Default.MainFormType == OptimizerMainFormTypes.SingleDocumentMainForm) { 52 mainForm = new OptimizerSingleDocumentMainForm(typeof(IOptimizerUserInterfaceItemProvider)); 53 } 54 55 if (mainForm != null) { 56 mainForm.ShowContentInViewHost = true; 57 Application.Run(mainForm); 58 } else { 59 MessageBox.Show("Error loading setting for the MainForm Type. Please check your configuration file!", "HeuristicLab", MessageBoxButtons.OK, MessageBoxIcon.Error); 60 } 47 61 } 48 62 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/ClipboardMenuItem.cs
r5445 r6827 68 68 69 69 public override void Execute() { 70 IView clipboard = ((OptimizerMainForm)MainFormManager.MainForm).Clipboard; 71 if (clipboard.IsShown) { 72 clipboard.Hide(); 73 } else { 74 clipboard.Show(); 70 IView clipboard = null; 71 if (MainFormManager.MainForm is OptimizerDockingMainForm) { 72 clipboard = ((OptimizerDockingMainForm)MainFormManager.MainForm).Clipboard; 73 } else if (MainFormManager.MainForm is OptimizerMultipleDocumentMainForm) { 74 clipboard = ((OptimizerMultipleDocumentMainForm)MainFormManager.MainForm).Clipboard; 75 } else if (MainFormManager.MainForm is OptimizerSingleDocumentMainForm) { 76 clipboard = ((OptimizerSingleDocumentMainForm)MainFormManager.MainForm).Clipboard; 77 } 78 79 if (clipboard != null) { 80 if (clipboard.IsShown) { 81 clipboard.Hide(); 82 } else { 83 clipboard.Show(); 84 } 75 85 } 76 86 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CopyToClipboardMenuItem.cs
r5445 r6827 51 51 52 52 public override void Execute() { 53 Clipboard<IItem> clipboard = null; 53 54 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 55 54 56 if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IItem) && !activeView.Locked) { 55 Clipboard<IItem> clipboard = ((OptimizerMainForm)MainFormManager.MainForm).Clipboard; 56 IItem content = (IItem)activeView.Content; 57 clipboard.AddItem((IItem)content.Clone()); 57 if (MainFormManager.MainForm is OptimizerDockingMainForm) { 58 clipboard = ((OptimizerDockingMainForm)MainFormManager.MainForm).Clipboard; 59 } else if (MainFormManager.MainForm is OptimizerMultipleDocumentMainForm) { 60 clipboard = ((OptimizerMultipleDocumentMainForm)MainFormManager.MainForm).Clipboard; 61 } else if (MainFormManager.MainForm is OptimizerSingleDocumentMainForm) { 62 clipboard = ((OptimizerSingleDocumentMainForm)MainFormManager.MainForm).Clipboard; 63 } 64 65 if (clipboard != null) { 66 IItem content = (IItem)activeView.Content; 67 clipboard.AddItem((IItem)content.Clone()); 68 } 58 69 } 59 70 } -
trunk/sources/HeuristicLab.Optimizer/3.3/Properties/Settings.Designer.cs
r4065 r6827 2 2 // <auto-generated> 3 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319. 14 // Runtime Version:4.0.30319.237 5 5 // 6 6 // Changes to this file may cause incorrect behavior and will be lost if … … 95 95 } 96 96 } 97 98 [global::System.Configuration.UserScopedSettingAttribute()] 99 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 [global::System.Configuration.DefaultSettingValueAttribute("DockingMainForm")] 101 public global::HeuristicLab.Optimizer.OptimizerMainFormTypes MainFormType { 102 get { 103 return ((global::HeuristicLab.Optimizer.OptimizerMainFormTypes)(this["MainFormType"])); 104 } 105 set { 106 this["MainFormType"] = value; 107 } 108 } 97 109 } 98 110 } -
trunk/sources/HeuristicLab.Optimizer/3.3/Properties/Settings.settings
r3768 r6827 21 21 <Value Profile="(Default)">False</Value> 22 22 </Setting> 23 <Setting Name="MainFormType" Type="HeuristicLab.Optimizer.OptimizerMainFormTypes" Scope="User"> 24 <Value Profile="(Default)">DockingMainForm</Value> 25 </Setting> 23 26 </Settings> 24 27 </SettingsFile> -
trunk/sources/HeuristicLab.Optimizer/3.3/app.config
r3768 r6827 26 26 <value>False</value> 27 27 </setting> 28 <setting name="MainFormType" serializeAs="String"> 29 <value>DockingMainForm</value> 30 </setting> 28 31 </HeuristicLab.Optimizer.Properties.Settings> 29 32 </userSettings>
Note: See TracChangeset
for help on using the changeset viewer.