Changeset 17473 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views
- Timestamp:
- 03/10/20 17:17:37 (4 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs
r17471 r17473 53 53 foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) { 54 54 IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType); 55 JI2VM.Add(vm. JsonItemType, vmType);55 JI2VM.Add(vm.TargetedJsonItemType, vmType); 56 56 } 57 57 } … … 102 102 if(Node2VM.TryGetValue(childNode, out IJsonItemVM vm)) 103 103 vm.Selected = true; 104 104 105 } else { 105 106 TreeNode childNode = new TreeNode(c.Name); … … 126 127 Node2Control.Add(node, control); 127 128 } else { 128 //node. 129 node.ForeColor = Color.LightGray; 130 node.NodeFont = new Font(SystemFonts.DialogFont, FontStyle.Italic); 129 131 } 130 132 } … … 138 140 } 139 141 140 return b || (item.Value != null || item.Range != null || item is ILookupJsonItem || item is IResultJsonItem);142 return b || !(item is EmptyJsonItem); 141 143 } 142 144 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.resx
r17444 r17473 121 121 <value>194, 17</value> 122 122 </metadata> 123 <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 124 <value>37</value> 125 </metadata> 123 126 <metadata name="jsonItemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 124 127 <value>17, 17</value> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemMultiValueControl.cs
r17471 r17473 167 167 private void InitRangeBinding() { 168 168 NumericRangeControl = numericRangeControl1; 169 NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM .MinRange));170 NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM .MaxRange));171 NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM .EnableMinRange),169 NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange)); 170 NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange)); 171 NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange), 172 172 false, DataSourceUpdateMode.OnPropertyChanged); 173 NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM .EnableMaxRange),173 NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange), 174 174 false, DataSourceUpdateMode.OnPropertyChanged); 175 175 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.Designer.cs
r17471 r17473 26 26 this.components = new System.ComponentModel.Container(); 27 27 this.groupBox1 = new System.Windows.Forms.GroupBox(); 28 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 29 this.label2 = new System.Windows.Forms.Label(); 28 30 this.textBoxValueTo = new System.Windows.Forms.TextBox(); 31 this.textBoxValueFrom = new System.Windows.Forms.TextBox(); 29 32 this.label4 = new System.Windows.Forms.Label(); 30 this.label2 = new System.Windows.Forms.Label();31 33 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 32 this.textBoxValueFrom = new System.Windows.Forms.TextBox();33 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();34 34 this.numericRangeControl = new HeuristicLab.JsonInterface.OptimizerIntegration.NumericRangeControl(); 35 35 this.groupBox1.SuspendLayout(); 36 this.tableLayoutPanel1.SuspendLayout(); 36 37 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 37 this.tableLayoutPanel1.SuspendLayout();38 38 this.SuspendLayout(); 39 39 // … … 50 50 this.groupBox1.TabStop = false; 51 51 this.groupBox1.Text = "Value"; 52 //53 // textBoxValueTo54 //55 this.textBoxValueTo.Dock = System.Windows.Forms.DockStyle.Fill;56 this.textBoxValueTo.Location = new System.Drawing.Point(100, 24);57 this.textBoxValueTo.Margin = new System.Windows.Forms.Padding(0);58 this.textBoxValueTo.Name = "textBoxValueTo";59 this.textBoxValueTo.Size = new System.Drawing.Size(394, 20);60 this.textBoxValueTo.TabIndex = 3;61 //62 // label463 //64 this.label4.AutoSize = true;65 this.label4.Dock = System.Windows.Forms.DockStyle.Fill;66 this.label4.Location = new System.Drawing.Point(0, 24);67 this.label4.Margin = new System.Windows.Forms.Padding(0);68 this.label4.Name = "label4";69 this.label4.Size = new System.Drawing.Size(100, 25);70 this.label4.TabIndex = 1;71 this.label4.Text = "To:";72 this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;73 //74 // label275 //76 this.label2.AutoSize = true;77 this.label2.Dock = System.Windows.Forms.DockStyle.Fill;78 this.label2.Location = new System.Drawing.Point(0, 0);79 this.label2.Margin = new System.Windows.Forms.Padding(0);80 this.label2.Name = "label2";81 this.label2.Size = new System.Drawing.Size(100, 24);82 this.label2.TabIndex = 0;83 this.label2.Text = "From:";84 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;85 //86 // errorProvider87 //88 this.errorProvider.ContainerControl = this;89 //90 // textBoxValueFrom91 //92 this.textBoxValueFrom.Dock = System.Windows.Forms.DockStyle.Fill;93 this.textBoxValueFrom.Location = new System.Drawing.Point(100, 0);94 this.textBoxValueFrom.Margin = new System.Windows.Forms.Padding(0);95 this.textBoxValueFrom.Name = "textBoxValueFrom";96 this.textBoxValueFrom.Size = new System.Drawing.Size(394, 20);97 this.textBoxValueFrom.TabIndex = 2;98 52 // 99 53 // tableLayoutPanel1 … … 115 69 this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 49); 116 70 this.tableLayoutPanel1.TabIndex = 19; 71 // 72 // label2 73 // 74 this.label2.AutoSize = true; 75 this.label2.Dock = System.Windows.Forms.DockStyle.Fill; 76 this.label2.Location = new System.Drawing.Point(0, 0); 77 this.label2.Margin = new System.Windows.Forms.Padding(0); 78 this.label2.Name = "label2"; 79 this.label2.Size = new System.Drawing.Size(100, 24); 80 this.label2.TabIndex = 0; 81 this.label2.Text = "From:"; 82 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 83 // 84 // textBoxValueTo 85 // 86 this.textBoxValueTo.Dock = System.Windows.Forms.DockStyle.Fill; 87 this.textBoxValueTo.Location = new System.Drawing.Point(100, 24); 88 this.textBoxValueTo.Margin = new System.Windows.Forms.Padding(0); 89 this.textBoxValueTo.Name = "textBoxValueTo"; 90 this.textBoxValueTo.Size = new System.Drawing.Size(394, 20); 91 this.textBoxValueTo.TabIndex = 3; 92 // 93 // textBoxValueFrom 94 // 95 this.textBoxValueFrom.Dock = System.Windows.Forms.DockStyle.Fill; 96 this.textBoxValueFrom.Location = new System.Drawing.Point(100, 0); 97 this.textBoxValueFrom.Margin = new System.Windows.Forms.Padding(0); 98 this.textBoxValueFrom.Name = "textBoxValueFrom"; 99 this.textBoxValueFrom.Size = new System.Drawing.Size(394, 20); 100 this.textBoxValueFrom.TabIndex = 2; 101 // 102 // label4 103 // 104 this.label4.AutoSize = true; 105 this.label4.Dock = System.Windows.Forms.DockStyle.Fill; 106 this.label4.Location = new System.Drawing.Point(0, 24); 107 this.label4.Margin = new System.Windows.Forms.Padding(0); 108 this.label4.Name = "label4"; 109 this.label4.Size = new System.Drawing.Size(100, 25); 110 this.label4.TabIndex = 1; 111 this.label4.Text = "To:"; 112 this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 113 // 114 // errorProvider 115 // 116 this.errorProvider.ContainerControl = this; 117 117 // 118 118 // numericRangeControl … … 137 137 this.Size = new System.Drawing.Size(500, 147); 138 138 this.groupBox1.ResumeLayout(false); 139 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();140 139 this.tableLayoutPanel1.ResumeLayout(false); 141 140 this.tableLayoutPanel1.PerformLayout(); 141 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 142 142 this.ResumeLayout(false); 143 143 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.cs
r17464 r17473 32 32 33 33 private void InitNumbericRangeControl() { 34 numericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM .MinRange));35 numericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM .MaxRange));36 numericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM .EnableMinRange),34 numericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange)); 35 numericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange)); 36 numericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange), 37 37 false, DataSourceUpdateMode.OnPropertyChanged); 38 numericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM .EnableMaxRange),38 numericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange), 39 39 false, DataSourceUpdateMode.OnPropertyChanged); 40 40 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValidValuesControl.cs
r17464 r17473 12 12 public partial class JsonItemValidValuesControl : UserControl { 13 13 14 IJsonItemVM VM { get; set; }14 StringValueVM VM { get; set; } 15 15 16 16 public JsonItemValidValuesControl(StringValueVM vm) { 17 17 InitializeComponent(); 18 18 VM = vm; 19 if (VM.Item. Range!= null) {20 foreach (var i in VM.Item. Range)21 SetupOption( (string)i);19 if (VM.Item.ConcreteRestrictedItems != null) { 20 foreach (var i in VM.Item.ConcreteRestrictedItems) 21 SetupOption(i); 22 22 comboBoxValues.DataBindings.Add("SelectedItem", VM, nameof(StringValueVM.Value)); 23 23 } else { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.cs
r17471 r17473 58 58 protected void Init() { 59 59 TBValue.DataBindings.Add("Text", VM, ValuePropertyId); 60 NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM .MinRange));61 NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM .MaxRange));62 NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM .EnableMinRange),60 NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange)); 61 NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange)); 62 NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange), 63 63 false, DataSourceUpdateMode.OnPropertyChanged); 64 NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM .EnableMaxRange),64 NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange), 65 65 false, DataSourceUpdateMode.OnPropertyChanged); 66 66 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ValueLookupJsonItemControl.Designer.cs
r17471 r17473 1 namespace HeuristicLab.JsonInterface.OptimizerIntegration .Views{1 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 2 2 partial class ValueLookupJsonItemControl { 3 3 /// <summary> … … 29 29 // content 30 30 // 31 this.content.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 32 | System.Windows.Forms.AnchorStyles.Left) 33 | System.Windows.Forms.AnchorStyles.Right))); 34 this.content.Location = new System.Drawing.Point(0, 20); 31 this.content.Dock = System.Windows.Forms.DockStyle.Fill; 32 this.content.Location = new System.Drawing.Point(0, 22); 35 33 this.content.Margin = new System.Windows.Forms.Padding(0); 36 34 this.content.Name = "content"; 37 this.content.Size = new System.Drawing.Size(651, 350); 35 this.content.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0); 36 this.content.Size = new System.Drawing.Size(500, 523); 38 37 this.content.TabIndex = 14; 39 38 // … … 44 43 this.Controls.Add(this.content); 45 44 this.Name = "ValueLookupJsonItemControl"; 46 this.Size = new System.Drawing.Size( 651, 370);45 this.Size = new System.Drawing.Size(500, 545); 47 46 this.Controls.SetChildIndex(this.content, 0); 48 47 this.ResumeLayout(false); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ValueLookupJsonItemControl.cs
r17471 r17473 10 10 using HeuristicLab.PluginInfrastructure; 11 11 12 namespace HeuristicLab.JsonInterface.OptimizerIntegration .Views{12 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 13 13 public partial class ValueLookupJsonItemControl : LookupJsonItemControl { 14 private IDictionary<Type, Type> JI2VM { get; set; }14 private static IDictionary<Type, Type> JI2VM { get; set; } 15 15 16 public ValueLookupJsonItemControl() {17 InitializeComponent();18 }19 16 public ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) : base(vm) { 20 17 InitializeComponent(); 21 18 InitCache(); 22 if ( JI2VM.TryGetValue(vm.JsonItemReference.GetType(), out Type vmType)) {19 if (vm.JsonItemReference != null && JI2VM.TryGetValue(vm.JsonItemReference.GetType(), out Type vmType)) { 23 20 IJsonItemVM tmp = (IJsonItemVM)Activator.CreateInstance(vmType); 24 content.Controls.Add(tmp.Control); 25 } else { 26 //node. 21 tmp.Item = vm.JsonItemReference; 22 content.Controls.Clear(); 23 UserControl control = tmp.Control; 24 content.Controls.Add(control); 25 control.Dock = DockStyle.Fill; 26 27 27 } 28 28 } 29 29 30 30 private void InitCache() { 31 JI2VM = new Dictionary<Type, Type>(); 32 foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) { 33 IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType); 34 JI2VM.Add(vm.JsonItemType, vmType); 31 if(JI2VM == null) { 32 JI2VM = new Dictionary<Type, Type>(); 33 foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) { 34 IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType); 35 JI2VM.Add(vm.TargetedJsonItemType, vmType); 36 } 35 37 } 36 38 }
Note: See TracChangeset
for help on using the changeset viewer.