本文整理汇总了C#中ModuleWeaver.CheckForWarning方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleWeaver.CheckForWarning方法的具体用法?C# ModuleWeaver.CheckForWarning怎么用?C# ModuleWeaver.CheckForWarning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleWeaver
的用法示例。
在下文中一共展示了ModuleWeaver.CheckForWarning方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsIndexer
public void IsIndexer()
{
var checker = new ModuleWeaver();
var propertyDefinition = DefinitionFinder.FindType<IndexerClass>().Properties.First();
var message = checker.CheckForWarning(new PropertyData
{
PropertyDefinition = propertyDefinition,
},false);
Assert.IsNotNull(message);
}
示例2: IsAbstract
public void IsAbstract()
{
var checker = new ModuleWeaver();
var propertyDefinition = DefinitionFinder.FindType<BaseClass>().Properties.First(x => x.Name == "AbstractProperty");
var message = checker.CheckForWarning(new PropertyData
{
PropertyDefinition = propertyDefinition,
}, InvokerTypes.String);
Assert.IsNotNull(message);
}
示例3: WithGet
public void WithGet()
{
var checker = new ModuleWeaver();
var propertyDefinition = DefinitionFinder.FindProperty<PropertyChangingArgWithNoGetInfoCheckerTest>("PropertyWithGet");
var message = checker.CheckForWarning(new PropertyData
{
PropertyDefinition = propertyDefinition,
}, InvokerTypes.PropertyChangingArg);
Assert.IsNull(message);
}
示例4: NoGet
public void NoGet()
{
var checker = new ModuleWeaver();
var propertyDefinition = DefinitionFinder.FindProperty<BeforeAfterWithNoGetInfoCheckerTest>("PropertyNoGet");
var message = checker.CheckForWarning(new PropertyData
{
PropertyDefinition = propertyDefinition,
}, InvokerTypes.Before);
Assert.IsNotNull(message);
}
示例5: WithBackingField
public void WithBackingField()
{
var checker = new ModuleWeaver();
var propertyDefinition = DefinitionFinder.FindProperty(() => WithBackingFieldProperty);
var warning = checker.CheckForWarning(new PropertyData
{
PropertyDefinition = propertyDefinition,
BackingFieldReference = propertyDefinition.DeclaringType.Fields[0]
}, InvokerTypes.String);
Assert.IsNull(warning);
}
开发者ID:dj-pgs,项目名称:PropertyChanged,代码行数:13,代码来源:CheckForEqualityWithNoBackingFieldSetInfoCheckerTest.cs
示例6: WithoutBackingField
public void WithoutBackingField()
{
var checker = new ModuleWeaver();
var propertyDefinition = DefinitionFinder.FindProperty<CheckForEqualityWithNoBackingFieldSetInfoCheckerTest>("WithoutBackingFieldProperty");
var warning = checker.CheckForWarning(new PropertyData
{
PropertyDefinition = propertyDefinition,
BackingFieldReference = null,
}, InvokerTypes.String);
Assert.IsNotNull(warning);
}
开发者ID:dj-pgs,项目名称:PropertyChanged,代码行数:13,代码来源:CheckForEqualityWithNoBackingFieldSetInfoCheckerTest.cs
示例7: IsIndexer
public void IsIndexer()
{
var checker = new ModuleWeaver();
var propertyDefinition = DefinitionFinder.FindType<IndexerClass>()
.Properties
.First();
var propertyData = new PropertyData
{
PropertyDefinition = propertyDefinition,
};
var message = checker.CheckForWarning(propertyData, InvokerTypes.String);
Approvals.Verify(message);
}