本文整理汇总了C#中Utilities.Reflection.Emit.Assembly类的典型用法代码示例。如果您正苦于以下问题:C# Utilities.Reflection.Emit.Assembly类的具体用法?C# Utilities.Reflection.Emit.Assembly怎么用?C# Utilities.Reflection.Emit.Assembly使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Utilities.Reflection.Emit.Assembly类属于命名空间,在下文中一共展示了Utilities.Reflection.Emit.Assembly类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetDefinition
public void GetDefinition()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
Utilities.Reflection.Emit.FieldBuilder Field = TestType.CreateField("Field1", typeof(int));
Assert.NotEmpty(Field.GetDefinition());
}
开发者ID:JKLFA,项目名称:Craig-s-Utility-Library,代码行数:7,代码来源:FieldBuilder.cs
示例2: GetDefinition
public void GetDefinition()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
Utilities.Reflection.Emit.Interfaces.IPropertyBuilder Property = TestType.CreateDefaultProperty("Property1", typeof(int));
Assert.NotEmpty(Property.GetDefinition());
}
开发者ID:kaytie,项目名称:Craig-s-Utility-Library,代码行数:7,代码来源:DefaultPropertyBuilder.cs
示例3: CreateEnum
public void CreateEnum()
{
Utilities.Reflection.Emit.Assembly TestObject = new Utilities.Reflection.Emit.Assembly("TestingThis");
Utilities.Reflection.Emit.EnumBuilder EnumObject = TestObject.CreateEnum("TestEnum");
Assert.NotNull(EnumObject);
TestObject.Create();
}
开发者ID:rgshare,项目名称:Craig-s-Utility-Library,代码行数:7,代码来源:Assembly.cs
示例4: CreateType
public void CreateType()
{
Utilities.Reflection.Emit.Assembly TestObject = new Utilities.Reflection.Emit.Assembly("TestingThis");
Utilities.Reflection.Emit.TypeBuilder TypeObject = TestObject.CreateType("TestClass");
Assert.NotNull(TypeObject);
TestObject.Create();
}
开发者ID:rgshare,项目名称:Craig-s-Utility-Library,代码行数:7,代码来源:Assembly.cs
示例5: Assign
public void Assign()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateMethod("TestMethod");
Utilities.Reflection.Emit.FieldBuilder Field = TestType.CreateField("Field1", typeof(int));
Assert.DoesNotThrow(() => Field.Assign(12));
}
开发者ID:AngelMarquez,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:FieldBuilder.cs
示例6: Load
public void Load()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateMethod("TestMethod");
VariableBase Local1 = Method.CreateLocal("Local1", typeof(int));
Assert.DoesNotThrow<Exception>(() => Local1.Load(Method.Generator));
}
开发者ID:gwilkinson,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:LocalBuilder.cs
示例7: PlusPlus
public void PlusPlus()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateConstructor();
Utilities.Reflection.Emit.PropertyBuilder TestProperty = (Utilities.Reflection.Emit.PropertyBuilder)TestType.CreateProperty("TestProperty", typeof(int));
Assert.DoesNotThrow(() => ++TestProperty);
}
开发者ID:AngelMarquez,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:PropertyBuilder.cs
示例8: MinusMinus
public void MinusMinus()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateConstructor();
Utilities.Reflection.Emit.PropertyBuilder TestProperty = (Utilities.Reflection.Emit.PropertyBuilder)TestType.CreateProperty("TestProperty", typeof(int));
--TestProperty;
}
开发者ID:rgshare,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:PropertyBuilder.cs
示例9: Save
public void Save()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateMethod("TestMethod");
VariableBase Local1 = Method.CreateLocal("Local1", typeof(int));
Local1.Save(Method.Generator);
}
开发者ID:rgshare,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:LocalBuilder.cs
示例10: Call
public void Call()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateMethod("TestMethod");
Utilities.Reflection.Emit.FieldBuilder Field = TestType.CreateField("Field1", typeof(int));
Assert.DoesNotThrow<Exception>(() => Field.Call("ToString"));
}
开发者ID:JKLFA,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:FieldBuilder.cs
示例11: Load
public void Load()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
Utilities.Reflection.Emit.FieldBuilder Field = TestType.CreateField("Field1", typeof(int));
IMethodBuilder Method = TestType.CreateMethod("TestMethod");
Field.Load(Method.Generator);
}
开发者ID:rgshare,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:FieldBuilder.cs
示例12: Call
public void Call()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateMethod("TestMethod");
VariableBase Local1 = Method.CreateLocal("Local1", typeof(int));
Assert.DoesNotThrow(() => Local1.Call("ToString"));
}
开发者ID:AngelMarquez,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:LocalBuilder.cs
示例13: Create
public void Create()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
Assert.NotNull(TestType);
Assert.DoesNotThrow<Exception>(() => Assembly.Create());
Assert.NotNull(Activator.CreateInstance(TestType.DefinedType));
}
开发者ID:JKLFA,项目名称:Craig-s-Utility-Library,代码行数:8,代码来源:TypeBuilder.cs
示例14: Create
public void Create()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
Utilities.Reflection.Emit.Interfaces.IMethodBuilder Constructor = TestType.CreateConstructor();
VariableBase Constant = Constructor.CreateConstant(12);
Assert.NotNull(Constant);
Assert.Equal(typeof(int), Constant.DataType);
}
开发者ID:JKLFA,项目名称:Craig-s-Utility-Library,代码行数:9,代码来源:ConstantBuilder.cs
示例15: Save
public void Save()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateConstructor();
Utilities.Reflection.Emit.PropertyBuilder TestProperty = (Utilities.Reflection.Emit.PropertyBuilder)TestType.CreateProperty("TestProperty", typeof(int));
Assert.Throws<NullReferenceException>(() => TestProperty.Save(null));
Assert.DoesNotThrow(() => TestProperty.Save(Method.Generator));
}
开发者ID:AngelMarquez,项目名称:Craig-s-Utility-Library,代码行数:9,代码来源:PropertyBuilder.cs
示例16: Box
public void Box()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateMethod("TestMethod");
VariableBase Local1 = Method.CreateLocal("Local1", typeof(int));
VariableBase Local2 = Method.CreateLocal("Local2", typeof(int));
Assert.NotNull(Method.Box(Local1));
}
开发者ID:JKLFA,项目名称:Craig-s-Utility-Library,代码行数:9,代码来源:MethodBuilder.cs
示例17: AddLiteral
public void AddLiteral()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.EnumBuilder Enum = Assembly.CreateEnum("TestEnum");
Enum.AddLiteral("TestLiteral1", 1);
Enum.AddLiteral("TestLiteral2", 2);
Assembly.Create();
Assert.NotNull(Activator.CreateInstance(Enum.DefinedType));
}
开发者ID:rgshare,项目名称:Craig-s-Utility-Library,代码行数:9,代码来源:EnumBuilder.cs
示例18: Load
public void Load()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateConstructor();
Assert.NotNull(Method.This);
Assert.Null(Method.This.DataType);
Assert.Equal("this", Method.This.Name);
Method.This.Load(Method.Generator);
}
开发者ID:rgshare,项目名称:Craig-s-Utility-Library,代码行数:10,代码来源:ParameterBuilder.cs
示例19: Call
public void Call()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateMethod("TestMethod");
IMethodBuilder Method2 = TestType.CreateMethod("TestMethod2");
VariableBase Local1 = Method.CreateLocal("Local1", typeof(int));
VariableBase Local2 = Method.CreateLocal("Local2", typeof(int));
Assert.DoesNotThrow<Exception>(() => Method.This.Call(Method2, null));
}
开发者ID:JKLFA,项目名称:Craig-s-Utility-Library,代码行数:10,代码来源:MethodBuilder.cs
示例20: Save
public void Save()
{
Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
IMethodBuilder Method = TestType.CreateConstructor();
Assert.NotNull(Method.This);
Assert.Null(Method.This.DataType);
Assert.Equal("this", Method.This.Name);
Assert.DoesNotThrow<Exception>(() => Method.This.Save(Method.Generator));
}
开发者ID:jpsullivan,项目名称:Craig-s-Utility-Library,代码行数:10,代码来源:ParameterBuilder.cs
注:本文中的Utilities.Reflection.Emit.Assembly类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论