本文整理汇总了C#中ITypeInfo类的典型用法代码示例。如果您正苦于以下问题:C# ITypeInfo类的具体用法?C# ITypeInfo怎么用?C# ITypeInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITypeInfo类属于命名空间,在下文中一共展示了ITypeInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: IsValidFixtureType
private bool IsValidFixtureType(ITypeInfo typeInfo, ref string reason)
{
if (typeInfo.IsAbstract)
{
reason = string.Format("{0} is an abstract class", typeInfo.FullName);
return false;
}
if (!typeInfo.HasConstructor(new Type[0]))
{
reason = string.Format("{0} does not have a default constructor", typeInfo.FullName);
return false;
}
var invalidAttributes = new Type[] {
typeof(SetUpAttribute),
typeof(TearDownAttribute),
#pragma warning disable 618 // Obsolete Attributes
typeof(TestFixtureSetUpAttribute),
typeof(TestFixtureTearDownAttribute) };
#pragma warning restore
foreach (Type invalidType in invalidAttributes)
if (typeInfo.HasMethodWithAttribute(invalidType))
{
reason = invalidType.Name + " attribute not allowed in a SetUpFixture";
return false;
}
return true;
}
开发者ID:alfeg,项目名称:nunit,代码行数:31,代码来源:SetUpFixtureAttribute.cs
示例2: GetVarDesc
public IntPtr GetVarDesc(ITypeInfo typeInfo, int index)
{
if (typeInfo == null) throw new ArgumentNullException(nameof(typeInfo));
IntPtr ret;
typeInfo.GetVarDesc(index, out ret);
return ret;
}
开发者ID:dbremner,项目名称:clrinterop,代码行数:7,代码来源:DefaultDaemon.cs
示例3: GetAttributes
public override IEnumerable<Attribute> GetAttributes(ITypeInfo typesInfo) {
if (typesInfo.Type != typeof(Analysis)) yield break;
yield return new CloneViewAttribute(CloneViewType.DetailView, InPlaceEdit_DetailView);
yield return new XpandNavigationItemAttribute("PivotChart/In Place Edit", InPlaceEdit_DetailView) { ObjectKey = "Name='InPlaceEdit'" };
yield return new DisplayFeatureModelAttribute(InPlaceEdit_DetailView, new BinaryOperator("Name", "InPlaceEdit"));
yield return new ActionStateRuleAttribute("Hide_save_and_close_for_" + InPlaceEdit_DetailView, "SaveAndClose", "1=1", "1=1", ActionState.Hidden);
}
开发者ID:kamchung322,项目名称:eXpand,代码行数:7,代码来源:AttributeRegistrator.cs
示例4: GetAttributes
public override IEnumerable<Attribute> GetAttributes(ITypeInfo typesInfo) {
if (typesInfo.Type != typeof(Customer)) yield break;
yield return new AdditionalViewControlsRuleAttribute(Captions.ViewMessage + " " + Captions.HeaderLinqQuery, "1=1", "1=1", Captions.ViewMessageLinqQuery, Position.Bottom) { ViewType = ViewType.ListView, View = "Customer_ListView_EmployeesLinq_Linq" };
yield return new AdditionalViewControlsRuleAttribute(Captions.Header + " " + Captions.HeaderLinqQuery, "1=1", "1=1", Captions.HeaderLinqQuery, Position.Top) { ViewType = ViewType.ListView, View = "Customer_ListView_EmployeesLinq_Linq" };
yield return new XpandNavigationItemAttribute(Captions.Miscellaneous + "LinqQuery", "Customer_ListView_EmployeesLinq_Linq");
yield return new CloneViewAttribute(CloneViewType.ListView, "LinqQuery_ListView");
}
开发者ID:aries544,项目名称:eXpand,代码行数:7,代码来源:AttributeRegistrator.cs
示例5: GetAttributes
public override IEnumerable<Attribute> GetAttributes(ITypeInfo typesInfo) {
if (typesInfo.Type != typeof(Customer)) yield break;
const string viewId = "Customer_DetailView";
yield return new XpandNavigationItemAttribute("Navigation/Detail View of Persistent object with records", viewId);
yield return new AdditionalViewControlsRuleAttribute(Captions.ViewMessage + " " + Captions.HeaderDetailViewNavigation, "1=1", "1=1", Captions.ViewMessageDetailViewNavigation, Position.Bottom) { View = viewId };
yield return new AdditionalViewControlsRuleAttribute(Captions.Header + " " + Captions.HeaderDetailViewNavigation, "1=1", "1=1", Captions.HeaderDetailViewNavigation, Position.Top) { View = viewId };
}
开发者ID:kamchung322,项目名称:eXpand,代码行数:7,代码来源:AttributeRegistrator.cs
示例6: GetAttributes
public override IEnumerable<Attribute> GetAttributes(ITypeInfo typesInfo) {
if (!(typesInfo.Type == typeof (PersistentAssemblyInfo))) yield break;
yield return new CloneViewAttribute(CloneViewType.DetailView, Quartz_DetailView);
yield return new XpandNavigationItemAttribute("WorldCreator/Quartz/Quartz AssemblyInfo", Quartz_DetailView) { ObjectKey = CriteriaOperator.Parse("Name=?", "Quartz").ToString() };
yield return new AdditionalViewControlsRuleAttribute(Captions.ViewMessage + " " + Captions.HeaderQuartz, "1=1", "1=1", Captions.ViewMessageQuartz, Position.Bottom) { View = Quartz_DetailView };
yield return new AdditionalViewControlsRuleAttribute(Captions.Header + " " + Captions.HeaderQuartz, "1=1", "1=1", Captions.HeaderQuartz, Position.Top) { View = Quartz_DetailView };
}
开发者ID:aries544,项目名称:eXpand,代码行数:7,代码来源:AttributeRegistrator.cs
示例7: VsixTestCollection
public VsixTestCollection (ITestAssembly testAssembly, ITypeInfo collectionDefinition,
string visualStudioVersion, string rootSuffix)
: base (testAssembly, collectionDefinition, visualStudioVersion + " (" + rootSuffix + ")")
{
VisualStudioVersion = visualStudioVersion;
RootSuffix = rootSuffix;
}
开发者ID:victorgarciaaprea,项目名称:xunit.vsix,代码行数:7,代码来源:VsixTestCollection.cs
示例8: DocumentedType
/// <summary>
/// Initializes a new instance of the <see cref="DocumentedType" /> class.
/// </summary>
/// <param name="info">The type information.</param>
/// <param name="properties">The type's properties.</param>
/// <param name="methods">The type's methods.</param>
/// <param name="fields">The type's fields.</param>
/// <param name="summary">The summary.</param>
/// <param name="remarks">The remarks.</param>
/// <param name="examples">The examples.</param>
/// <param name="metadata">The type metadata.</param>
public DocumentedType(
ITypeInfo info,
IEnumerable<DocumentedProperty> properties,
IEnumerable<DocumentedMethod> methods,
IEnumerable<DocumentedField> fields,
SummaryComment summary,
RemarksComment remarks,
IEnumerable<ExampleComment> examples,
IDocumentationMetadata metadata)
: base(MemberClassification.Type, summary, remarks, examples, metadata)
{
Definition = info.Definition;
TypeClassification = info.Definition.GetTypeClassification();
Identity = info.Identity;
Properties = new List<DocumentedProperty>(properties);
Fields = new List<DocumentedField>(fields);
// Materialize all methods.
var documentedMethods = methods as DocumentedMethod[] ?? methods.ToArray();
Constructors = new List<DocumentedMethod>(GetConstructors(documentedMethods));
Methods = new List<DocumentedMethod>(GetMethods(documentedMethods));
Operators = new List<DocumentedMethod>(GetOperators(documentedMethods));
_extensionMethods = new List<DocumentedMethod>();
}
开发者ID:CharliePoole,项目名称:website,代码行数:37,代码来源:DocumentedType.cs
示例9: CulturedXunitTestCase
public CulturedXunitTestCase(ITestCollection testCollection, IAssemblyInfo assembly, ITypeInfo type, IMethodInfo method, IAttributeInfo factAttribute, string culture)
: base(testCollection, assembly, type, method, factAttribute)
{
this.culture = culture;
Traits.Add("Culture", culture);
}
开发者ID:kerryjiang,项目名称:xunit,代码行数:7,代码来源:CulturedXunitTestCase.cs
示例10: ViewInfo
public ViewInfo(string viewId, bool isDetailView, bool isRoot, ITypeInfo objectTypeInfo, ViewEditMode? viewEditMode) {
ViewId = viewId;
IsDetailView = isDetailView;
IsRoot = isRoot;
ObjectTypeInfo = objectTypeInfo;
ViewEditMode = viewEditMode;
}
开发者ID:aries544,项目名称:eXpand,代码行数:7,代码来源:LogicRuleEvaluator.cs
示例11: TestFixture
/// <summary>
/// Initializes a new instance of the <see cref="TestFixture"/> class.
/// </summary>
/// <param name="fixtureType">Type of the fixture.</param>
public TestFixture(ITypeInfo fixtureType) : base(fixtureType)
{
CheckSetUpTearDownMethods(typeof(OneTimeSetUpAttribute));
CheckSetUpTearDownMethods(typeof(OneTimeTearDownAttribute));
CheckSetUpTearDownMethods(typeof(SetUpAttribute));
CheckSetUpTearDownMethods(typeof(TearDownAttribute));
}
开发者ID:furyanPDX,项目名称:nunit,代码行数:11,代码来源:TestFixture.cs
示例12: CreateTest
/// <inheritdoc />
protected override PatternTest CreateTest(PatternEvaluationScope constainingScope, ITypeInfo type)
{
PatternTest test = base.CreateTest(constainingScope, type);
test.Name = NameSanitizer.MakeNameFromIdentifier(test.Name);
test.Kind = NBehaveTestKinds.Concern;
return test;
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:ConcernAttribute.cs
示例13: GetAttributes
public override IEnumerable<Attribute> GetAttributes(ITypeInfo typesInfo) {
if (typesInfo.Type != typeof(ExceptionHandlingObject)) yield break;
yield return new AdditionalViewControlsRuleAttribute(Captions.ViewMessage + " " + Captions.HeaderExceptionHandling, "1=1", "1=1", Captions.ViewMessageExceptionHandling, Position.Bottom) { ViewType = ViewType.DetailView, View = "ExceptionHandling_DetailView" };
yield return new AdditionalViewControlsRuleAttribute(Captions.Header + " " + Captions.HeaderExceptionHandling, "1=1", "1=1", Captions.HeaderExceptionHandling, Position.Top) { View = "ExceptionHandling_DetailView" };
yield return new CloneViewAttribute(CloneViewType.DetailView, "ExceptionHandling_DetailView");
yield return new XpandNavigationItemAttribute(Captions.Miscellaneous + "ExceptionHandling", "ExceptionHandling_DetailView");
}
开发者ID:kevin3274,项目名称:eXpand,代码行数:7,代码来源:AttributeRegistrator.cs
示例14: ExcelImportWizard
public ExcelImportWizard(ObjectSpace objectSpace, ITypeInfo typeInfo, CollectionSourceBase collectionSourceBase) {
//set local variable values
if (objectSpace == null)
throw new ArgumentNullException("objectSpace", @"ObjectSpace cannot be NULL");
ObjectSpace = objectSpace;
CurrentCollectionSource = collectionSourceBase;
//_ImportUOW = new UnitOfWork(((ObjectSpace)ObjectSpace).Session.DataLayer);
Type = typeInfo.Type;
//this.typeInfo = typeInfo;
InitializeComponent();
ImportMapLookUp.Properties.DataSource = ImportMapsCollection.ToList();
//ImportMapLookUp.Properties.DisplayMember = "Name";
//disable next, until file and other info is selected
wizardPage1.AllowNext = false;
gridLookUpEdit1.Properties.View.OptionsBehavior.AutoPopulateColumns = true;
gridLookUpEdit1.Properties.DataSource = MappableColumns;//.ToList();
// gridLookUpEdit1.Properties.SearchMode = SearchMode.OnlyInPopup;
var col = gridLookUpEdit2View.Columns.ColumnByFieldName("Mapped");
if (col != null) {
col.Visible = false;
col.FilterInfo =
new ColumnFilterInfo(new BinaryOperator("Mapped", false));
}
col = gridLookUpEdit2View.Columns.ColumnByFieldName("Oid");
if (col != null)
col.Visible = false;
}
开发者ID:maxx1337,项目名称:eXpand,代码行数:34,代码来源:ExcelImportWizard.cs
示例15: AfterTypeEmit
public void AfterTypeEmit(IEmitter emitter, ITypeInfo type)
{
foreach (var plugin in this.Parts)
{
plugin.AfterTypeEmit(emitter, type);
}
}
开发者ID:txdv,项目名称:Builder,代码行数:7,代码来源:Plugins.cs
示例16: GetDefaultValue
/// <summary>
/// Gets the default value for a reflected type.
/// </summary>
/// <param name="type">The reflected type.</param>
/// <returns>The default value for the type, such as <c>0</c> if
/// the type represents an integer, or <c>null</c> if the type
/// is a reference type or if <paramref name="type"/> was null.</returns>
public static object GetDefaultValue(ITypeInfo type)
{
if (type == null)
return null;
return ReflectionUtils.GetDefaultValue(type.TypeCode);
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:14,代码来源:ReflectorTypeUtils.cs
示例17: XunitTestCollection
/// <summary>
/// Initializes a new instance of the <see cref="XunitTestCollection"/> class.
/// </summary>
public XunitTestCollection(ITestAssembly testAssembly, ITypeInfo collectionDefinition, string displayName)
{
CollectionDefinition = collectionDefinition;
DisplayName = displayName;
TestAssembly = testAssembly;
UniqueID = Guid.NewGuid();
}
开发者ID:joaomajesus,项目名称:xunit,代码行数:10,代码来源:XunitTestCollection.cs
示例18: ConcordionTypeInfoAdapter
/// <summary>
/// Initializes a new instance of the <see cref="ConcordionTypeInfoAdapter"/> class.
/// </summary>
/// <param name="target">The target.</param>
public ConcordionTypeInfoAdapter(ITypeInfo target)
{
if (target == null)
throw new ArgumentNullException("target");
Target = target;
}
开发者ID:ElviraH,项目名称:concordion-net,代码行数:11,代码来源:ConcordionTypeInfoAdapter.cs
示例19: GetAttributes
public override IEnumerable<Attribute> GetAttributes(ITypeInfo typesInfo) {
if (typesInfo.Type!=typeof(PersistentAssemblyInfo))yield break;
yield return new CloneViewAttribute(CloneViewType.DetailView, "NorthWind_DetailView");
yield return new XpandNavigationItemAttribute("WorldCreator/NorthWind/NorthWind AssemblyInfo", "NorthWind_DetailView") { ObjectKey = CriteriaOperator.Parse("Name=?", "NorthWind").ToString() };
yield return new AdditionalViewControlsRuleAttribute(Captions.ViewMessage + " " + Captions.HeaderNorthWind, "1=1", "1=1", Captions.ViewMessageNorthWind, Position.Bottom) { View = "NorthWind_DetailView" };
yield return new AdditionalViewControlsRuleAttribute(Captions.Header + " " + Captions.HeaderNorthWind, "1=1", "1=1", Captions.HeaderNorthWind, Position.Top) { View = "NorthWind_DetailView" };
}
开发者ID:kevin3274,项目名称:eXpand,代码行数:7,代码来源:AttributeRegistrator.cs
示例20: ConstructorBlock
public ConstructorBlock(IEmitter emitter, ITypeInfo typeInfo, bool staticBlock)
: base(emitter, typeInfo.TypeDeclaration)
{
this.Emitter = emitter;
this.TypeInfo = typeInfo;
this.StaticBlock = staticBlock;
}
开发者ID:txdv,项目名称:Builder,代码行数:7,代码来源:ConstructorBlock.cs
注:本文中的ITypeInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论