本文整理汇总了C#中XamlType.GetAliasedProperty方法的典型用法代码示例。如果您正苦于以下问题:C# XamlType.GetAliasedProperty方法的具体用法?C# XamlType.GetAliasedProperty怎么用?C# XamlType.GetAliasedProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XamlType
的用法示例。
在下文中一共展示了XamlType.GetAliasedProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAliasedProperty
public void GetAliasedProperty ()
{
XamlMember xm;
var xt = new XamlType (typeof (SeverlyAliasedClass), new XamlSchemaContext (null, null));
xm = xt.GetAliasedProperty (XamlLanguage.Key);
Assert.IsNotNull (xm, "#1");
xm = xt.GetAliasedProperty (XamlLanguage.Name);
Assert.IsNotNull (xm, "#2");
xm = xt.GetAliasedProperty (XamlLanguage.Uid);
Assert.IsNotNull (xm, "#3");
xm = xt.GetAliasedProperty (XamlLanguage.Lang);
Assert.IsNotNull (xm, "#4");
xt = new XamlType (typeof (Dictionary<int,string>), xt.SchemaContext);
Assert.IsNull (xt.GetAliasedProperty (XamlLanguage.Key), "#5");
}
示例2: IsDirectiveAllowedOnNullInstance
private bool IsDirectiveAllowedOnNullInstance(XamlMember xamlMember, XamlType xamlType)
{
return ((xamlMember == XamlLanguage.Key) || ((xamlMember == XamlLanguage.Uid) && (null == xamlType.GetAliasedProperty(XamlLanguage.Uid))));
}
示例3: IsNameProperty
internal static bool IsNameProperty(XamlMember member, XamlType owner)
{
if (member == owner.GetAliasedProperty(XamlLanguage.Name)
|| XamlLanguage.Name == member)
{
return true;
}
return false;
}
示例4: GetKeyFromInstance
private object GetKeyFromInstance(object instance, XamlType instanceType, IAddLineInfo lineInfo)
{
XamlMember aliasedProperty = instanceType.GetAliasedProperty(XamlLanguage.Key);
if ((aliasedProperty == null) || (instance == null))
{
throw lineInfo.WithLineInfo(new XamlObjectWriterException(System.Xaml.SR.Get("MissingKey", new object[] { instanceType.Name })));
}
return this.Runtime.GetValue(instance, aliasedProperty);
}
示例5: Initialize
public void Initialize(XamlParserContext context, XamlType tagType, string ownerNamespace, bool tagIsRoot)
{
if (this.Kind != ScannerAttributeKind.Namespace)
{
this.Property = this.GetXamlAttributeProperty(context, this.Name, tagType, ownerNamespace, tagIsRoot);
if (this.Property.IsUnknown)
{
this.Kind = ScannerAttributeKind.Unknown;
}
else if (this.Property.IsEvent)
{
this.Kind = ScannerAttributeKind.Event;
}
else if (this.Property.IsDirective)
{
if (this.Property == XamlLanguage.Space)
{
this.Kind = ScannerAttributeKind.XmlSpace;
}
else if (((this.Property == XamlLanguage.FactoryMethod) || (this.Property == XamlLanguage.Arguments)) || ((this.Property == XamlLanguage.TypeArguments) || (this.Property == XamlLanguage.Base)))
{
this.Kind = ScannerAttributeKind.CtorDirective;
}
else
{
this.Kind = ScannerAttributeKind.Directive;
}
}
else if (this.Property.IsAttachable)
{
this.Kind = ScannerAttributeKind.AttachableProperty;
}
else if (this.Property == tagType.GetAliasedProperty(XamlLanguage.Name))
{
this.Kind = ScannerAttributeKind.Name;
}
else
{
this.Kind = ScannerAttributeKind.Property;
}
}
}