- Timestamp:
- 09/20/10 05:15:15 (14 years ago)
- Location:
- branches/OKB/HeuristicLab.Clients.OKB-3.3
- Files:
-
- 5 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Clients.OKB-3.3/Administrator.cs
r4433 r4441 39 39 } 40 40 41 private ItemCollection<Platform> platforms; 42 public ItemCollection<Platform> Platforms { 43 get { return platforms; } 44 } 41 45 private ItemCollection<AlgorithmClass> algorithmClasses; 42 46 public ItemCollection<AlgorithmClass> AlgorithmClasses { … … 52 56 public void Refresh() { 53 57 OnRefreshing(); 58 if (platforms == null) { 59 platforms = new ItemCollection<Platform>(); 60 platforms.ItemsRemoved += new CollectionItemsChangedEventHandler<Platform>(platforms_ItemsRemoved); 61 } 62 platforms.Clear(); 54 63 if (algorithmClasses == null) { 55 64 algorithmClasses = new ItemCollection<AlgorithmClass>(); 56 65 algorithmClasses.ItemsRemoved += new CollectionItemsChangedEventHandler<AlgorithmClass>(algorithmClasses_ItemsRemoved); 57 66 } 67 algorithmClasses.Clear(); 58 68 if (algorithms == null) { 59 69 algorithms = new ItemCollection<Algorithm>(); 60 70 algorithms.ItemsRemoved += new CollectionItemsChangedEventHandler<Algorithm>(algorithms_ItemsRemoved); 61 71 } 62 algorithmClasses.Clear();63 72 algorithms.Clear(); 64 73 65 var action = new Action(delegate() { 66 algorithmClasses.AddRange(CallAdminService<ItemCollection<AlgorithmClass>>(s => s.GetAlgorithmClasses()).OrderBy(a => a.Name)); 67 algorithms.AddRange(CallAdminService<ItemCollection<Algorithm>>(s => s.GetAlgorithms()).OrderBy(a => a.Name)); 74 var call = new Func<Exception>(delegate() { 75 try { 76 platforms.AddRange(CallAdminService<ItemCollection<Platform>>(s => s.GetPlatforms()).OrderBy(a => a.Name)); 77 algorithmClasses.AddRange(CallAdminService<ItemCollection<AlgorithmClass>>(s => s.GetAlgorithmClasses()).OrderBy(a => a.Name)); 78 algorithms.AddRange(CallAdminService<ItemCollection<Algorithm>>(s => s.GetAlgorithms()).OrderBy(a => a.Name)); 79 return null; 80 } 81 catch (Exception ex) { 82 return ex; 83 } 68 84 }); 69 action.BeginInvoke(delegate(IAsyncResult result) { 70 action.EndInvoke(result); 85 call.BeginInvoke(delegate(IAsyncResult result) { 86 Exception ex = call.EndInvoke(result); 87 if (ex != null) ErrorHandling.ShowErrorDialog("Refresh failed.", ex); 71 88 OnRefreshed(); 72 89 }, null); 73 90 } 74 91 75 public void Store(IOKBItem item) { 76 if (item is AlgorithmClass) 77 CallAdminService(s => s.StoreAlgorithmClass((AlgorithmClass)item)); 78 else if (item is Algorithm) 79 CallAdminService(s => s.StoreAlgorithm((Algorithm)item)); 92 public bool Store(IOKBItem item) { 93 try { 94 if (item is Platform) 95 CallAdminService(s => s.StorePlatform((Platform)item)); 96 else if (item is AlgorithmClass) 97 CallAdminService(s => s.StoreAlgorithmClass((AlgorithmClass)item)); 98 else if (item is Algorithm) 99 CallAdminService(s => s.StoreAlgorithm((Algorithm)item)); 100 return true; 101 } 102 catch (Exception ex) { 103 ErrorHandling.ShowErrorDialog("Store failed.", ex); 104 return false; 105 } 80 106 } 81 107 … … 91 117 } 92 118 119 private void platforms_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<Platform> e) { 120 try { 121 foreach (Platform p in e.Items) 122 CallAdminService(s => s.DeletePlatform(p.Id)); 123 } 124 catch (Exception ex) { 125 ErrorHandling.ShowErrorDialog("Delete failed.", ex); 126 } 127 } 93 128 private void algorithmClasses_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<AlgorithmClass> e) { 94 foreach (AlgorithmClass a in e.Items) 95 CallAdminService(s => s.DeleteAlgorithmClass(a.Id)); 129 try { 130 foreach (AlgorithmClass a in e.Items) 131 CallAdminService(s => s.DeleteAlgorithmClass(a.Id)); 132 } 133 catch (Exception ex) { 134 ErrorHandling.ShowErrorDialog("Delete failed.", ex); 135 } 96 136 } 97 137 private void algorithms_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<Algorithm> e) { 98 foreach (Algorithm a in e.Items) 99 CallAdminService(s => s.DeleteAlgorithm(a.Id)); 138 try { 139 foreach (Algorithm a in e.Items) 140 CallAdminService(s => s.DeleteAlgorithm(a.Id)); 141 } 142 catch (Exception ex) { 143 ErrorHandling.ShowErrorDialog("Delete failed.", ex); 144 } 100 145 } 101 146 … … 105 150 try { 106 151 call(client); 107 }108 catch (Exception ex) {109 ErrorHandling.ShowErrorDialog(ex);110 152 } 111 153 finally { … … 123 165 return call(client); 124 166 } 125 catch (Exception ex) {126 ErrorHandling.ShowErrorDialog(ex);127 }128 167 finally { 129 168 try { … … 134 173 } 135 174 } 136 return null;137 175 } 138 176 #endregion -
branches/OKB/HeuristicLab.Clients.OKB-3.3/HeuristicLab.Clients.OKB-3.3.csproj
r4433 r4441 83 83 <SubType>Code</SubType> 84 84 </Compile> 85 <Compile Include="ServiceClients\Platform.cs" /> 85 86 <Compile Include="ServiceClients\INamedOKBItem.cs"> 86 87 <SubType>Code</SubType> … … 110 111 <Compile Include="Views\AlgorithmCollectionView.Designer.cs"> 111 112 <DependentUpon>AlgorithmCollectionView.cs</DependentUpon> 113 </Compile> 114 <Compile Include="Views\AlgorithmView.cs"> 115 <SubType>UserControl</SubType> 116 </Compile> 117 <Compile Include="Views\AlgorithmView.Designer.cs"> 118 <DependentUpon>AlgorithmView.cs</DependentUpon> 119 </Compile> 120 <Compile Include="Views\PlatformCollectionView.cs"> 121 <SubType>UserControl</SubType> 122 </Compile> 123 <Compile Include="Views\PlatformCollectionView.Designer.cs"> 124 <DependentUpon>PlatformCollectionView.cs</DependentUpon> 112 125 </Compile> 113 126 <Compile Include="Views\OKBItemView.cs"> -
branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients/IOKBItem.cs
r4426 r4441 20 20 #endregion 21 21 22 using System; 22 23 using System.ComponentModel; 23 24 using HeuristicLab.Core; … … 25 26 namespace HeuristicLab.Clients.OKB { 26 27 public interface IOKBItem : IItem, INotifyPropertyChanged { 28 bool Modified { get; } 29 27 30 void Store(); 31 32 event EventHandler ModifiedChanged; 28 33 } 29 34 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients/OKBItem.cs
r4433 r4441 41 41 } 42 42 public virtual Image ItemImage { 43 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Class; } 43 get { 44 if (Modified) 45 return HeuristicLab.Common.Resources.VS2008ImageLibrary.DatabaseModified; 46 else 47 return HeuristicLab.Common.Resources.VS2008ImageLibrary.Database; 48 } 44 49 } 45 50 46 protected OKBItem() { } 51 private bool modified; 52 public bool Modified { 53 get { return modified; } 54 private set { 55 if (value != modified) { 56 modified = value; 57 OnModifiedChanged(); 58 RaisePropertyChanged("Modified"); 59 OnItemImageChanged(); 60 RaisePropertyChanged("ItemImage"); 61 } 62 } 63 } 64 65 protected OKBItem() { 66 modified = true; 67 } 68 69 [OnDeserialized] 70 private void OnDeserialized(StreamingContext context) { 71 modified = false; 72 } 47 73 48 74 public object Clone() { … … 60 86 61 87 public void Store() { 62 Administrator.Instance.Store(this); 88 if (Administrator.Instance.Store(this)) 89 Modified = false; 63 90 } 64 91 … … 66 93 protected void RaisePropertyChanged(string propertyName) { 67 94 OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); 95 if ((propertyName != "Modified") && (propertyName != "ItemImage")) { 96 Modified = true; 97 } 68 98 } 69 99 protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) { 70 100 PropertyChangedEventHandler handler = PropertyChanged; 71 101 if (handler != null) handler(this, e); 102 } 103 public event EventHandler ModifiedChanged; 104 protected virtual void OnModifiedChanged() { 105 EventHandler handler = ModifiedChanged; 106 if (handler != null) handler(this, EventArgs.Empty); 72 107 } 73 108 public event EventHandler ItemImageChanged; -
branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients/ServiceClients.cs
r4433 r4441 9 9 //------------------------------------------------------------------------------ 10 10 11 namespace HeuristicLab.Clients.OKB 12 { 13 using System.Runtime.Serialization; 14 15 16 [System.Diagnostics.DebuggerStepThroughAttribute()] 11 namespace HeuristicLab.Clients.OKB { 12 13 14 [System.Diagnostics.DebuggerStepThroughAttribute()] 17 15 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 18 16 [System.Runtime.Serialization.DataContractAttribute(Name="AlgorithmClass", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.DataAccess", IsReference=true)] … … 5692 5690 void DeleteAlgorithmClass(long algorithmClassId); 5693 5691 5692 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetPlatform", ReplyAction="http://tempuri.org/IAdminService/GetPlatformResponse")] 5693 HeuristicLab.Clients.OKB.Platform GetPlatform(long platformId); 5694 5695 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetPlatforms", ReplyAction="http://tempuri.org/IAdminService/GetPlatformsResponse")] 5696 HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms(); 5697 5698 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/StorePlatform", ReplyAction="http://tempuri.org/IAdminService/StorePlatformResponse")] 5699 void StorePlatform(HeuristicLab.Clients.OKB.Platform platform); 5700 5701 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/DeletePlatform", ReplyAction="http://tempuri.org/IAdminService/DeletePlatformResponse")] 5702 void DeletePlatform(long platformId); 5703 5694 5704 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetAlgorithm", ReplyAction="http://tempuri.org/IAdminService/GetAlgorithmResponse")] 5695 5705 HeuristicLab.Clients.OKB.Algorithm GetAlgorithm(long algorithmId); … … 5703 5713 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/DeleteAlgorithm", ReplyAction="http://tempuri.org/IAdminService/DeleteAlgorithmResponse")] 5704 5714 void DeleteAlgorithm(long algorithmId); 5705 5706 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetPlatforms", ReplyAction="http://tempuri.org/IAdminService/GetPlatformsResponse")]5707 HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms();5708 5715 5709 5716 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetCompleteAlgorithm", ReplyAction="http://tempuri.org/IAdminService/GetCompleteAlgorithmResponse")] … … 5774 5781 } 5775 5782 5783 public HeuristicLab.Clients.OKB.Platform GetPlatform(long platformId) 5784 { 5785 return base.Channel.GetPlatform(platformId); 5786 } 5787 5788 public HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms() 5789 { 5790 return base.Channel.GetPlatforms(); 5791 } 5792 5793 public void StorePlatform(HeuristicLab.Clients.OKB.Platform platform) 5794 { 5795 base.Channel.StorePlatform(platform); 5796 } 5797 5798 public void DeletePlatform(long platformId) 5799 { 5800 base.Channel.DeletePlatform(platformId); 5801 } 5802 5776 5803 public HeuristicLab.Clients.OKB.Algorithm GetAlgorithm(long algorithmId) 5777 5804 { … … 5792 5819 { 5793 5820 base.Channel.DeleteAlgorithm(algorithmId); 5794 }5795 5796 public HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms()5797 {5798 return base.Channel.GetPlatforms();5799 5821 } 5800 5822 -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AdministratorView.Designer.cs
r4426 r4441 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.tabControl = new System.Windows.Forms.TabControl(); 49 this.platformsTabPage = new System.Windows.Forms.TabPage(); 50 this.platformCollectionView = new HeuristicLab.Clients.OKB.PlatformCollectionView(); 48 51 this.algorithmClassesTabPage = new System.Windows.Forms.TabPage(); 49 52 this.algorithmClassCollectionView = new HeuristicLab.Clients.OKB.AlgorithmClassCollectionView(); 50 this.refreshButton = new System.Windows.Forms.Button();51 53 this.algorithmsTabPage = new System.Windows.Forms.TabPage(); 52 54 this.algorithmCollectionView = new HeuristicLab.Clients.OKB.AlgorithmCollectionView(); 55 this.refreshButton = new System.Windows.Forms.Button(); 56 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 53 57 this.tabControl.SuspendLayout(); 58 this.platformsTabPage.SuspendLayout(); 54 59 this.algorithmClassesTabPage.SuspendLayout(); 55 60 this.algorithmsTabPage.SuspendLayout(); … … 61 66 | System.Windows.Forms.AnchorStyles.Left) 62 67 | System.Windows.Forms.AnchorStyles.Right))); 68 this.tabControl.Controls.Add(this.platformsTabPage); 63 69 this.tabControl.Controls.Add(this.algorithmClassesTabPage); 64 70 this.tabControl.Controls.Add(this.algorithmsTabPage); … … 67 73 this.tabControl.SelectedIndex = 0; 68 74 this.tabControl.Size = new System.Drawing.Size(727, 406); 69 this.tabControl.TabIndex = 2; 75 this.tabControl.TabIndex = 1; 76 // 77 // platformsTabPage 78 // 79 this.platformsTabPage.Controls.Add(this.platformCollectionView); 80 this.platformsTabPage.Location = new System.Drawing.Point(4, 22); 81 this.platformsTabPage.Name = "platformsTabPage"; 82 this.platformsTabPage.Padding = new System.Windows.Forms.Padding(3); 83 this.platformsTabPage.Size = new System.Drawing.Size(719, 380); 84 this.platformsTabPage.TabIndex = 2; 85 this.platformsTabPage.Text = "Platforms"; 86 this.platformsTabPage.UseVisualStyleBackColor = true; 87 // 88 // platformCollectionView 89 // 90 this.platformCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 91 | System.Windows.Forms.AnchorStyles.Left) 92 | System.Windows.Forms.AnchorStyles.Right))); 93 this.platformCollectionView.Caption = "PlatformCollection View"; 94 this.platformCollectionView.Content = null; 95 this.platformCollectionView.Location = new System.Drawing.Point(6, 6); 96 this.platformCollectionView.Name = "platformCollectionView"; 97 this.platformCollectionView.ReadOnly = false; 98 this.platformCollectionView.Size = new System.Drawing.Size(707, 368); 99 this.platformCollectionView.TabIndex = 0; 70 100 // 71 101 // algorithmClassesTabPage … … 91 121 this.algorithmClassCollectionView.ReadOnly = false; 92 122 this.algorithmClassCollectionView.Size = new System.Drawing.Size(707, 368); 93 this.algorithmClassCollectionView.TabIndex = 3; 94 // 95 // refreshButton 96 // 97 this.refreshButton.Location = new System.Drawing.Point(0, 0); 98 this.refreshButton.Name = "refreshButton"; 99 this.refreshButton.Size = new System.Drawing.Size(75, 23); 100 this.refreshButton.TabIndex = 2; 101 this.refreshButton.Text = "&Refresh"; 102 this.refreshButton.UseVisualStyleBackColor = true; 103 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 123 this.algorithmClassCollectionView.TabIndex = 0; 104 124 // 105 125 // algorithmsTabPage … … 125 145 this.algorithmCollectionView.ReadOnly = false; 126 146 this.algorithmCollectionView.Size = new System.Drawing.Size(707, 368); 127 this.algorithmCollectionView.TabIndex = 2; 147 this.algorithmCollectionView.TabIndex = 0; 148 // 149 // refreshButton 150 // 151 this.refreshButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Refresh; 152 this.refreshButton.Location = new System.Drawing.Point(0, 0); 153 this.refreshButton.Name = "refreshButton"; 154 this.refreshButton.Size = new System.Drawing.Size(24, 24); 155 this.refreshButton.TabIndex = 0; 156 this.toolTip.SetToolTip(this.refreshButton, "Refresh Data"); 157 this.refreshButton.UseVisualStyleBackColor = true; 158 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 128 159 // 129 160 // AdministratorView … … 136 167 this.Size = new System.Drawing.Size(727, 435); 137 168 this.tabControl.ResumeLayout(false); 169 this.platformsTabPage.ResumeLayout(false); 138 170 this.algorithmClassesTabPage.ResumeLayout(false); 139 171 this.algorithmsTabPage.ResumeLayout(false); … … 150 182 private AlgorithmClassCollectionView algorithmClassCollectionView; 151 183 private AlgorithmCollectionView algorithmCollectionView; 184 private System.Windows.Forms.ToolTip toolTip; 185 private System.Windows.Forms.TabPage platformsTabPage; 186 private PlatformCollectionView platformCollectionView; 152 187 153 188 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AdministratorView.cs
r4433 r4441 53 53 base.OnContentChanged(); 54 54 if (Content == null) { 55 platformCollectionView.Content = null; 55 56 algorithmClassCollectionView.Content = null; 56 57 algorithmCollectionView.Content = null; 57 58 } else { 59 platformCollectionView.Content = Content.Platforms; 58 60 algorithmClassCollectionView.Content = Content.AlgorithmClasses; 59 61 algorithmCollectionView.Content = Content.Algorithms; … … 64 66 base.SetEnabledStateOfControls(); 65 67 refreshButton.Enabled = Content != null; 68 platformCollectionView.Enabled = Content != null; 66 69 algorithmClassCollectionView.Enabled = Content != null; 67 70 algorithmCollectionView.Enabled = Content != null; … … 72 75 Invoke(new EventHandler(Content_Refreshing), sender, e); 73 76 } else { 74 Enabled = false;75 77 Cursor = Cursors.AppStarting; 78 refreshButton.Enabled = false; 79 tabControl.Enabled = false; 76 80 } 77 81 } … … 80 84 Invoke(new EventHandler(Content_Refreshed), sender, e); 81 85 } else { 86 platformCollectionView.Content = Content.Platforms; 82 87 algorithmClassCollectionView.Content = Content.AlgorithmClasses; 83 88 algorithmCollectionView.Content = Content.Algorithms; 89 refreshButton.Enabled = true; 90 tabControl.Enabled = true; 84 91 Cursor = Cursors.Default; 85 Enabled = true;86 92 } 87 93 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/NamedOKBItemView.Designer.cs
r4426 r4441 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container();48 47 this.nameLabel = new System.Windows.Forms.Label(); 49 48 this.nameTextBox = new System.Windows.Forms.TextBox(); 50 49 this.descriptionLabel = new System.Windows.Forms.Label(); 51 50 this.descriptionTextBox = new System.Windows.Forms.TextBox(); 52 this.toolTip = new System.Windows.Forms.ToolTip(this.components);51 ((System.ComponentModel.ISupportInitialize)(this.modifiedPictureBox)).BeginInit(); 53 52 this.SuspendLayout(); 53 // 54 // storeButton 55 // 56 this.toolTip.SetToolTip(this.storeButton, "Store Data"); 57 // 58 // modifiedPictureBox 59 // 60 this.modifiedPictureBox.Location = new System.Drawing.Point(308, 3); 61 this.modifiedPictureBox.Size = new System.Drawing.Size(39, 130); 54 62 // 55 63 // nameLabel … … 68 76 this.nameTextBox.Location = new System.Drawing.Point(72, 29); 69 77 this.nameTextBox.Name = "nameTextBox"; 70 this.nameTextBox.Size = new System.Drawing.Size(2 79, 20);78 this.nameTextBox.Size = new System.Drawing.Size(230, 20); 71 79 this.nameTextBox.TabIndex = 2; 80 this.nameTextBox.TextChanged += new System.EventHandler(this.nameTextBox_TextChanged); 72 81 this.nameTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.nameTextBox_KeyDown); 73 this.nameTextBox.Validated += new System.EventHandler(this.nameTextBox_Validated);74 82 // 75 83 // descriptionLabel … … 89 97 this.descriptionTextBox.Name = "descriptionTextBox"; 90 98 this.descriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 91 this.descriptionTextBox.Size = new System.Drawing.Size(2 79, 20);99 this.descriptionTextBox.Size = new System.Drawing.Size(230, 20); 92 100 this.descriptionTextBox.TabIndex = 4; 101 this.descriptionTextBox.TextChanged += new System.EventHandler(this.descriptionTextBox_TextChanged); 93 102 this.descriptionTextBox.DoubleClick += new System.EventHandler(this.descriptionTextBox_DoubleClick); 94 this.descriptionTextBox.Validated += new System.EventHandler(this.descriptionTextBox_Validated);95 103 // 96 104 // NamedOKBItemView … … 103 111 this.Controls.Add(this.nameTextBox); 104 112 this.Name = "NamedOKBItemView"; 105 this.Size = new System.Drawing.Size(351, 80); 113 this.Size = new System.Drawing.Size(350, 229); 114 this.Controls.SetChildIndex(this.modifiedPictureBox, 0); 106 115 this.Controls.SetChildIndex(this.storeButton, 0); 107 116 this.Controls.SetChildIndex(this.nameTextBox, 0); … … 109 118 this.Controls.SetChildIndex(this.descriptionLabel, 0); 110 119 this.Controls.SetChildIndex(this.descriptionTextBox, 0); 120 ((System.ComponentModel.ISupportInitialize)(this.modifiedPictureBox)).EndInit(); 111 121 this.ResumeLayout(false); 112 122 this.PerformLayout(); … … 120 130 protected System.Windows.Forms.Label descriptionLabel; 121 131 protected System.Windows.Forms.TextBox descriptionTextBox; 122 protected System.Windows.Forms.ToolTip toolTip;123 132 } 124 133 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/NamedOKBItemView.cs
r4426 r4441 91 91 } 92 92 } 93 protected virtual void nameTextBox_Validated(object sender, EventArgs e) { 94 Content.Name = nameTextBox.Text; 93 protected virtual void nameTextBox_TextChanged(object sender, EventArgs e) { 94 if (nameTextBox.Text != Content.Name) 95 Content.Name = nameTextBox.Text; 95 96 } 96 protected virtual void descriptionTextBox_Validated(object sender, EventArgs e) { 97 Content.Description = descriptionTextBox.Text; 97 protected virtual void descriptionTextBox_TextChanged(object sender, EventArgs e) { 98 if (descriptionTextBox.Text != Content.Description) 99 Content.Description = descriptionTextBox.Text; 98 100 } 99 101 -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/OKBItemView.Designer.cs
r4426 r4441 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.storeButton = new System.Windows.Forms.Button(); 49 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 50 this.modifiedPictureBox = new System.Windows.Forms.PictureBox(); 51 ((System.ComponentModel.ISupportInitialize)(this.modifiedPictureBox)).BeginInit(); 48 52 this.SuspendLayout(); 49 53 // 50 54 // storeButton 51 55 // 56 this.storeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.PublishToWeb; 52 57 this.storeButton.Location = new System.Drawing.Point(0, 0); 53 58 this.storeButton.Name = "storeButton"; 54 this.storeButton.Size = new System.Drawing.Size( 75, 23);59 this.storeButton.Size = new System.Drawing.Size(24, 24); 55 60 this.storeButton.TabIndex = 0; 56 this. storeButton.Text = "&Store";61 this.toolTip.SetToolTip(this.storeButton, "Store Data"); 57 62 this.storeButton.UseVisualStyleBackColor = true; 58 63 this.storeButton.Click += new System.EventHandler(this.storeButton_Click); 64 // 65 // modifiedPictureBox 66 // 67 this.modifiedPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 68 this.modifiedPictureBox.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.HighPriorityLarge; 69 this.modifiedPictureBox.Location = new System.Drawing.Point(312, 3); 70 this.modifiedPictureBox.Name = "modifiedPictureBox"; 71 this.modifiedPictureBox.Size = new System.Drawing.Size(39, 130); 72 this.modifiedPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; 73 this.modifiedPictureBox.TabIndex = 1; 74 this.modifiedPictureBox.TabStop = false; 75 this.toolTip.SetToolTip(this.modifiedPictureBox, "Data Modified"); 76 this.modifiedPictureBox.Visible = false; 59 77 // 60 78 // OKBItemView … … 62 80 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 63 81 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 82 this.Controls.Add(this.modifiedPictureBox); 64 83 this.Controls.Add(this.storeButton); 65 84 this.Name = "OKBItemView"; 66 this.Size = new System.Drawing.Size(315, 292); 85 this.Size = new System.Drawing.Size(354, 308); 86 ((System.ComponentModel.ISupportInitialize)(this.modifiedPictureBox)).EndInit(); 67 87 this.ResumeLayout(false); 68 88 … … 72 92 73 93 protected System.Windows.Forms.Button storeButton; 94 protected System.Windows.Forms.ToolTip toolTip; 95 protected System.Windows.Forms.PictureBox modifiedPictureBox; 74 96 75 97 -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/OKBItemView.cs
r4426 r4441 43 43 protected override void DeregisterContentEvents() { 44 44 Content.PropertyChanged -= new PropertyChangedEventHandler(Content_PropertyChanged); 45 Content.ModifiedChanged -= new EventHandler(Content_ModifiedChanged); 45 46 base.DeregisterContentEvents(); 46 47 } … … 48 49 base.RegisterContentEvents(); 49 50 Content.PropertyChanged += new PropertyChangedEventHandler(Content_PropertyChanged); 51 Content.ModifiedChanged += new EventHandler(Content_ModifiedChanged); 50 52 } 51 53 52 54 protected override void SetEnabledStateOfControls() { 53 55 base.SetEnabledStateOfControls(); 54 storeButton.Enabled = Content != null; 56 storeButton.Enabled = (Content != null) && Content.Modified; 57 modifiedPictureBox.Visible = (Content != null) && Content.Modified; 55 58 } 56 59 … … 63 66 } 64 67 protected virtual void OnContentPropertyChanged(string propertyName) { } 68 protected virtual void Content_ModifiedChanged(object sender, EventArgs e) { 69 if (InvokeRequired) 70 Invoke(new EventHandler(Content_ModifiedChanged), sender, e); 71 else { 72 storeButton.Enabled = Content.Modified; 73 modifiedPictureBox.Visible = Content.Modified; 74 } 75 } 65 76 66 77 protected virtual void storeButton_Click(object sender, EventArgs e) { -
branches/OKB/HeuristicLab.Clients.OKB-3.3/app.config
r4422 r4441 7 7 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 8 8 bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 9 maxBufferPoolSize="524288" maxReceivedMessageSize=" 65536"9 maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" 10 10 messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 11 11 allowCookies="false">
Note: See TracChangeset
for help on using the changeset viewer.