void AddProperty(TextWriter writer, PropertyInfoWrapper propertyInfo) { writer.WriteLine("<tr>"); writer.WriteLine("<td>"); writer.WriteLine("<img class=\"publicProperty\" src=\"{0}/resources/blank.gif\" title=\"Public Property\" alt=\"Public Property\"/>", RootRelativePath); if (propertyInfo.IsStatic) { writer.WriteLine("<img class=\"static\" src=\"{0}/resources/blank.gif\" title=\"Static Property\" alt=\"Static Property\"/>", RootRelativePath); } writer.WriteLine("</td>"); writer.WriteLine("<td>"); writer.WriteLine(propertyInfo.Name); writer.WriteLine("</td>"); writer.WriteLine("<td>"); writer.Write(ConstructTypeInfoLinkContent(propertyInfo.PropertyType)); writer.WriteLine("</td>"); writer.WriteLine("<td>"); var docs = NDocUtilities.FindDocumentation(this._currentNDoc, propertyInfo); var html = NDocUtilities.TransformDocumentationToHTML(docs, "summary", Artifacts.AssemblyWrapper, this._version); writer.WriteLine(html); writer.WriteLine("</td>"); writer.WriteLine("</tr>"); }
public string GenerateSyntax(PropertyInfoWrapper info) { var syntax = new SyntaxWriter(this._version); if (info.IsPublic) { syntax.WriteToken("public"); } syntax.WriteTypeName(info.PropertyType); string methods = null; var getMethod = info.GetGetMethod(); var setMethod = info.GetSetMethod(); if (getMethod != null && getMethod.IsPublic && setMethod != null && setMethod.IsPublic) { methods = "get; set;"; } else if (getMethod != null && getMethod.IsPublic) { methods = "get;"; } else if (setMethod != null && setMethod.IsPublic) { methods = "set;"; } syntax.WriteRaw(string.Format(" {0} {{", info.Name)); syntax.WriteToken(methods); syntax.WriteRaw(" }"); return(syntax.CurrentSyntax); }
public CommonValueSetting(PropertyInfoWrapper wrapper) { InitializeComponent(); MainPanel.DataContext = this; Wrapper = wrapper; Binding binding = new Binding(); binding.Source = Wrapper; binding.Path = new PropertyPath("ProxyValue"); binding.Mode = BindingMode.TwoWay; binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; binding.Converter = new AutoValueConverter(); binding.ConverterParameter = Wrapper; Input.Text = Wrapper.ProxyValue?.ToString() ?? string.Empty; Input.SetBinding(TextBox.TextProperty, binding); if (wrapper.PropertyInfo.GetCustomAttribute <DescriptionAttribute>() is DescriptionAttribute description) { NameBlock.ToolTip = description.Description; } NameBlock.Text = wrapper.DisplayPropertyName; }
public string GenerateSyntax(PropertyInfoWrapper info) { var syntax = new SyntaxWriter(this._version); if (info.IsPublic) syntax.WriteToken("public"); syntax.WriteTypeName(info.PropertyType); string methods = null; var getMethod = info.GetGetMethod(); var setMethod = info.GetSetMethod(); if (getMethod != null && getMethod.IsPublic && setMethod != null && setMethod.IsPublic) methods = "get; set;"; else if (getMethod != null && getMethod.IsPublic) methods = "get;"; else if (setMethod != null && setMethod.IsPublic) methods = "set;"; syntax.WriteRaw(string.Format(" {0} {{", info.Name)); syntax.WriteToken(methods); syntax.WriteRaw(" }"); return syntax.CurrentSyntax; }
public RangeValueSetting(PropertyInfoWrapper wrapper) { if (!(wrapper.PropertyInfo.GetCustomAttribute <RangeAttribute>() is RangeAttribute range)) { throw new Exception("RangeValueSetting钦定设置属性必须有[Range]特性标识"); } InitializeComponent(); ValueRangeSlider.Value = double.Parse(wrapper.ProxyValue.ToString()); ValueRangeSlider.Minimum = double.Parse(range.Min); ValueRangeSlider.Maximum = double.Parse(range.Max); //确保slider的value和设置钦定的值一样 if (!(wrapper.PropertyInfo.PropertyType.Name == "Single" || wrapper.PropertyInfo.PropertyType.Name == "Double")) { ValueRangeSlider.IsSnapToTickEnabled = true; ValueRangeSlider.TickFrequency = 1; } if (wrapper.PropertyInfo.GetCustomAttribute <Settings.UIAttributes.DescriptionAttribute>() is Settings.UIAttributes.DescriptionAttribute description) { NameBlock.ToolTip = description.Description; } NameBlock.Text = wrapper.DisplayPropertyName; Wrapper = wrapper; #region Binding Chain Binding T2SBinding = new Binding(); T2SBinding.Mode = BindingMode.TwoWay; T2SBinding.Source = ValueRangeSlider; T2SBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; T2SBinding.Path = new PropertyPath("Value"); Input.SetBinding(TextBox.TextProperty, T2SBinding); Binding T2PBinding = new Binding(); T2PBinding.Mode = BindingMode.TwoWay; T2PBinding.Source = ValueRangeSlider; T2PBinding.Path = new PropertyPath("Value"); SetBinding(ProxyValueProperty, T2PBinding); #endregion }
void AddProperty(TextWriter writer, PropertyInfoWrapper propertyInfo) { writer.WriteLine("<tr>"); writer.WriteLine("<td>"); writer.WriteLine("<img class=\"publicProperty\" src=\"{0}/resources/blank.gif\" title=\"Public Property\" alt=\"Public Property\"/>", RootRelativePath); if (propertyInfo.IsStatic) { writer.WriteLine("<img class=\"static\" src=\"{0}/resources/blank.gif\" title=\"Static Property\" alt=\"Static Property\"/>", RootRelativePath); } writer.WriteLine("</td>"); writer.WriteLine("<td>"); writer.WriteLine(propertyInfo.Name); writer.WriteLine("</td>"); writer.WriteLine("<td>"); writer.Write(ConstructTypeInfoLinkContent(propertyInfo.PropertyType)); writer.WriteLine("</td>"); writer.WriteLine("<td>"); string html = string.Empty; var isInherited = !propertyInfo.DeclaringType.Equals(_versionType); if (isInherited) { html = string.Format("Inherited from {0}.{1}.", propertyInfo.DeclaringType.Namespace, propertyInfo.DeclaringType.Name); } else { var docs = NDocUtilities.FindDocumentation(propertyInfo); html = NDocUtilities.TransformDocumentationToHTML(docs, "summary", Artifacts.AssemblyWrapper, this._version); } writer.WriteLine(html); writer.WriteLine("</td>"); writer.WriteLine("</tr>"); }
void AddProperty(TextWriter writer, PropertyInfoWrapper propertyInfo) { writer.WriteLine("<tr>"); writer.WriteLine("<td>"); writer.WriteLine("<img class=\"publicProperty\" src=\"{0}/resources/blank.gif\" title=\"Public Property\" alt=\"Public Property\"/>", RootRelativePath); if (propertyInfo.IsStatic) writer.WriteLine("<img class=\"static\" src=\"{0}/resources/blank.gif\" title=\"Static Property\" alt=\"Static Property\"/>", RootRelativePath); writer.WriteLine("</td>"); writer.WriteLine("<td>"); writer.WriteLine(propertyInfo.Name); writer.WriteLine("</td>"); writer.WriteLine("<td>"); writer.Write(ConstructTypeInfoLinkContent(propertyInfo.PropertyType)); writer.WriteLine("</td>"); writer.WriteLine("<td>"); string html = string.Empty; if (_versionType.Namespace != propertyInfo.DeclaringType.Namespace) { html = string.Format("Inherited from {0}.{1}.", propertyInfo.DeclaringType.Namespace, propertyInfo.DeclaringType.Name); } else { var docs = NDocUtilities.FindDocumentation(propertyInfo); html = NDocUtilities.TransformDocumentationToHTML(docs, "summary", Artifacts.AssemblyWrapper, this._version); } writer.WriteLine(html); writer.WriteLine("</td>"); writer.WriteLine("</tr>"); }
public PropertyWriter(GenerationManifest artifacts, FrameworkVersion version, PropertyInfoWrapper propertyInfo) : base(artifacts, version, propertyInfo) { this._propertyInfo = propertyInfo; }
public MultiSelectComboBox(PropertyInfoWrapper wrapper) { InitializeComponent(); _nodeList = new ObservableCollection <Node>(); Wrapper = wrapper; }
void AddProperty(TextWriter writer, PropertyInfoWrapper propertyInfo) { writer.WriteLine("<tr>"); writer.WriteLine("<td>"); writer.WriteLine("<img class=\"publicProperty\" src=\"{0}/resources/blank.gif\" title=\"Public Property\" alt=\"Public Property\"/>", RootRelativePath); if (propertyInfo.IsStatic) writer.WriteLine("<img class=\"static\" src=\"{0}/resources/blank.gif\" title=\"Static Property\" alt=\"Static Property\"/>", RootRelativePath); writer.WriteLine("</td>"); writer.WriteLine("<td>"); writer.WriteLine(propertyInfo.Name); writer.WriteLine("</td>"); writer.WriteLine("<td>"); writer.Write(ConstructTypeInfoLinkContent(propertyInfo.PropertyType)); writer.WriteLine("</td>"); writer.WriteLine("<td>"); var docs = NDocUtilities.FindDocumentation(this._currentNDoc, propertyInfo); var html = NDocUtilities.TransformDocumentationToHTML(docs, "summary", Artifacts.AssemblyWrapper, this._version); writer.WriteLine(html); writer.WriteLine("</td>"); writer.WriteLine("</tr>"); }