internal void SetSelectedObject(GraphicLink graphicLink, ModelLink modelLink, State state) { Clear(); this.graphicLink = graphicLink; this.state = state; id = 0; linkGraphic = AppendRootCategory(id++, "Graphic"); //linkGraphicGuid = AppendProperty(linkGraphic, id++, "Guid", graphicLink, "Guid", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkGraphicOrigin = AppendProperty(linkGraphic, id++, "Origin", graphicLink, "Origin", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkGraphicDestination = AppendProperty(linkGraphic, id++, "Destination", graphicLink, "Destination", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkGraphicOriginPortID = AppendProperty(linkGraphic, id++, "Origin Port ID", graphicLink, "OriginPortID", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkGraphicDestinationPortID = AppendProperty(linkGraphic, id++, "Destination Port ID", graphicLink, "DestinationPortID", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkGraphicTag = AppendProperty(linkGraphic, id++, "Tag", graphicLink, "Tag", ""); linkModel = AppendRootCategory(id++, "Model"); //linkModelClass = AppendProperty(linkModel, id++, "Class", modelLink, "LinkClass", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkModelOrigin = AppendProperty(linkModel, id++, "Origin", modelLink, "Origin", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkModelDestination = AppendProperty(linkModel, id++, "Destination", modelLink, "Destination", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkModelOriginPort = AppendProperty(linkModel, id++, "Origin Port", modelLink, "OriginPort", "", new System.ComponentModel.ReadOnlyAttribute(true)); //linkModelDestinationPort = AppendProperty(linkModel, id++, "Destination Port", modelLink, "DestinationPort", "", new System.ComponentModel.ReadOnlyAttribute(true)); }
public override Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum) { if (DontShowInPlaceCtrl(propEnum)) { return(null); } PropInPlaceList list; if (mInPlaceCtrl == null) { list = new PropInPlaceList(_editable); list.Visible = false; list.Parent = mParentWnd; mInPlaceCtrl = list; } else { list = (PropInPlaceList)mInPlaceCtrl; } NotifyInPlaceControlCreated(propEnum); // list.Text = propEnum.Property.Value.DisplayString; list.OwnerPropertyEnumerator = propEnum; list.Font = propEnum.Property.Value.Font; MoveControl(valueRect, propEnum); return(base.ShowControl(valueRect, propEnum)); }
//new internal void Clear() //{ // modelItem = null; // state = null; // base.Clear(); //} internal void SetSelectedObject(ModelItem modelItem, State state) { this.modelItem = modelItem; this.state = state; PropertyEnumerator rootProperty = AppendRootCategory(id++, "Main"); GetSubProperties(rootProperty, "What should be the propertyPath -- need to include this in modelitem definition... -- for now: " + modelItem.Guid.ToString()); }
public virtual PropertyEnumerator getPropertiesEnumerator() { global::System.IntPtr cPtr = xpcf_apiPINVOKE.IConfigurable_getPropertiesEnumerator(swigCPtr); PropertyEnumerator ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyEnumerator(cPtr, true); if (xpcf_apiPINVOKE.SWIGPendingException.Pending) { throw xpcf_apiPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
private State state; // = null; protected override void OnPropertyExpanded(PropertyExpandedEventArgs e) { if (e.Expanded == true) { PropertyEnumerator property = e.PropertyEnum; if (RemoveDummy(property)) { GetSubProperties(property, "What should be the propertyPath -- need to include this in modelitem definition... -- for now: " + modelItem.Guid.ToString()); } } }
private void GetSubProperties(PropertyEnumerator rootProperty, String propertyPath) { ArrayList propertyList = new ArrayList(); state.GetSubTags(out requestId, propertyPath, out propertyList); foreach (ModelProperty modelProperty in propertyList) { PropertyEnumerator propertyEnum = AppendManagedProperty(rootProperty, id++, modelProperty.Path, modelProperty.State.GetType(), modelProperty.State, ""); AppendManagedProperty(propertyEnum, -1, "", typeof(dummyType), new dummyType(), ""); ExpandProperty(propertyEnum, false); } }
protected override void OnPropertyChanged(VisualHint.SmartPropertyGrid.PropertyChangedEventArgs e) { if (e.PropertyEnum.Property.Id == 7) { ParentForm.Opacity = (double)Opacity / 100.0; //FormBackColor = Color.FromArgb((int)((double)Opacity / 100.0 * 255.0), FormBackColor); } else if (e.PropertyEnum.Property.Id == 10) { PropertyEnumerator propEnum = FindProperty(6); propEnum.Property.Value.ReadOnly = (bool)e.PropertyEnum.Property. Value.GetValue(); } }
/// <summary> /// Hide script slot fields on a property grid. /// </summary> /// <param name="innerGrid">The property grid.</param> protected void HideScriptSlots(PropertyGrid innerGrid) { PropertyEnumerator enumerator = innerGrid.FirstProperty; do { if (enumerator.Property != null && enumerator.Property.Name.StartsWith("On")) { innerGrid.DeleteProperty(enumerator); } else { enumerator.MoveNext(); } }while (enumerator != enumerator.RightBound); }
public void Initialize() { PropertyEnumerator catEnum = AppendRootCategory(1, "Application"); PropertyEnumerator propEnum = AppendManagedProperty(catEnum, 2, "AllowQuit", typeof(bool), Application.AllowQuit, "Help string", new ReadOnlyAttribute(true)); AppendManagedProperty(catEnum, 3, "Use wait cursor", typeof(bool), Application.UseWaitCursor, ""); catEnum = AppendRootCategory(4, "Form"); AppendProperty(catEnum, 5, "Back color", ParentForm, "BackColor", ""); propEnum = AppendProperty(catEnum, 6, "Size", ParentForm, "Size", ""); ExpandProperty(propEnum, true); //propEnum = InsertProperty(propEnum, 7, "Opacity", ParentForm, "Opacity", ""); // handles the item Opacity = (int)(ParentForm.Opacity * 100.0); propEnum = AppendProperty(propEnum, 7, "Opacity", this, "Opacity", ""); propEnum.Property.Feel = GetRegisteredFeel( VisualHint.SmartPropertyGrid.PropertyGrid.FeelTrackbarEdit); propEnum = AppendManagedProperty(catEnum, 8, "Chess piece", typeof(string), "Pawn", ""); propEnum.Property.Feel = GetRegisteredFeel( VisualHint.SmartPropertyGrid.PropertyGrid.FeelList); propEnum = AppendManagedProperty(catEnum, 9, "Incremented value", typeof(double), 1.2, ""); propEnum.Property.Feel = GetRegisteredFeel( VisualHint.SmartPropertyGrid.PropertyGrid.FeelEditUpDown); propEnum = AppendManagedProperty(catEnum, 10, "Size readonly", typeof(bool), false, ""); propEnum.Property.Feel = GetRegisteredFeel( VisualHint.SmartPropertyGrid.PropertyGrid.FeelCheckbox); propEnum.Property.Look = new PropertyCheckboxLook(); ToolbarVisibility = true; CommentsVisibility = true; }
protected bool RemoveDummy(PropertyEnumerator property) { bool dummyDeleted = false; PropertyEnumerator child = null; if (property != null) { child = property.Children.MoveFirst(); while (child.Property != null) { if ((child.Parent == property) && (child.Property.Id == -1)) { DeleteProperty(child); dummyDeleted = true; } child = child.MoveNext(); } } return(dummyDeleted); }
public void MapTester_exception_should_prettify_ScenarioTestFailureException() { var source = new Source(); var dummy = new Dummy(); string[] destPropertyNames = PropertyEnumerator.GetPublicInstanceReadWriteProperties(typeof(Dummy).GetTypeInfo()).Select(x => x.Name).ToArray(); int propertyCount = destPropertyNames.Length; string message = string.Empty; try { MapTester.ForMap <Source, Dummy>().AssertMappedValues(source, dummy); } catch (MapTesterException ex) { message = ex.Message; } StringAssert.Contains(message, $"{propertyCount} properties tested. 0 passed. {propertyCount} failed."); StringAssert.DoesNotMatch(message, new Regex("cenario")); }
/// <summary> /// 初始化 /// </summary> /// <param name="input"></param> public Mapper(object input) : this() { var reader = input as IDataReader; if (reader != null) { _reader = new DataReaderEnumerator(reader); Error = _reader.Error; _index = 1; return; } var no = input as NameObjectCollectionBase; if (no != null) { _nv = new NameValueEnumerator(no); Error = _nv.Error; _index = 2; return; } var row = (input as DataRowView)?.Row ?? input as DataRow; if (row?.Table != null) { _row = new DataRowEnumerator(row); Error = _row.Error; _index = 3; return; } var dataset = input as DataSet; if (dataset != null) { _dataSet = new DataSetEnumerator(dataset); Error = _dataSet.Error; _index = 4; return; } var dict = input as IDictionary; if (dict != null) { _enumerator = dict.GetEnumerator(); _index = 5; return; } var ee = (input as IEnumerable)?.GetEnumerator() ?? input as IEnumerator; if (ee != null) { _pair = new PairEnumerator(ee); Error = _pair.Error; _index = 6; return; } var ps = PublicPropertyCache.GetByType(input.GetType()); if (ps.Length > 0) { _property = new PropertyEnumerator(input, ps); Error = _property.Error; _index = 7; } }
public PropertyEnumerable(IMessage message) { _enumerator = new PropertyEnumerator(message); }
public PropertyValidatorBase(PropertyEnumerator propEnum) { _enumerator = propEnum; }
public override bool DontShowInPlaceCtrl(PropertyEnumerator propEnum) { return((propEnum.Property.Value.IsReadOnly(propEnum)) && !_editable); }
/// <summary> /// Initialize a job browser for a specified job. /// </summary> /// <param name="job">Job to display.</param> public JobBrowser(DryadLinqJobInfo job) { this.doingStartup = true; this.InitializeComponent(); this.queueWorker = new BackgroundWorker(); this.queue = new BackgroundWorkQueue(this.queueWorker, this.toolStripStatusLabel_currentWork, this.toolStripStatusLabel_backgroundWork); this.WarnedAboutDebugging = false; this.status = new StatusWriter(this.toolStripStatusLabel, this.statusStrip, this.Status); this.refreshTimer = new System.Windows.Forms.Timer(); this.refreshTimer.Interval = 30000; // 30 seconds this.refreshTimer.Tick += this.refreshTimer_Tick; #region SET_JOB_HEADER this.jobHeaderData = new BindingListSortable<PropertyEnumerator<DryadLinqJobInfo>.PropertyValue>(); this.dataGridView_jobHeader.DataSource = this.jobHeaderData; this.SetDataGridViewColumnsSize(this.dataGridView_jobHeader); this.jobPropertyEnumerator = new PropertyEnumerator<DryadLinqJobInfo>(); this.jobPropertyEnumerator.ValueFormatter = this.PropertyValueFormatter; List<string> jobPropertiesToSkip = new List<string> { "ClusterConfiguration", "Processes", "Vertices", "JM", "Name", "JobManagerVertex", "JMStdoutIncomplete", "JobInfoCannotBeCollected" }; this.jobPropertyEnumerator.Skip(jobPropertiesToSkip); this.jobPropertyEnumerator.Expand("Summary"); #endregion #region SET_STAGE_HEADER this.stageHeaderData = new BindingListSortable<PropertyEnumerator<DryadLinqJobStage>.PropertyValue>(); this.stagePropertyEnumerator = new PropertyEnumerator<DryadLinqJobStage>(); this.stagePropertyEnumerator.ValueFormatter = this.PropertyValueFormatter; List<string> stagePropertiesToSkip = new List<string> { "Vertices", "Name" }; this.stagePropertyEnumerator.Skip(stagePropertiesToSkip); this.tableHeaderData = new BindingListSortable<PropertyEnumerator<StaticPartitionedTableInformation>.PropertyValue>(); this.tablePropertyEnumerator = new PropertyEnumerator<StaticPartitionedTableInformation>(); this.tablePropertyEnumerator.ValueFormatter = this.PropertyValueFormatter; this.tablePropertyEnumerator.Skip("Partitions", "Header", "Code"); this.SetNoStageOrTable("", false); #endregion #region SET_STAGE_DATA this.stageData = new BindingListSortable<ExecutedVertexInstance>(); this.tablePartitionsData = new BindingListSortable<StaticPartitionedTableInformation.StaticPartitionInformation>(); #endregion #region SET_VERTEX_HEADER this.vertexHeaderData = new BindingListSortable<PropertyEnumerator<ExecutedVertexInstance>.PropertyValue>(); this.dataGridView_vertexHeader.DataSource = this.vertexHeaderData; this.SetDataGridViewColumnsSize(this.dataGridView_vertexHeader); this.vertexPropertyEnumerator = new PropertyEnumerator<ExecutedVertexInstance>(); this.vertexPropertyEnumerator.ValueFormatter = this.PropertyValueFormatter; List<string> vertexPropertiesToSkip = new List<string> { "JobSummary", "InputChannels", "OutputChannels", "Name", "LogFilesPattern", "IsManager" }; this.vertexPropertyEnumerator.Skip(vertexPropertiesToSkip); #endregion // Disable the vertex context menu, since none of these operatios work at this point this.contextMenu_stageVertex.Enabled = false; this.plansHaveBeenBuilt = false; this.graphViewer = new Msagl.GraphViewerGdi.GViewer(); this.graphViewer.Dock = DockStyle.Fill; this.graphViewer.NavigationVisible = false; this.graphViewer.ToolBarIsVisible = false; this.graphViewer.MouseClick += this.graphViewer_MouseClick; this.graphViewer.MouseDoubleClick += this.graphViewer_MouseDoubleClick; this.graphViewer.InsertingEdge = false; this.staticGraphZoomLevel = 0; this.planDrawSurface = new DrawingSurface2D(this.panel_jobSchedule); this.planDrawSurface.SetMargins(4, 4, 4, 4); this.panel_jobSchedule.MouseDoubleClick += this.panel_jobSchedule_MouseDoubleClick; this.planDrawSurface.FastDrawing = false; this.colorByStagestatusToolStripMenuItem.Checked = true; this.defaultBackColor = this.label_job.BackColor; this.planVisible = PlanVisible.None; this.linkCache = new Dictionary<string, IClusterResidentObject>(); this.mouseIsHeld = false; this.draggingMouse = false; this.drawingSurfaceSize = 0.0; #region TOOLTIPS ToolTip help = new ToolTip(); help.SetToolTip(this.richTextBox_file, "Click on links to follow; control-click to open in explorer; alt-click to follow an input channel to its source."); help.SetToolTip(this.panel_scheduleContainer, "Displays the job schedule; click to select."); help.SetToolTip(this.checkBox_refresh, "Refreshes the job status ever 30s."); help.SetToolTip(this.graphViewer, "Click to select stages; Ctrl +/- to zoom."); help.SetToolTip(this.dataGridView_jobHeader, "Selecting some rows filters the data."); help.SetToolTip(this.comboBox_plan, "Display the job plan in various forms."); help.SetToolTip(this.comboBox_vertexInformation, "Display more information about the vertex."); help.SetToolTip(this.label_job, "Global job information."); help.SetToolTip(this.label_stage, "Information about the selected stage/table. Select rows for filtering."); help.SetToolTip(this.label_Vertex, "Information about the selected vertex."); help.SetToolTip(this.panel_jobSchedule, "Click on the stages or tables for more information; drag to zoom."); help.SetToolTip(this.textBox_stageCode, "Code executed by the selected stage."); help.SetToolTip(this.textBox_find, "Type a string to find."); help.SetToolTip(this.button_clearFind, "Stop finding."); help.SetToolTip(this.button_filter, "Show only lines matching string to find (case-sensitive)."); help.SetToolTip(this.button_findNext, "Find next occurence of string."); help.SetToolTip(this.button_findPrev, "Find previous occurence of string."); help.SetToolTip(this.label_title, "File currently displayed."); #endregion this.Job = job; }
//Makes the parameters all at once public void MakeParameters(List <EarlabParameter> Parameters, PropertyEnumerator catEnum, ref int propertyID) { PropertyEnumerator propEnum; foreach (EarlabParameter EarlabParam in Parameters) { string paramType = EarlabParam.PType.ToLower(); paramType = paramType.Replace(" ", ""); //*Split into the broad categories of display type. //*Single Value //----> bools, ints, floats, doubles, strings etc. //*Array Value //----> ints, floats, doubles, switch (paramType) { case "integer": case "int": propEnum = AppendProperty( catEnum, propertyID++, EarlabParam.PName, //Name of the Parameter EarlabParam, //Object reference "PValue", //String name of the Parameter Value, given via reflection EarlabParam.Message //The comment, which will need to be updated. ); //end //Standard Way of showing the thing. propEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelEdit); if (EarlabParam.Severity == "Warning") { //If there is a problem:::: propEnum.Property.BackColor = Color.Firebrick; //<-- back ground color change propEnum.Property.ForeColor = Color.FloralWhite; //<-- text color change } ExpandProperty(propEnum, true); break; case "float": case "double": case "dbl": case "fl": //Cast the Parameter propEnum = AppendProperty( catEnum, propertyID++, EarlabParam.PName, //Name of the Parameter EarlabParam, //Object reference "PValue", //String name of the Parameter Value, given via reflection EarlabParam.Message //The comment, which will need to be updated. ); //Standard Way of showing the thing. propEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelEdit); if (EarlabParam.Severity == "Warning") { propEnum.Property.BackColor = Color.Firebrick; //<-- back ground color change propEnum.Property.ForeColor = Color.FloralWhite; //<-- text color change } ExpandProperty(propEnum, true); break; case "string": //Cast the Parameter propEnum = AppendProperty( catEnum, propertyID++, EarlabParam.PName, //Name of the Parameter EarlabParam, //Object reference "PValue", //String name of the Parameter Value, given via reflection EarlabParam.Message); //The comment, which will need to be updated. //Standard Way of showing the thing. propEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelEdit); if (EarlabParam.Severity == "Warning") { propEnum.Property.BackColor = Color.Firebrick; //<-- back ground color change propEnum.Property.ForeColor = Color.FloralWhite; //<-- text color change } ExpandProperty(propEnum, true); break; case "boolean": //Cast the Parameter propEnum = AppendProperty( catEnum, propertyID++, EarlabParam.PName, //Name of the Parameter EarlabParam, //Object reference "PValue", //String name of the Parameter Value, given via reflection EarlabParam.Message); //The comment, which will need to be updated. //Standard Way of showing the thing. propEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelList); if (EarlabParam.Severity == "Warning") { propEnum.Property.BackColor = Color.Firebrick; //<-- back ground color change propEnum.Property.ForeColor = Color.FloralWhite; //<-- text color change } ExpandProperty(propEnum, true); break; //The Arrays will have to be done differently =======================================================/// case "integer[]": case "int[]": //change, to the new system propEnum = AppendProperty( catEnum, propertyID++, EarlabParam.PName, //Name of the Parameter EarlabParam, //Object reference "PValue", //String name of the Parameter Value, given via reflection EarlabParam.Message); //The comment, which will need to be updated. //Standard Way of showing the thing. propEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelEdit); if (EarlabParam.Severity == "Warning") { propEnum.Property.BackColor = Color.Firebrick; //<-- back ground color change propEnum.Property.ForeColor = Color.FloralWhite; //<-- text color change } ExpandProperty(propEnum, true); break; case "double[]": case "float[]": case "dbl[]": case "fl[]": //Cast the Parameter propEnum = AppendProperty( catEnum, propertyID++, EarlabParam.PName, //Name of the Parameter EarlabParam, //Object reference "PValue", //String name of the Parameter Value, given via reflection EarlabParam.Message); //The comment, which will need to be updated. //Standard Way of showing the thing. propEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelEdit); if (EarlabParam.Severity == "Warning") { propEnum.Property.BackColor = Color.Firebrick; //<-- back ground color change propEnum.Property.ForeColor = Color.FloralWhite; //<-- text color change } ExpandProperty(propEnum, true); break; default: //Some error exception here (e) //Shouldn't really be needed. break; } } }
//internal void Initialize() //{ // BorderStyle = System.Windows.Forms.BorderStyle.None; // CommentsHeight = 70; // CommentsVisibility = true; // Dock = System.Windows.Forms.DockStyle.Fill; // Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World); // Location = new System.Drawing.Point(0, 0); // Margin = new System.Windows.Forms.Padding(2); //} internal void SetSelectedObject(GraphicNode graphicNode, ModelNode modelNode, State state) { Clear(); this.graphicNode = graphicNode; this.state = state; id = 0; itemGraphic = AppendRootCategory(id++, "Graphic"); //itemGraphicPath = AppendProperty(itemGraphic, id++, "Path", graphicNode, "Path", "", new System.ComponentModel.ReadOnlyAttribute(true)); itemGraphicBoungingRect = AppendProperty(itemGraphic, id++, "Bounding Rectangle", graphicNode, "BoundingRect", ""); //itemGraphicBoungingRectLeft = AppendProperty(itemGraphicBoungingRect, id++, "Left", graphicNode, "X", ""); //itemGraphicBoungingRectTop = AppendProperty(itemGraphicBoungingRect, id++, "Top", graphicNode, "Y", ""); //itemGraphicBoungingRectWidth = AppendProperty(itemGraphicBoungingRect, id++, "Width", graphicNode, "Width", ""); //itemGraphicBoungingRectHeight = AppendProperty(itemGraphicBoungingRect, id++, "Height", graphicNode, "Height", ""); ExpandProperty(itemGraphicBoungingRect, false); //itemGraphicAngle = AppendProperty(itemGraphic, id++, "Angle", graphicNode, "Angle", ""); AppendProperty(itemGraphic, id++, "Opacity", graphicNode, "Opacity", ""); itemGraphicShape = AppendProperty(itemGraphic, id++, "Stencil", graphicNode, "Stencil", ""); itemGraphicShape.Property.Feel = GetRegisteredFeel(PropertyGrid.FeelButton); itemGraphicTag = AppendSubCategory(itemGraphic, id++, "Tag"); itemGraphicTagBoungingRect = AppendProperty(itemGraphicTag, id++, "Bounding Rectangle", graphicNode, "TagArea", ""); //itemGraphicBoungingRectLeft = AppendProperty(itemGraphicTagBoungingRect, id++, "Left", graphicNode, "TagAreaX", ""); //itemGraphicBoungingRectTop = AppendProperty(itemGraphicTagBoungingRect, id++, "Top", graphicNode, "TagAreaY", ""); //itemGraphicBoungingRectWidth = AppendProperty(itemGraphicTagBoungingRect, id++, "Width", graphicNode, "TagAreaWidth", ""); //itemGraphicBoungingRectHeight = AppendProperty(itemGraphicTagBoungingRect, id++, "Height", graphicNode, "TagAreaHeight", ""); ExpandProperty(itemGraphicTagBoungingRect, false); //itemGraphicAngle = AppendProperty(itemGraphicTag, id++, "Angle", graphicNode, "TagAngle", ""); AppendProperty(itemGraphicTag, id++, "Visible", graphicNode, "TagVisible", ""); ExpandProperty(itemGraphicTag, false); itemGraphicFill = AppendSubCategory(itemGraphic, id++, "Fill"); //itemGraphicFillColor = AppendProperty(itemGraphicFill, id++, "Color", graphicNode, "FillColor", ""); //itemGraphicFillMode = AppendProperty(itemGraphicFill, id++, "Mode", graphicNode, "FillMode", ""); ExpandProperty(itemGraphicFill, false); itemGraphicMirror = AppendSubCategory(itemGraphic, id++, "Mirroring"); itemGraphicMirrorX = AppendProperty(itemGraphicMirror, id++, "X", graphicNode, "MirrorX", ""); itemGraphicMirrorX.Property.Feel = GetRegisteredFeel(FeelCheckbox); itemGraphicMirrorX.Property.Value.Look = new PropertyCheckboxLook(); itemGraphicMirrorY = AppendProperty(itemGraphicMirror, id++, "Y", graphicNode, "MirrorY", ""); itemGraphicMirrorY.Property.Feel = GetRegisteredFeel(FeelCheckbox); itemGraphicMirrorY.Property.Value.Look = new PropertyCheckboxLook(); ExpandProperty(itemGraphicMirror, false); itemModel = AppendRootCategory(id++, "Model"); //itemModelGuid = AppendProperty(itemModel, id++, "Guid", modelNode, "Guid", "", new System.ComponentModel.ReadOnlyAttribute(true)); //itemModelClass = AppendProperty(itemModel, id++, "Class", modelNode, "NodeClass", "", new System.ComponentModel.ReadOnlyAttribute(true)); //itemModelTag = AppendProperty(itemModel, id++, "Tag", modelNode, "Tag", ""); }
private void Initialize() { PropertyEnumerator curParamEnum; int propID = 1; if (mParamList == null) { return; } if (mParamList.Count == 0) { return; } Clear(); mParamsEnum = AppendRootCategory(propID++, "Parameters"); foreach (EarlabParameter param in mParamList) { Type t = param.GetType(); string TypeString; switch (t.Name) { case "EarlabOutputFile": case "EarlabInputFile": case "EarlabFloat": case "EarlabInteger": case "EarlabString": curParamEnum = AppendProperty(mParamsEnum, propID++, param.Name, param, "Value", ""); curParamEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelEdit); ExpandProperty(curParamEnum, true); break; case "EarlabBoolean": curParamEnum = AppendProperty(mParamsEnum, propID++, param.Name, param, "Value", ""); curParamEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelList); ExpandProperty(curParamEnum, true); break; case "EarlabIntArray": case "EarlabFloatArray": curParamEnum = AppendProperty(mParamsEnum, propID++, param.Name, param, "Value", ""); curParamEnum.Property.Feel = GetRegisteredFeel(VisualHint.SmartPropertyGrid.PropertyGrid.FeelEdit); break; default: curParamEnum = AppendManagedProperty(mParamsEnum, propID++, param.Name, typeof(string), "<unknown>", "Unknown parameter type!"); break; } if (param.IsDefault) { curParamEnum.Property.Font = new Font(curParamEnum.Property.Font, FontStyle.Regular); } else { curParamEnum.Property.Font = new Font(curParamEnum.Property.Font, FontStyle.Bold); } TypeString = t.Name.Remove(0, 6); if (param.IsError) { curParamEnum.Property.Comment = "Type: " + TypeString + "\r\nError: " + param.ErrorText + "\r\nDescription: " + param.Description; curParamEnum.Property.ForeColor = Color.Red; } else { curParamEnum.Property.Comment = "Type: " + TypeString + "\r\nDescription: " + param.Description; } } mInputsEnum = AppendRootCategory(propID++, "Inputs"); mOutputsEnum = AppendRootCategory(propID++, "Outputs"); }