本文整理汇总了C#中TypeSpec类的典型用法代码示例。如果您正苦于以下问题:C# TypeSpec类的具体用法?C# TypeSpec怎么用?C# TypeSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeSpec类属于命名空间,在下文中一共展示了TypeSpec类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnumToBoolMapping
public EnumToBoolMapping(XmlElement element, TypeSpec fcsType)
{
enumValue = element.GetAttribute("FCSValue");
boolMemberName = element.GetAttribute("ForeignMember");
FCSType = fcsType;
}
示例2: Type
/// <summary>
/// Read ctor
/// </summary>
internal Type(TypeSpec parent, ResReader reader)
: base(reader, ChunkTypes.RES_TABLE_TYPE_TYPE)
{
this.parent = parent;
var id = reader.ReadByte();
reader.Skip(3); // reserved
if (id != parent.Id)
{
throw new IOException("Type id (" + id + ") " + "doesn't match parent id (" + parent.Id + ").");
}
var entryCount = reader.ReadInt32();
if (entryCount != parent.EntryCount)
{
throw new IOException(string.Format("Type entry count ({0}) doesn't match parent entry count ({1})", entryCount, parent.EntryCount));
}
var entriesStart = reader.ReadInt32();
configuration = new Configuration(reader);
// Data
var offsets = reader.ReadIntArray(entryCount);
var dataSize = (Size - entriesStart);
if ((dataSize % 4) != 0)
{
throw new IOException("Type data size (" + dataSize + ") is not multiple of 4.");
}
for (var i = 0; i < entryCount; i++ )
{
if (offsets[i] != NO_ENTRY)
{
var actualOffset = reader.Position;
var instance = EntryInstance.Read(this, reader);
parent.GetEntry(i).Add(instance);
}
}
}
示例3: RequestMsg
/// <summary>
/// This .ctor is handy for message inspectors.
/// Creates a substitute message for the original one with new values.
/// Binding-specific context is cloned and headers/correlation data are cloned conditionaly
/// </summary>
protected RequestMsg(RequestMsg inspectedOriginal,
TypeSpec contract, MethodSpec method, bool oneWay, Guid? instance,
bool cloneHeaders = true, bool cloneCorrelation = true) : this(contract, method, oneWay, instance)
{
m_ServerTransport = inspectedOriginal.m_ServerTransport;
CloneState(inspectedOriginal, cloneHeaders, cloneCorrelation);
}
示例4: InitializeTypes
private static void InitializeTypes(SymbolTableStack symtabstack)
{
// int
IntegerId = symtabstack.CreateInLocal("integer");
IntegerType = TypeSpec.CreateType(TypeForm.Scalar);
IntegerType.Identifier = IntegerId;
IntegerId.Definition = Definition.TYPE;
IntegerId.Type = IntegerType;
// real
RealId = symtabstack.CreateInLocal("real");
RealType = TypeSpec.CreateType(TypeForm.Scalar);
RealType.Identifier = RealId;
RealId.Definition = Definition.TYPE;
RealId.Type = RealType;
// boolean
BooleanId = symtabstack.CreateInLocal("boolean");
BooleanType = TypeSpec.CreateType(TypeForm.Enumeration);
BooleanType.Identifier = BooleanId;
BooleanId.Definition = Definition.TYPE;
BooleanId.Type = BooleanType;
// char
CharId = symtabstack.CreateInLocal("char");
CharType = TypeSpec.CreateType(TypeForm.Scalar);
CharType.Identifier = CharId;
CharId.Definition = Definition.TYPE;
CharId.Type = CharType;
//
UndefinedType = TypeSpec.CreateType(TypeForm.Scalar);
}
示例5: RequestAnyMsg
/// <summary>
/// This .ctor is handy for message inspectors.
/// Creates a substitute message for the original one with new values.
/// Binding-specific context is cloned and headers/correlation data are cloned conditionaly
/// </summary>
public RequestAnyMsg(RequestMsg inspectedOriginal,
TypeSpec contract, MethodSpec method, bool oneWay, Guid? instance, object[] args,
bool cloneHeaders = true, bool cloneCorrelation = true)
: base(inspectedOriginal, contract, method, oneWay, instance, cloneHeaders, cloneCorrelation)
{
m_Arguments = args;
}
示例6: BaseClassMapping
protected BaseClassMapping(XmlElement node)
{
FCSType = new TypeSpec(node.GetAttribute("FCSType"), TypeSpec.TypeSpecCategories.FCSType);
ForeignType = new TypeSpec(node.GetAttribute("ForeignType"), TypeSpec.TypeSpecCategories.ForeignType);
ForeignType.HeaderFile = XmlUtils.GetOptionalAttribute(node, "HeaderFile");
}
示例7: CreateNestedDelta
protected virtual object CreateNestedDelta(object propValue, TypeSpec propValueType, Type propertyType)
{
if (propValueType.SerializationMode == TypeSerializationMode.Structured)
return new ObjectDelta(propValue, propValueType, TypeMapper, this);
if (propValueType.IsCollection)
return new CollectionDelta(propValue, propValueType, TypeMapper, this);
throw new NotImplementedException();
}
示例8: AuthServiceClient
//static .ctor
static AuthServiceClient()
{
var t = typeof(IAuthService);
s_ts_CONTRACT = new TypeSpec(t);
s_ms_CloseSession = new MethodSpec(t.GetMethod("CloseSession", new Type[] { typeof(Guid) }));
s_ms_CreateSession = new MethodSpec(t.GetMethod("CreateSession", new Type[] { typeof(long) }));
s_ms_GetSessionUser = new MethodSpec(t.GetMethod("GetSessionUser", new Type[] { typeof(Guid) }));
}
示例9: PomonaJsonSerializerTypeEntry
public PomonaJsonSerializerTypeEntry(TypeSpec type)
{
if (type == null)
throw new ArgumentNullException(nameof(type));
this.type = type;
BuildAcceleratedPropertyWritingAction();
}
示例10: TestContractAClient
//static .ctor
static TestContractAClient()
{
var t = typeof(NFX.NUnit.Glue.ITestContractA);
s_ts_CONTRACT = new TypeSpec(t);
@s_ms_Method1_0 = new MethodSpec(t.GetMethod("Method1", new Type[]{ typeof(@[email protected]) }));
@s_ms_Method2_1 = new MethodSpec(t.GetMethod("Method2", new Type[]{ typeof(@[email protected]) }));
@s_ms_Sleeper_2 = new MethodSpec(t.GetMethod("Sleeper", new Type[]{ typeof(@[email protected]) }));
}
示例11: Delta
protected Delta(object original, TypeSpec type, ITypeMapper typeMapper, Delta parent = null)
{
if (original == null) throw new ArgumentNullException("original");
if (type == null) throw new ArgumentNullException("type");
if (typeMapper == null) throw new ArgumentNullException("typeMapper");
Original = original;
Type = type;
TypeMapper = typeMapper;
this.parent = parent;
}
示例12: Error_InvalidConstantType
public static void Error_InvalidConstantType(TypeSpec t, Location loc, Report Report)
{
if (t.IsGenericParameter) {
Report.Error (1959, loc,
"Type parameter `{0}' cannot be declared const", TypeManager.CSharpName (t));
} else {
Report.Error (283, loc,
"The type `{0}' cannot be declared const", TypeManager.CSharpName (t));
}
}
示例13: ItemValueDeserializerNode
public ItemValueDeserializerNode(TypeSpec expectedBaseType,
IDeserializationContext context,
string expandPath = "",
IDeserializerNode parent = null)
{
Parent = parent;
ExpectedBaseType = expectedBaseType;
Context = context;
ExpandPath = expandPath;
this.valueType = expectedBaseType;
}
示例14: MemberSpec
public MemberSpec(string specText, TypeSpec.TypeSpecCategories typeCategory)
{
int index = specText.LastIndexOf(' ');
string[] bits = new string[2];
bits[0] = specText.Substring(0, index);
bits[1] = specText.Substring(index + 1);
Type = new TypeSpec(bits[0], typeCategory);
Name = bits[1];
}
示例15: JokeContractClient
//static .ctor
static JokeContractClient()
{
var t = typeof(@[email protected]);
s_ts_CONTRACT = new TypeSpec(t);
@s_ms_Echo_0 = new MethodSpec(t.GetMethod("Echo", new Type[]{ typeof(@[email protected]) }));
@s_ms_UnsecureEcho_1 = new MethodSpec(t.GetMethod("UnsecureEcho", new Type[]{ typeof(@[email protected]) }));
@s_ms_UnsecEchoMar_2 = new MethodSpec(t.GetMethod("UnsecEchoMar", new Type[]{ typeof(@[email protected]) }));
@s_ms_SimpleWorkAny_3 = new MethodSpec(t.GetMethod("SimpleWorkAny", new Type[]{ typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]) }));
@s_ms_SimpleWorkMar_4 = new MethodSpec(t.GetMethod("SimpleWorkMar", new Type[]{ typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]) }));
@s_ms_DBWork_5 = new MethodSpec(t.GetMethod("DBWork", new Type[]{ typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]) }));
@s_ms_Notify_6 = new MethodSpec(t.GetMethod("Notify", new Type[]{ typeof(@[email protected]) }));
@s_ms_ObjectWork_7 = new MethodSpec(t.GetMethod("ObjectWork", new Type[]{ typeof(@[email protected]) }));
}