本文整理汇总了C#中MetadataType类的典型用法代码示例。如果您正苦于以下问题:C# MetadataType类的具体用法?C# MetadataType怎么用?C# MetadataType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MetadataType类属于命名空间,在下文中一共展示了MetadataType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMetadata
public override IEnumerable<string> GetMetadata(MetadataType type)
{
if (parsedFile.Metadata.ContainsKey(type))
return parsedFile.Metadata[type];
return null;
}
示例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
}
示例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;
}
示例4: MetadataGenerationError
public MetadataGenerationError(MetadataType metadataType, Type type, string errorReason, string sugestionedSolution)
{
MetadataType = metadataType;
Type = type;
ErrorReason = errorReason;
SuggestedSolution = sugestionedSolution;
}
示例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;
}
}
示例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
}
示例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;
}
示例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));
}
示例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);
}
示例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;
}
}
示例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;
}
示例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");
}
}
示例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
}
示例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);
}
});
}
示例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));
}