开发中灵活使用属性类

什么是属性类?

        从抽象类System.Attribute派生出来的类(无论是直接的还是间接的)都称为属性类(MSDN中的定义)。



        属性类的名称一般都带有Attribute后缀,但使用的时候可以包含也可以忽略,如果你自己起的名字没有这个后缀,则需要全称来区分了。如果不怕输入麻烦,建议还是不管是否有后缀,都输入全称为好,这样可以减少歧义。

 

        在.NET框架中差不多定义了200个Attribute相关类,可见Attribute的应用十分广泛,它的全图在MSDN中如下:

开发中灵活使用属性类[转]System.Object
开发中灵活使用属性类[转]   System.Attribute
开发中灵活使用属性类[转]      System.AttributeUsageAttribute
开发中灵活使用属性类[转]      System.CLSCompliantAttribute
开发中灵活使用属性类[转]      System.ComponentModel.AmbientValueAttribute
开发中灵活使用属性类[转]      System.ComponentModel.BindableAttribute
开发中灵活使用属性类[转]      System.ComponentModel.BrowsableAttribute
开发中灵活使用属性类[转]      System.ComponentModel.CategoryAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DefaultEventAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DefaultPropertyAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DefaultValueAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DescriptionAttribute
开发中灵活使用属性类[转]      System.ComponentModel.Design.Serialization.DesignerSerializerAttribute
开发中灵活使用属性类[转]      System.ComponentModel.Design.Serialization.RootDesignerSerializerAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DesignerAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DesignerCategoryAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DesignerSerializationVisibilityAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DesignOnlyAttribute
开发中灵活使用属性类[转]      System.ComponentModel.DesignTimeVisibleAttribute
开发中灵活使用属性类[转]      System.ComponentModel.EditorAttribute
开发中灵活使用属性类[转]      System.ComponentModel.EditorBrowsableAttribute
开发中灵活使用属性类[转]      System.ComponentModel.ImmutableObjectAttribute
开发中灵活使用属性类[转]      System.ComponentModel.InheritanceAttribute
开发中灵活使用属性类[转]      System.ComponentModel.InstallerTypeAttribute
开发中灵活使用属性类[转]      System.ComponentModel.LicenseProviderAttribute
开发中灵活使用属性类[转]      System.ComponentModel.ListBindableAttribute
开发中灵活使用属性类[转]      System.ComponentModel.LocalizableAttribute
开发中灵活使用属性类[转]      System.ComponentModel.MergablePropertyAttribute
开发中灵活使用属性类[转]      System.ComponentModel.NotifyParentPropertyAttribute
开发中灵活使用属性类[转]      System.ComponentModel.ParenthesizePropertyNameAttribute
开发中灵活使用属性类[转]      System.ComponentModel.PropertyTabAttribute
开发中灵活使用属性类[转]      System.ComponentModel.ProvidePropertyAttribute
开发中灵活使用属性类[转]      System.ComponentModel.ReadOnlyAttribute
开发中灵活使用属性类[转]      System.ComponentModel.RecommendedAsConfigurableAttribute
开发中灵活使用属性类[转]      System.ComponentModel.RefreshPropertiesAttribute
开发中灵活使用属性类[转]      System.ComponentModel.RunInstallerAttribute
开发中灵活使用属性类[转]      System.ComponentModel.ToolboxItemAttribute
开发中灵活使用属性类[转]      System.ComponentModel.ToolboxItemFilterAttribute
开发中灵活使用属性类[转]      System.ComponentModel.TypeConverterAttribute
开发中灵活使用属性类[转]      System.ContextStaticAttribute
开发中灵活使用属性类[转]      System.Diagnostics.ConditionalAttribute
开发中灵活使用属性类[转]      System.Diagnostics.DebuggableAttribute
开发中灵活使用属性类[转]      System.Diagnostics.DebuggerHiddenAttribute
开发中灵活使用属性类[转]      System.Diagnostics.DebuggerStepThroughAttribute
开发中灵活使用属性类[转]      System.Drawing.ToolboxBitmapAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ApplicationAccessControlAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ApplicationActivationAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ApplicationIDAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ApplicationNameAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ApplicationQueuingAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.AutoCompleteAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.CompensatingResourceManager.ApplicationCrmEnabledAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ComponentAccessControlAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.COMTIIntrinsicsAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ConstructionEnabledAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.DescriptionAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.EventClassAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.EventTrackingEnabledAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ExceptionClassAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.IISIntrinsicsAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.InterfaceQueuingAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.JustInTimeActivationAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.LoadBalancingSupportedAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.MustRunInClientContextAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.ObjectPoolingAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.PrivateComponentAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.SecureMethodAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.SecurityRoleAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.SynchronizationAttribute
开发中灵活使用属性类[转]      System.EnterpriseServices.TransactionAttribute
开发中灵活使用属性类[转]      System.FlagsAttribute
开发中灵活使用属性类[转]      System.LoaderOptimizationAttribute
开发中灵活使用属性类[转]      System.Management.Instrumentation.IgnoreMemberAttribute
开发中灵活使用属性类[转]      System.Management.Instrumentation.InstrumentationClassAttribute
开发中灵活使用属性类[转]      System.Management.Instrumentation.InstrumentedAttribute
开发中灵活使用属性类[转]      System.Management.Instrumentation.ManagedNameAttribute
开发中灵活使用属性类[转]      System.MTAThreadAttribute
开发中灵活使用属性类[转]      System.NonSerializedAttribute
开发中灵活使用属性类[转]      System.ObsoleteAttribute
开发中灵活使用属性类[转]      System.ParamArrayAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyAlgorithmIdAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyCompanyAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyConfigurationAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyCopyrightAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyCultureAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyDefaultAliasAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyDelaySignAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyDescriptionAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyFileVersionAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyFlagsAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyInformationalVersionAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyKeyFileAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyKeyNameAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyProductAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyTitleAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyTrademarkAttribute
开发中灵活使用属性类[转]      System.Reflection.AssemblyVersionAttribute
开发中灵活使用属性类[转]      System.Reflection.DefaultMemberAttribute
开发中灵活使用属性类[转]      System.Resources.NeutralResourcesLanguageAttribute
开发中灵活使用属性类[转]      System.Resources.SatelliteContractVersionAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.CompilationRelaxationsAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.CustomConstantAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.DecimalConstantAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.DiscardableAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.IndexerNameAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.MethodImplAttribute
开发中灵活使用属性类[转]      System.Runtime.CompilerServices.RequiredAttributeAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.AutomationProxyAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.BestFitMappingAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ClassInterfaceAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.CoClassAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComAliasNameAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComCompatibleVersionAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComConversionLossAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComEventInterfaceAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComImportAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComRegisterFunctionAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComSourceInterfacesAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComUnregisterFunctionAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ComVisibleAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.DispIdAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.DllImportAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.FieldOffsetAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.GuidAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.IDispatchImplAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ImportedFromTypeLibAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.InAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.InterfaceTypeAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.LCIDConversionAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.MarshalAsAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.OptionalAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.OutAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.PreserveSigAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.ProgIdAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.StructLayoutAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.TypeLibFuncAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.TypeLibTypeAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.TypeLibVarAttribute
开发中灵活使用属性类[转]      System.Runtime.InteropServices.TypeLibVersionAttribute
开发中灵活使用属性类[转]      System.Runtime.Remoting.Messaging.OneWayAttribute
开发中灵活使用属性类[转]      System.Runtime.Remoting.Metadata.SoapAttribute
开发中灵活使用属性类[转]      System.Runtime.Remoting.Proxies.ProxyAttribute
开发中灵活使用属性类[转]      System.Security.AllowPartiallyTrustedCallersAttribute
开发中灵活使用属性类[转]      System.Security.Permissions.SecurityAttribute
开发中灵活使用属性类[转]      System.Security.SuppressUnmanagedCodeSecurityAttribute
开发中灵活使用属性类[转]      System.Security.UnverifiableCodeAttribute
开发中灵活使用属性类[转]      System.SerializableAttribute
开发中灵活使用属性类[转]      System.STAThreadAttribute
开发中灵活使用属性类[转]      System.ThreadStaticAttribute
开发中灵活使用属性类[转]      System.Web.Services.Configuration.XmlFormatExtensionAttribute
开发中灵活使用属性类[转]      System.Web.Services.Configuration.XmlFormatExtensionPointAttribute
开发中灵活使用属性类[转]      System.Web.Services.Configuration.XmlFormatExtensionPrefixAttribute
开发中灵活使用属性类[转]      System.Web.Services.Protocols.HttpMethodAttribute
开发中灵活使用属性类[转]      System.Web.Services.Protocols.MatchAttribute
开发中灵活使用属性类[转]      System.Web.Services.Protocols.SoapDocumentMethodAttribute
开发中灵活使用属性类[转]      System.Web.Services.Protocols.SoapDocumentServiceAttribute
开发中灵活使用属性类[转]      System.Web.Services.Protocols.SoapExtensionAttribute
开发中灵活使用属性类[转]      System.Web.Services.Protocols.SoapHeaderAttribute
开发中灵活使用属性类[转]      System.Web.Services.Protocols.SoapRpcMethodAttribute
开发中灵活使用属性类[转]      System.Web.Services.Protocols.SoapRpcServiceAttribute
开发中灵活使用属性类[转]      System.Web.Services.WebMethodAttribute
开发中灵活使用属性类[转]      System.Web.Services.WebServiceAttribute
开发中灵活使用属性类[转]      System.Web.Services.WebServiceBindingAttribute
开发中灵活使用属性类[转]      System.Web.UI.ConstructorNeedsTagAttribute
开发中灵活使用属性类[转]      System.Web.UI.ControlBuilderAttribute
开发中灵活使用属性类[转]      System.Web.UI.DataBindingHandlerAttribute
开发中灵活使用属性类[转]      System.Web.UI.ParseChildrenAttribute
开发中灵活使用属性类[转]      System.Web.UI.PartialCachingAttribute
开发中灵活使用属性类[转]      System.Web.UI.PersistChildrenAttribute
开发中灵活使用属性类[转]      System.Web.UI.PersistenceModeAttribute
开发中灵活使用属性类[转]      System.Web.UI.TagPrefixAttribute
开发中灵活使用属性类[转]      System.Web.UI.TemplateContainerAttribute
开发中灵活使用属性类[转]      System.Web.UI.ToolboxDataAttribute
开发中灵活使用属性类[转]      System.Web.UI.ValidationPropertyAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.SoapAttributeAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.SoapElementAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.SoapEnumAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.SoapIgnoreAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.SoapIncludeAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.SoapTypeAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlAnyAttributeAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlAnyElementAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlArrayAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlArrayItemAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlAttributeAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlChoiceIdentifierAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlElementAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlEnumAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlIgnoreAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlIncludeAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlNamespaceDeclarationsAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlRootAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlTextAttribute
开发中灵活使用属性类[转]      System.Xml.Serialization.XmlTypeAttribute

System.STAThreadAttribute
       大家在一般使用中会留意到这个属性吗?用VS.NET新建一个项目,往往在main前面会如下面所示:
        }

       其实这个就是属性类STAThreadAttribute了,它的作用表示应用程序的COM线程模型是单线程单元(STA)。


属性类的实用性:

 

1.利用XML相关的属性类,将相关业务类XML序列化,可以达到保存状态和远程传输交换类信息等作用。
共14个和XML相关的属性类:
System.Xml.Serialization.XmlAnyAttributeAttribute
System.Xml.Serialization.XmlAnyElementAttribute
System.Xml.Serialization.XmlArrayAttribute
System.Xml.Serialization.XmlArrayItemAttribute
System.Xml.Serialization.XmlAttributeAttribute
System.Xml.Serialization.XmlChoiceIdentifierAttribute
System.Xml.Serialization.XmlElementAttribute
System.Xml.Serialization.XmlEnumAttribute
System.Xml.Serialization.XmlIgnoreAttribute
System.Xml.Serialization.XmlIncludeAttribute
System.Xml.Serialization.XmlNamespaceDeclarationsAttribute
System.Xml.Serialization.XmlRootAttribute
System.Xml.Serialization.XmlTextAttribute
System.Xml.Serialization.XmlTypeAttribute

        最近做一个项目,需要将一些界面输入的有一定结构规律的信息保存起来,然后下次需要时候可以调入到对应的界面位置上使用。(其实这个是很多应用都会碰到的)。结构和UI的对应关系可能会经常变动的,而且结构中需要填写的内容不是所有都必须的,直接用关系型数据库来保存似乎不是太好的方案。首先想到就是用XML文件来保存这些信息了,而界面之间的信息显示是有关联的,可以说需要一个缓冲来记录这些信息,想到的就是定义一个类来记录和操作这些信息。这自然遇到一个问题,如何保持类和XML数据的同步呢?

        生成的XML文件需要给其它业务来做处理,格式上有一定的规范,对于类来说,信息都保存在字段或者属性那里的,并没有区别,但XML中可能有些信息是Attribute,有些又是Element的。如何灵活地处理这些关系呢?用与XML相关的属性来定义这些字段和类就可以了。

(1) 类信息序列化到XML文件中的代码

开发中灵活使用属性类[转]        public void SerializeObject(string filename)
(2) XML文件信息变成类的信息的代码
开发中灵活使用属性类[转]        public void DeserializeObject(string filename)
        }
(3)例子中相关类信息生成的XML文件
开发中灵活使用属性类[转]<?xml version="1.0" encoding="utf-8"?>
开发中灵活使用属性类[转]
<Tables xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
开发中灵活使用属性类[转]  
<Member>
开发中灵活使用属性类[转]    
<Employee AHead="false">
开发中灵活使用属性类[转]      
<Name>Jack</Name>
开发中灵活使用属性类[转]      
<Age>0</Age>
开发中灵活使用属性类[转]      
<Age>0</Age>
开发中灵活使用属性类[转]      
<des2>Yyyy开发中灵活使用属性类[转]</des2>
开发中灵活使用属性类[转]      
<ColumnType LinkField="Haaa开发中灵活使用属性类[转]" />
开发中灵活使用属性类[转]      
<ColumnType LinkType="Zzzz开发中灵活使用属性类[转]" />
开发中灵活使用属性类[转]    
</Employee>
开发中灵活使用属性类[转]    
<Employee Desc="OK" AHead="false">
开发中灵活使用属性类[转]      
<Name>Jill</Name>
开发中灵活使用属性类[转]      
<Age>20</Age>
开发中灵活使用属性类[转]      
<Age>40</Age>
开发中灵活使用属性类[转]    
</Employee>
开发中灵活使用属性类[转]  
</Member>
开发中灵活使用属性类[转]  
<Building>10.088999748229981</Building>
开发中灵活使用属性类[转]  
<HexBytes>64</HexBytes>
开发中灵活使用属性类[转]  
<IsActive>false</IsActive>
开发中灵活使用属性类[转]  
<Manager Desc="Yes" AHead="true">
开发中灵活使用属性类[转]    
<Name>Sara</Name>
开发中灵活使用属性类[转]    
<Age>0</Age>
开发中灵活使用属性类[转]    
<Age>0</Age>
开发中灵活使用属性类[转]    
<Level>4</Level>
开发中灵活使用属性类[转]  
</Manager>
开发中灵活使用属性类[转]  
<ObjectNumber>42</ObjectNumber>
开发中灵活使用属性类[转]  
<ObjectString>Answer</ObjectString>
开发中灵活使用属性类[转]
</Tables>
(4) XML总体框架如何用XML相关属性类描述
开发中灵活使用属性类[转]    public class Tables
(5) 类的字段信息表示为属性的方法
开发中灵活使用属性类[转]    public class Employee


2.自己根据需要定义自己的属性类,例如定义相关业务类和UI的关系。
在使用中,信息不是一个UI就完成的,可能经过了几个UI,或者几个页面去交互,但可能业务的调整,显示的位置或者一些参数可能需要调整的,这些UI的信息能否也定义为类的某些属性?
从.NET的Attribute派生一个客户定制类可以轻松做到这点,定制类只需要从System.Attribute派生即可。

开发中灵活使用属性类[转]    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Class,AllowMultiple=true)]
开发中灵活使用属性类[转]    
public class LayoutAttribute : Attribute

       AttributeUsage这个类定义了LayoutAttribute的一些基本信息,例如这里定义了LayoutAttribute适用于字段,类,并且允许重复定义的。

       在应用中,可以利用反射机制,将这些定义的信息获取,从而判断应该在界面上如何处理了。

开发中灵活使用属性类[转]            Type myType = Type.GetType("testXmlAttr.Manager");
开发中灵活使用属性类[转]            Console.WriteLine(myType.FullName);
开发中灵活使用属性类[转]            FieldInfo myFieldInfo 
= myType.GetField("Level");
开发中灵活使用属性类[转]            
开发中灵活使用属性类[转]            
object[] atts = myFieldInfo.GetCustomAttributes(false);            
开发中灵活使用属性类[转]            
for (int i=0;i<atts.Length;i++)
开发中灵活使用属性类[转]                Console.WriteLine(((LayoutAttribute)atts[i]).OwnPage);
开发中灵活使用属性类[转]

例子运行结果:(同时在当前目录下生成testXmlAttr.xml)
开发中灵活使用属性类[转]

例子代码

相关文章:

  • 2019-08-01
  • 2021-06-26
  • 2021-08-28
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-08-17
  • 2022-02-25
猜你喜欢
  • 2021-11-11
  • 2022-03-03
  • 2021-09-19
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案