• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MetadataType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MetadataType的典型用法代码示例。如果您正苦于以下问题:C# MetadataType类的具体用法?C# MetadataType怎么用?C# MetadataType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MetadataType类属于命名空间,在下文中一共展示了MetadataType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetMetadata

        public override IEnumerable<string> GetMetadata(MetadataType type)
        {
            if (parsedFile.Metadata.ContainsKey(type))
                return parsedFile.Metadata[type];

            return null;
        }
开发者ID:sashaMilka,项目名称:MultiReader,代码行数:7,代码来源:PlainTextParser.cs


示例2: PeerEventArgs

        /// <summary>
        /// PeerEventArgs Constructor
        /// </summary>
        /// <param name="parsed">a simple MessageParse</param>
        internal PeerEventArgs(dynamic parsed)
        {
#if DEBUG
            FCP2Protocol.ArgsDebug(this, parsed);
#endif

            lastGoodVersion = parsed.lastGoodVersion;
            opennet = parsed.opennet;
            myName = parsed.myName;
            identity = parsed.identity;
            location = parsed.location;
            testnet = parsed.testnet;
            version = parsed.version;
            physical = new PhysicalType(parsed);
            ark = new ArkType(parsed);
            dsaPubKey = new DsaPubKeyType(parsed);
            dsaGroup = new DsaGroupType(parsed);
            auth = new AuthType(parsed);
            @volatile = new VolatileType(parsed);
            metadata = new MetadataType(parsed);

#if DEBUG
            parsed.PrintAccessCount();
#endif
        }
开发者ID:vincentmele,项目名称:fcp2lib.NET,代码行数:29,代码来源:PeerEventArgs.cs


示例3: MetadataCheckBox

 public MetadataCheckBox(MetadataType metadataType, string displayText, string count, string ignoredCount)
     : this(metadataType, displayText, count)
 {
     lblIgnoredFields.Text = "( Excluded " + ignoredCount + " fields )";
     lblIgnoredFields.Visible = true;
     MetadataType = metadataType;
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:MetadataCheckBox.cs


示例4: MetadataGenerationError

 public MetadataGenerationError(MetadataType metadataType, Type type, string errorReason, string sugestionedSolution)
 {
     MetadataType = metadataType;
     Type = type;
     ErrorReason = errorReason;
     SuggestedSolution = sugestionedSolution;
 }
开发者ID:mrdavidlaing,项目名称:webservice-schema,代码行数:7,代码来源:MetadataGenerationError.cs


示例5: GetTableName

 public static void GetTableName(MetadataType type, out string tableName, out string keyFieldName)
 {
     tableName = string.Empty;
     keyFieldName = "Id";
     switch (type)
     {
         case MetadataType.QuotationSource:
             tableName = "QuotationSource";
             break;
         case MetadataType.Instrument:
             tableName = "Instrument";
             break;
         case MetadataType.InstrumentSourceRelation:
             tableName = "InstrumentSourceRelation";
             break;
         case MetadataType.DerivativeRelation:
             tableName = "DerivativeRelation";
             keyFieldName = "InstrumentId";
             break;
         case MetadataType.PriceRangeCheckRule:
             tableName = "PriceRangeCheckRule";
             keyFieldName = "InstrumentId";
             break;
         case MetadataType.WeightedPriceRule:
             tableName = "WeightedPriceRule";
             keyFieldName = "InstrumentId";
             break;
     }
 }
开发者ID:BlueSky007,项目名称:ExchangeManager,代码行数:29,代码来源:Helper.cs


示例6: PeerEventArgs

        /// <summary>
        /// PeerEventArgs Constructor
        /// </summary>
        /// <param name="parsed">a simple MessageParse</param>
        internal PeerEventArgs(dynamic parsed)
        {
#if DEBUG
            FCP2Protocol.ArgsDebug(this, parsed);
#endif

            LastGoodVersion = parsed.lastGoodVersion;
            Opennet = parsed.opennet;
            MyName = parsed.myName;
            Identity = parsed.identity;
            Location = parsed.location;
            Testnet = parsed.testnet;
            Version = parsed.version;
            Physical = new PhysicalType(parsed);
            Ark = new ArkType(parsed);
            DsaPubKey = new DsaPubKeyType(parsed);
            DsaGroup = new DsaGroupType(parsed);
            Auth = new AuthType(parsed);
            Volatile = new VolatileType(parsed);
            Metadata = new MetadataType(parsed);

#if DEBUG
            parsed.PrintAccessCount();
#endif
        }
开发者ID:FreeApophis,项目名称:fcp2lib.NET,代码行数:29,代码来源:PeerEventArgs.cs


示例7: IsSupportedRiskElements

        public static  bool IsSupportedRiskElements(FileType fileType, MetadataType metadatatype)
        {
            if (metadatatype == MetadataType.Hyperlink && OptionApi.GetBool(SharedRibbon.Library.Options.ExcludeFieldCodesHyperlinks))
                return false;

            if (IsExcel(fileType))
            {
                switch (metadatatype)
                {
                    case MetadataType.SmallText:
                    case MetadataType.WhiteText:
                    case MetadataType.HiddenText:
                        return false;
                    default:
                        return true;
                }
            }

            if (IsWord(fileType))
            {
                switch (metadatatype)
                {
                    case MetadataType.Hyperlink:
                    {
                        return false;
                    }
                }
            }

            return true;
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:31,代码来源:FileTypeHelper.cs


示例8: MetadataPropertyInfo

		internal MetadataPropertyInfo (IMetadataImport importer, int propertyToken, MetadataType declaringType)
		{
			m_importer = importer;
			m_propertyToken = propertyToken;
			m_declaringType = declaringType;

			int mdTypeDef;
			int pchProperty;
			int pdwPropFlags;
			IntPtr ppvSig;
			int pbSig;
			int pdwCPlusTypeFlag;
			IntPtr ppDefaultValue;
			int pcchDefaultValue;
			int rmdOtherMethod;
			int pcOtherMethod;

			m_importer.GetPropertyProps (
				m_propertyToken,
				out mdTypeDef,
				null,
				0,
				out pchProperty,
				out pdwPropFlags,
				out ppvSig,
				out pbSig,
				out pdwCPlusTypeFlag,
				out ppDefaultValue,
				out pcchDefaultValue,
				out m_pmdSetter,
				out m_pmdGetter,
				out rmdOtherMethod,
				0,
				out pcOtherMethod);

			StringBuilder szProperty = new StringBuilder (pchProperty);
			m_importer.GetPropertyProps (
				m_propertyToken,
				out mdTypeDef,
				szProperty,
				pchProperty,
				out pchProperty,
				out pdwPropFlags,
				out ppvSig,
				out pbSig,
				out pdwCPlusTypeFlag,
				out ppDefaultValue,
				out pcchDefaultValue,
				out m_pmdSetter,
				out m_pmdGetter,
				out rmdOtherMethod,
				0,
				out pcOtherMethod);

			m_propAttributes = (PropertyAttributes) pdwPropFlags;
			m_name = szProperty.ToString ();
			MetadataHelperFunctions.GetCustomAttribute (importer, propertyToken, typeof (System.Diagnostics.DebuggerBrowsableAttribute));
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:58,代码来源:MetadataPropertyInfo.cs


示例9: GetParamType

        public static string GetParamType(this MetadataPropertyType prop, MetadataType type, Operation op)
        {
            if (prop.ParamType != null)
                return prop.ParamType;

            var isRequest = type.Name == op.RequestType.Name;

            return !isRequest ? "form" : GetRequestParamType(op, prop.Name);
        }
开发者ID:CLupica,项目名称:ServiceStack,代码行数:9,代码来源:ServiceMetadata.cs


示例10: ParseDefaultValue

        private static object ParseDefaultValue(MetadataType declaringType, IntPtr ppvSigBlob, IntPtr ppvRawValue)
        {
                IntPtr ppvSigTemp = ppvSigBlob;
                CorCallingConvention callingConv = MetadataHelperFunctions.CorSigUncompressCallingConv(ref ppvSigTemp);
                Debug.Assert(callingConv == CorCallingConvention.Field);

                CorElementType elementType = MetadataHelperFunctions.CorSigUncompressElementType(ref ppvSigTemp);
                if (elementType == CorElementType.ELEMENT_TYPE_VALUETYPE)
                {
                        uint token = MetadataHelperFunctions.CorSigUncompressToken(ref ppvSigTemp);

                        if (token == declaringType.MetadataToken)
                        {
                            // Static literal field of the same type as the enclosing type
                            // may be one of the value fields of an enum
                            if (declaringType.ReallyIsEnum)
                            {
                                // If so, the value will be of the enum's underlying type,
                                // so we change it from VALUETYPE to be that type so that
                                // the following code will get the value
                                elementType = declaringType.EnumUnderlyingType;
                            }                           
                        }
                }
                
                switch (elementType)
                {
                    case CorElementType.ELEMENT_TYPE_CHAR:
                        return (char)Marshal.ReadByte(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_I1:
                        return (sbyte)Marshal.ReadByte(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_U1:
                        return Marshal.ReadByte(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_I2:
                        return Marshal.ReadInt16(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_U2:
                        return (ushort)Marshal.ReadInt16(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_I4:
                        return Marshal.ReadInt32(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_U4:
                        return (uint)Marshal.ReadInt32(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_I8:
                        return Marshal.ReadInt64(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_U8:
                        return (ulong)Marshal.ReadInt64(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_I:
                        return Marshal.ReadIntPtr(ppvRawValue);
                    case CorElementType.ELEMENT_TYPE_U:
                    case CorElementType.ELEMENT_TYPE_R4:
                    case CorElementType.ELEMENT_TYPE_R8:
                    // Technically U and the floating-point ones are options in the CLI, but not in the CLS or C#, so these are NYI
                    default:
                        return null;
                }
        }
开发者ID:Orvid,项目名称:Cosmos,代码行数:55,代码来源:MetadataFieldInfo.cs


示例11: makeMetadataField

        internal static MetadataField makeMetadataField(string description, string name, MetadataType type, int pos, string format, Guid guid)
        {
            MetadataField metadataField = new MetadataField();
            metadataField.Description = description;
            metadataField.Name = name;
            metadataField.Type = type;
            metadataField.Guid = guid;
            metadataField.DisplayPosition = pos;
            metadataField.DisplayFormat = format;

            return metadataField;
        }
开发者ID:altliu,项目名称:sandbox-aliu,代码行数:12,代码来源:EventDefintionWrapperBase.cs


示例12: AddProperties

        public void AddProperties(StringBuilderWrapper sb, MetadataType type, bool includeResponseStatus)
        {
            var makeExtensible = Config.MakeDataContractsExtensible && type.Inherits == null;

            var wasAdded = false;

            var dataMemberIndex = 1;
            if (type.Properties != null)
            {
                foreach (var prop in type.Properties)
                {
                    if (wasAdded) sb.AppendLine();

                    var propType = Type(prop.Type, prop.GenericArgs);
                    wasAdded = AppendComments(sb, prop.Description);
                    wasAdded = AppendDataMember(sb, prop.DataMember, dataMemberIndex++) || wasAdded;
                    wasAdded = AppendAttributes(sb, prop.Attributes) || wasAdded;

                    if (!type.IsInterface())
                    {
                        sb.AppendLine("member val {1}:{0} = {2} with get,set".Fmt(
                            propType, prop.Name.SafeToken(), GetDefaultLiteral(prop, type)));
                    }
                    else
                    {
                        sb.AppendLine("abstract {1}:{0} with get,set".Fmt(
                            propType, prop.Name.SafeToken()));
                    }
                }
            }

            if (type.IsInterface())
                return;

            if (includeResponseStatus)
            {
                if (wasAdded) sb.AppendLine();
                wasAdded = true;

                AppendDataMember(sb, null, dataMemberIndex++);
                sb.AppendLine("member val ResponseStatus:ResponseStatus = null with get,set");
            }

            if (makeExtensible
                && (type.Properties == null
                    || type.Properties.All(x => x.Name != "ExtensionData")))
            {
                if (wasAdded) sb.AppendLine();
                wasAdded = true;

                sb.AppendLine("member val ExtensionData:ExtensionDataObject = null with get,set");
            }
        }
开发者ID:CLupica,项目名称:ServiceStack,代码行数:53,代码来源:FSharpGenerator.cs


示例13: ExpectedMimeEventArgs

        /// <summary>
        /// ExpectedMIMEEventArgs Constructor
        /// </summary>
        /// <param name="parsed">a simple MessageParse</param>
        internal ExpectedMimeEventArgs(dynamic parsed)
        {
#if DEBUG
            FCP2Protocol.ArgsDebug(this, parsed);
#endif
            identifier = parsed.identifier;
            global = parsed.global;
            metadata = new MetadataType(parsed);

#if DEBUG
            parsed.PrintAccessCount();
#endif
        }
开发者ID:vincentmele,项目名称:fcp2lib.NET,代码行数:17,代码来源:ExpectedMIMEEventArgs.cs


示例14: SubmitChange

 public void SubmitChange(MetadataType metadataType, string filed, object value)
 {
     ConsoleClient.Instance.UpdateMetadataObjectField(metadataType, this._MetadataObject.Id, filed, value, delegate(bool success)
     {
         if (success)
         {
             this.ApplyChangeToUI(filed, value);
         }
         else
         {
             base.OnPropertyChanged(filed);
         }
     });
 }
开发者ID:BlueSky007,项目名称:ExchangeManager,代码行数:14,代码来源:VmBase.cs


示例15: MetadataFieldInfo

        internal MetadataFieldInfo(IMetadataImport importer,int fieldToken, MetadataType declaringType)
        {
            m_importer = importer;
            m_fieldToken = fieldToken;
            m_declaringType = declaringType;

            // Initialize
            int mdTypeDef;
            int pchField,pcbSigBlob,pdwCPlusTypeFlab,pcchValue, pdwAttr;
            IntPtr ppvSigBlob;
            IntPtr ppvRawValue;
            m_importer.GetFieldProps(m_fieldToken,
                                     out mdTypeDef,
                                     null,
                                     0,
                                     out pchField,
                                     out pdwAttr,
                                     out ppvSigBlob,
                                     out pcbSigBlob,
                                     out pdwCPlusTypeFlab,
                                     out ppvRawValue,
                                     out pcchValue
                                     );
            
            StringBuilder szField = new StringBuilder(pchField);
            m_importer.GetFieldProps(m_fieldToken,
                                     out mdTypeDef,
                                     szField,
                                     szField.Capacity,
                                     out pchField,
                                     out pdwAttr,
                                     out ppvSigBlob,
                                     out pcbSigBlob,
                                     out pdwCPlusTypeFlab,
                                     out ppvRawValue,
                                     out pcchValue
                                     );
            m_fieldAttributes = (FieldAttributes)pdwAttr;
            m_name = szField.ToString();

            // Get the values for static literal fields with primitive types
            FieldAttributes staticLiteralField = FieldAttributes.Static | FieldAttributes.HasDefault | FieldAttributes.Literal;
            if ((m_fieldAttributes & staticLiteralField) == staticLiteralField)
            {
                m_value = ParseDefaultValue(declaringType,ppvSigBlob,ppvRawValue);
            }
			// [Xamarin] Expression evaluator.
			MetadataHelperFunctions.GetCustomAttribute (importer, m_fieldToken, typeof (System.Diagnostics.DebuggerBrowsableAttribute));
		}
开发者ID:jmloeffler,项目名称:monodevelop,代码行数:49,代码来源:MetadataFieldInfo.cs


示例16: AddProperties

        public void AddProperties(StringBuilderWrapper sb, MetadataType type, bool includeResponseStatus)
        {
            var makeExtensible = Config.MakeDataContractsExtensible && type.Inherits == null;

            var @virtual = Config.MakeVirtual && !type.IsInterface() ? "Overridable " : "";
            var wasAdded = false;

            var dataMemberIndex = 1;
            if (type.Properties != null)
            {
                foreach (var prop in type.Properties)
                {
                    if (wasAdded) sb.AppendLine();

                    var propType = Type(prop.Type, prop.GenericArgs, includeNested:true);
                    wasAdded = AppendComments(sb, prop.Description);
                    wasAdded = AppendDataMember(sb, prop.DataMember, dataMemberIndex++) || wasAdded;
                    wasAdded = AppendAttributes(sb, prop.Attributes) || wasAdded;
                    var visibility = type.IsInterface() ? "" : "Public ";
                    sb.AppendLine("{0}{1}Property {2} As {3}".Fmt(
                        visibility,
                        @virtual,
                        EscapeKeyword(prop.Name).SafeToken(),
                        propType));
                }
            }

            if (type.IsInterface())
                return;

            if (includeResponseStatus)
            {
                if (wasAdded) sb.AppendLine();
                wasAdded = true;

                wasAdded = AppendDataMember(sb, null, dataMemberIndex++);
                sb.AppendLine("Public {0}Property ResponseStatus As ResponseStatus".Fmt(@virtual));
            }

            if (makeExtensible
                && (type.Properties == null
                    || type.Properties.All(x => x.Name != "ExtensionData")))
            {
                if (wasAdded) sb.AppendLine();
                wasAdded = true;

                sb.AppendLine("Public {0}Property ExtensionData As ExtensionDataObject Implements IExtensibleDataObject.ExtensionData".Fmt(@virtual));
            }
        }
开发者ID:CLupica,项目名称:ServiceStack,代码行数:49,代码来源:VbNetGenerator.cs


示例17: MetadataFieldInfo

        internal MetadataFieldInfo(IMetadataImport importer, int fieldToken, MetadataType declaringType)
        {
            m_importer = importer;
            m_fieldToken = fieldToken;
            m_declaringType = declaringType;

            // Initialize
            int mdTypeDef;
            int pchField, pcbSigBlob, pdwCPlusTypeFlab, pcchValue, pdwAttr;
            IntPtr ppvSigBlob;
            IntPtr ppvRawValue;
            m_importer.GetFieldProps(m_fieldToken,
                                     out mdTypeDef,
                                     null,
                                     0,
                                     out pchField,
                                     out pdwAttr,
                                     out ppvSigBlob,
                                     out pcbSigBlob,
                                     out pdwCPlusTypeFlab,
                                     out ppvRawValue,
                                     out pcchValue
                );

            var szField = new StringBuilder(pchField);
            m_importer.GetFieldProps(m_fieldToken,
                                     out mdTypeDef,
                                     szField,
                                     szField.Capacity,
                                     out pchField,
                                     out pdwAttr,
                                     out ppvSigBlob,
                                     out pcbSigBlob,
                                     out pdwCPlusTypeFlab,
                                     out ppvRawValue,
                                     out pcchValue
                );
            m_fieldAttributes = (FieldAttributes) pdwAttr;
            m_name = szField.ToString();

            // Get the values for static literal fields with primitive types
            FieldAttributes staticLiteralField = FieldAttributes.Static | FieldAttributes.HasDefault |
                                                 FieldAttributes.Literal;
            if ((m_fieldAttributes & staticLiteralField) == staticLiteralField)
            {
                m_value = ParseDefaultValue(declaringType, ppvSigBlob, ppvRawValue);
            }
        }
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:48,代码来源:MetadataFieldInfo.cs


示例18: ExtendedQueryParameters

        public ExtendedQueryParameters()
        {
            // Default all parameters
            QuerySchemas = new string[]{};
            MetaQueryValues = new List<MetaQueryItem>();
            MetaQueryLogic = QueryLogic.AllCriteriaMatch;

            KeywordValues = new List<KeywordItem>();
            KeywordQueryLogic = QueryLogic.AllCriteriaMatch;

            LastPublishedDate = DateTime.MinValue;

            QuerySortField = "ItemTitle";
            SortType = MetadataType.STRING;
            QuerySortOrder = MetaQueryOrder.Ascending;
            MaximumComponents = int.MaxValue;
        }
开发者ID:dd4t,项目名称:DD4T.Providers.SDLTridion2011sp1,代码行数:17,代码来源:ExtendedQueryParameters.cs


示例19: AddProperties

        public void AddProperties(StringBuilderWrapper sb, MetadataType type)
        {
            var makeExtensible = Config.MakeDataContractsExtensible && type.Inherits == null;

            var @virtual = Config.MakeVirtual ? "virtual " : "";
            var wasAdded = false;

            var dataMemberIndex = 1;
            if (type.Properties != null)
            {
                foreach (var prop in type.Properties)
                {
                    if (wasAdded) sb.AppendLine();

                    var propType = Type(prop.Type, prop.GenericArgs);
                    wasAdded = AppendDataMember(sb, prop.DataMember, dataMemberIndex++);
                    wasAdded = AppendAttributes(sb, prop.Attributes) || wasAdded;
                    sb.AppendLine("public {0}{1} {2} {{ get; set; }}".Fmt(@virtual, propType, prop.Name.SafeToken()));
                }
            }

            if (Config.AddResponseStatus
                && (type.Properties == null
                    || type.Properties.All(x => x.Name != "ResponseStatus")))
            {
                if (wasAdded) sb.AppendLine();
                wasAdded = true;

                AppendDataMember(sb, null, dataMemberIndex++);
                sb.AppendLine("public {0}ResponseStatus ResponseStatus {{ get; set; }}".Fmt(@virtual));
            }

            if (makeExtensible
                && (type.Properties == null
                    || type.Properties.All(x => x.Name != "ExtensionData")))
            {
                if (wasAdded) sb.AppendLine();
                wasAdded = true;

                sb.AppendLine("public {0}ExtensionDataObject ExtensionData {{ get; set; }}".Fmt(@virtual));
            }
        }
开发者ID:yhhno,项目名称:soa,代码行数:42,代码来源:CSharpGenerator.cs


示例20: AddTypeToSortedList

        private void AddTypeToSortedList(List<MetadataType> allTypes, List<MetadataType> sortedTypes, MetadataType metadataType)
        {
            if (sortedTypes.Contains(metadataType))
                return;

            if (metadataType == null)
                return;

            if (metadataType.Inherits == null)
            {
                sortedTypes.Add(metadataType);
                return;
            }

            var inheritedMetadataType = FindMetadataTypeByMetadataTypeName(allTypes, metadataType.Inherits);
            // Find and add base class first
            AddTypeToSortedList(allTypes,sortedTypes, inheritedMetadataType);

            if (!sortedTypes.Contains(metadataType))
                sortedTypes.Add(metadataType);
        }
开发者ID:AVee,项目名称:ServiceStack,代码行数:21,代码来源:TypeScriptGenerator.cs



注:本文中的MetadataType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MetadataTypeName类代码示例发布时间:2022-05-24
下一篇:
C# MetadataToken类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap