コード例 #1
0
        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>");
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
        }
コード例 #5
0
        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
        }
コード例 #6
0
        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>");
        }
コード例 #7
0
ファイル: ClassWriter.cs プロジェクト: aws/aws-sdk-net
        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>");
        }
コード例 #8
0
 public PropertyWriter(GenerationManifest artifacts, FrameworkVersion version, PropertyInfoWrapper propertyInfo)
     : base(artifacts, version, propertyInfo)
 {
     this._propertyInfo = propertyInfo;
 }
コード例 #9
0
 public MultiSelectComboBox(PropertyInfoWrapper wrapper)
 {
     InitializeComponent();
     _nodeList = new ObservableCollection <Node>();
     Wrapper   = wrapper;
 }
コード例 #10
0
ファイル: ClassWriter.cs プロジェクト: rajdotnet/aws-sdk-net
        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>");
        }
コード例 #11
0
ファイル: PropertyWriter.cs プロジェクト: aws/aws-sdk-net
 public PropertyWriter(GenerationManifest artifacts, FrameworkVersion version, PropertyInfoWrapper propertyInfo)
     : base(artifacts, version, propertyInfo)
 {
     this._propertyInfo = propertyInfo;
 }