From 2415c4eedaa96532ffc7eb1c7e5d018106115bf4 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期五, 19 七月 2024 19:41:54 +0800 Subject: [PATCH] 导入流程开发 --- WinFrmUI/Yw.WinFrmUI.Core/07-sorter/PropertySorter.cs | 52 ++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 42 insertions(+), 10 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-ViewModel/PropertySorter.cs b/WinFrmUI/Yw.WinFrmUI.Core/07-sorter/PropertySorter.cs similarity index 84% rename from WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-ViewModel/PropertySorter.cs rename to WinFrmUI/Yw.WinFrmUI.Core/07-sorter/PropertySorter.cs index 9e56d01..8c2649f 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-ViewModel/PropertySorter.cs +++ b/WinFrmUI/Yw.WinFrmUI.Core/07-sorter/PropertySorter.cs @@ -1,18 +1,31 @@ 锘縰sing System; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Text; -namespace HStation.WinFrmUI.Core +namespace Yw.WinFrmUI { + /// <summary> + /// 灞炴�ф帓搴� + /// </summary> public class PropertySorter : ExpandableObjectConverter { #region Methods + /// <summary> + /// + /// </summary> public override bool GetPropertiesSupported(ITypeDescriptorContext context) { return true; } + /// <summary> + /// + /// </summary> public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { // @@ -44,6 +57,8 @@ // implementation of IComparable to sort // orderedProperties.Sort(); + + // // Build a string list of the ordered names // @@ -57,12 +72,13 @@ // return pdc.Sort((string[])propertyNames.ToArray(typeof(string))); } - - #endregion Methods + #endregion } #region Helper Class - PropertyOrderAttribute - + /// <summary> + /// + /// </summary> [AttributeUsage(AttributeTargets.Property)] public class PropertyOrderAttribute : Attribute { @@ -70,12 +86,14 @@ // Simple attribute to allow the order of a property to be specified // private int _order; - public PropertyOrderAttribute(int order) { _order = order; } + /// <summary> + /// + /// </summary> public int Order { get @@ -84,16 +102,21 @@ } } } - - #endregion Helper Class - PropertyOrderAttribute + #endregion #region Helper Class - PropertyOrderPair + /// <summary> + /// + /// </summary> public class PropertyOrderPair : IComparable { private int _order; - private string _name; + + /// <summary> + /// + /// </summary> public string Name { get @@ -101,13 +124,20 @@ return _name; } } + private string _name; + /// <summary> + /// + /// </summary> public PropertyOrderPair(string name, int order) { _order = order; _name = name; } + /// <summary> + /// + /// </summary> public int CompareTo(object obj) { // @@ -130,6 +160,8 @@ return 1; } } + #endregion - #endregion Helper Class - PropertyOrderPair -} \ No newline at end of file + + +} -- Gitblit v1.9.3