本文整理汇总了C#中PrivateType.GetStaticProperty方法的典型用法代码示例。如果您正苦于以下问题:C# PrivateType.GetStaticProperty方法的具体用法?C# PrivateType.GetStaticProperty怎么用?C# PrivateType.GetStaticProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrivateType
的用法示例。
在下文中一共展示了PrivateType.GetStaticProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static StorageContextAccessor Create()
{
var x = new PrivateType(typeof(StorageContext));
var y = (StorageContext)x.GetStaticProperty("Instance");
return new StorageContextAccessor(y);
}
示例2: GenericControlByField
public void GenericControlByField()
{
PrivateType t = new PrivateType(typeof(GenericFieldControl));
object obj = t.GetStaticProperty("ControlTable");
Dictionary<string, Type> qwer = (Dictionary<string, Type>)obj;
string message;
Assert.IsTrue(CheckTypes(typeof(ApprovingModeField), typeof(SnControls.DropDown), out message), message);
Assert.IsTrue(CheckTypes(typeof(BinaryField), typeof(SnControls.Binary), out message), message);
Assert.IsTrue(CheckTypes(typeof(BooleanField), typeof(SnControls.Boolean), out message), message);
Assert.IsTrue(CheckTypes(typeof(ChoiceField), typeof(SnControls.DropDown), out message), message);
Assert.IsTrue(CheckTypes(typeof(ColorField), typeof(SnControls.ShortText), out message), message);
Assert.IsTrue(CheckTypes(typeof(DateTimeField), typeof(SnControls.DatePicker), out message), message);
Assert.IsTrue(CheckTypes(typeof(HyperLinkField), typeof(SnControls.HyperLink), out message), message);
Assert.IsTrue(CheckTypes(typeof(InheritableApprovingModeField), typeof(SnControls.DropDown), out message), message);
Assert.IsTrue(CheckTypes(typeof(InheritableVersioningModeField), typeof(SnControls.DropDown), out message), message);
Assert.IsTrue(CheckTypes(typeof(IntegerField), typeof(SnControls.WholeNumber), out message), message);
Assert.IsTrue(CheckTypes(typeof(LockField), typeof(SnControls.ShortText), out message), message);
Assert.IsTrue(CheckTypes(typeof(LongTextField), typeof(SnControls.LongText), out message), message);
Assert.IsTrue(CheckTypes(typeof(NodeTypeField), typeof(SnControls.ShortText), out message), message);
Assert.IsTrue(CheckTypes(typeof(NumberField), typeof(SnControls.Number), out message), message);
Assert.IsTrue(CheckTypes(typeof(PasswordField), typeof(SnControls.Password), out message), message);
Assert.IsTrue(CheckTypes(typeof(ReferenceField), typeof(SnControls.ReferenceGrid), out message), message);
Assert.IsTrue(CheckTypes(typeof(SecurityField), typeof(SnControls.ShortText), out message), message);
Assert.IsTrue(CheckTypes(typeof(ShortTextField), typeof(SnControls.ShortText), out message), message);
//Assert.IsTrue(CheckTypes(typeof(SiteListField), typeof(SnControls.SiteList), out message), message);
Assert.IsTrue(CheckTypes(typeof(SiteRelativeUrlField), typeof(SnControls.SiteRelativeUrl), out message), message);
Assert.IsTrue(CheckTypes(typeof(UrlListField), typeof(SnControls.UrlList), out message), message);
Assert.IsTrue(CheckTypes(typeof(VersioningModeField), typeof(SnControls.DropDown), out message), message);
Assert.IsTrue(CheckTypes(typeof(WhoAndWhenField), typeof(SnControls.WhoAndWhen), out message), message);
}