本文整理汇总了C#中System.Xaml.XamlMember类的典型用法代码示例。如果您正苦于以下问题:C# XamlMember类的具体用法?C# XamlMember怎么用?C# XamlMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XamlMember类属于System.Xaml命名空间,在下文中一共展示了XamlMember类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: XamlSetTypeConverterEventArgs
public XamlSetTypeConverterEventArgs (XamlMember member, TypeConverter typeConverter, object value, ITypeDescriptorContext serviceProvider, CultureInfo cultureInfo)
: base (member, value)
{
CultureInfo = cultureInfo;
ServiceProvider = serviceProvider;
TypeConverter = typeConverter;
}
开发者ID:nagyist,项目名称:XamlForIphone,代码行数:7,代码来源:XamlSetTypeConverterEventArgs.cs
示例2: XamlDomMember
public XamlDomMember(XamlMember xamlMember)
{
_member = xamlMember;
if (xamlMember != null)
{
_schemaContext = xamlMember.Type.SchemaContext;
}
}
开发者ID:siwuxian,项目名称:WinObjC,代码行数:8,代码来源:XamlDomMember.cs
示例3: XamlMemberInvoker
public XamlMemberInvoker(XamlMember member)
{
if (member == null)
{
throw new ArgumentNullException("member");
}
this._member = member;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:XamlMemberInvoker.cs
示例4: LookupPrefix
private string LookupPrefix(XamlMember property)
{
string str;
string prefix = this.xamlXmlWriter.LookupPrefix(property.GetXamlNamespaces(), out str);
if ((prefix == null) && !this.meSettings.ContinueWritingWhenPrefixIsNotFound)
{
this.failed = true;
return string.Empty;
}
return prefix;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:XamlMarkupExtensionWriter.cs
示例5: CheckMemberForUniqueness
private void CheckMemberForUniqueness(Node objectNode, XamlMember property)
{
if (!this.settings.AssumeValidInput)
{
if (objectNode.Members == null)
{
objectNode.Members = new XamlPropertySet();
}
else if (objectNode.Members.Contains(property))
{
throw new InvalidOperationException(System.Xaml.SR.Get("XamlMarkupExtensionWriterDuplicateMember", new object[] { property.Name }));
}
objectNode.Members.Add(property);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:XamlMarkupExtensionWriter.cs
示例6: AddDependencyForUnresolvedChildren
private void AddDependencyForUnresolvedChildren(object childThatHasUnresolvedChildren, XamlMember property, object parentInstance, XamlType parentType, bool parentIsGotten, XamlSavedContext deferredMarkupExtensionContext)
{
if (((property != null) && property.IsDirective) && ((parentInstance == null) && (property != XamlLanguage.Key)))
{
List<string> result = new List<string>();
this._nameFixupGraph.GetDependentNames(childThatHasUnresolvedChildren, result);
string str = string.Join(", ", result.ToArray());
throw this.WithLineInfo(new XamlObjectWriterException(System.Xaml.SR.Get("TransitiveForwardRefDirectives", new object[] { childThatHasUnresolvedChildren.GetType(), property, str })));
}
NameFixupToken token = this.GetTokenForUnresolvedChildren(childThatHasUnresolvedChildren, property, deferredMarkupExtensionContext);
token.Target.Instance = parentInstance;
token.Target.InstanceType = parentType;
token.Target.InstanceWasGotten = parentIsGotten;
this.PendCurrentFixupToken_SetValue(token);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:XamlObjectWriter.cs
示例7: Set
internal void Set(XamlMember member)
{
if (FrameType != XamlStackFrameType.Object && FrameType != XamlStackFrameType.GetObject)
{
throw FxTrace.Exception.AsError(new InvalidOperationException(SR.UnexpectedXaml));
}
HashSet<XamlMember> setMembers = _isSet as HashSet<XamlMember>;
if (setMembers == null)
{
setMembers = new HashSet<XamlMember>();
_isSet = setMembers;
}
if (!setMembers.Contains(member))
{
setMembers.Add(member);
}
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:17,代码来源:XamlStackWriter.cs
示例8: Logic_PushAndPopAProvideValueStackFrame
private object Logic_PushAndPopAProvideValueStackFrame(ObjectWriterContext ctx, XamlMember prop, MarkupExtension me, bool useIRME)
{
XamlMember currentProperty = ctx.CurrentProperty;
ctx.CurrentProperty = prop;
ctx.PushScope();
ctx.CurrentInstance = me;
object obj2 = null;
if (useIRME)
{
this.Logic_AssignProvidedValue(ctx);
}
else
{
obj2 = this.Runtime.CallProvideValue(me, ctx.ServiceProviderContext);
}
ctx.PopScope();
ctx.CurrentProperty = currentProperty;
return obj2;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:XamlObjectWriter.cs
示例9: Logic_CreateFromValue
private object Logic_CreateFromValue(ObjectWriterContext ctx, XamlValueConverter<TypeConverter> typeConverter, object value, XamlMember property, string targetName, IAddLineInfo lineInfo)
{
object obj3;
try
{
obj3 = this.Runtime.CreateFromValue(ctx.ServiceProviderContext, typeConverter, value, property);
}
catch (Exception exception)
{
if (CriticalExceptions.IsCriticalException(exception))
{
throw;
}
string message = System.Xaml.SR.Get("TypeConverterFailed", new object[] { targetName, value });
throw lineInfo.WithLineInfo(new XamlObjectWriterException(message, exception));
}
return obj3;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:XamlObjectWriter.cs
示例10: Logic_ApplyPropertyValue
private void Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, object value, bool onParent)
{
object inst = onParent ? ctx.ParentInstance : ctx.CurrentInstance;
if (value is XData)
{
XData xData = value as XData;
if (prop.Type.IsXData)
{
this.Runtime.SetXmlInstance(inst, prop, xData);
return;
}
value = xData.Text;
}
this.SetValue(inst, prop, value);
if (prop.IsDirective)
{
XamlMember aliasedProperty = (onParent ? ctx.ParentType : ctx.CurrentType).GetAliasedProperty(prop as XamlDirective);
if ((prop != XamlLanguage.Key) && (aliasedProperty != null))
{
this.Logic_DuplicatePropertyCheck(ctx, aliasedProperty, onParent);
object obj3 = this.Logic_CreateFromValue(ctx, aliasedProperty.TypeConverter, value, aliasedProperty, aliasedProperty.Name);
this.SetValue(inst, aliasedProperty, obj3);
}
if (prop == XamlLanguage.Name)
{
if (inst == ctx.CurrentInstance)
{
this.Logic_RegisterName_OnCurrent(ctx, (string) value);
}
else
{
this.Logic_RegisterName_OnParent(ctx, (string) value);
}
}
else if (prop == XamlLanguage.ConnectionId)
{
this.Logic_SetConnectionId(ctx, (int) value, inst);
}
else if (prop == XamlLanguage.Base)
{
this.Logic_CheckBaseUri(ctx, (string) value);
ctx.BaseUri = new Uri((string) value);
if (ctx.ParentInstance != null)
{
this.Runtime.SetUriBase(ctx.ParentType, ctx.ParentInstance, ctx.BaseUri);
}
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:49,代码来源:XamlObjectWriter.cs
示例11: IsTextConstructionDirective
private bool IsTextConstructionDirective(XamlMember xamlMember)
{
if (((xamlMember != XamlLanguage.Arguments) && (xamlMember != XamlLanguage.FactoryMethod)) && (xamlMember != XamlLanguage.PositionalParameters))
{
return (xamlMember == XamlLanguage.TypeArguments);
}
return true;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:XamlObjectWriter.cs
示例12: IsDirectiveAllowedOnNullInstance
private bool IsDirectiveAllowedOnNullInstance(XamlMember xamlMember, XamlType xamlType)
{
return ((xamlMember == XamlLanguage.Key) || ((xamlMember == XamlLanguage.Uid) && (null == xamlType.GetAliasedProperty(XamlLanguage.Uid))));
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:XamlObjectWriter.cs
示例13: TestMemberCommon
void TestMemberCommon (XamlMember m, string name, Type type, Type declType, bool hasSetter)
{
Assert.IsNotNull (m, "#1");
Assert.IsNotNull (m.DeclaringType, "#2");
Assert.AreEqual (declType, m.DeclaringType.UnderlyingType, "#2-2");
Assert.IsNotNull (m.Invoker, "#3");
Assert.IsNotNull (m.Invoker.UnderlyingGetter, "#3-2");
if (hasSetter)
Assert.IsNotNull (m.Invoker.UnderlyingSetter, "#3-3");
else
Assert.IsNull (m.Invoker.UnderlyingSetter, "#3-3");
Assert.IsFalse (m.IsUnknown, "#4");
Assert.IsTrue (m.IsReadPublic, "#5");
Assert.AreEqual (hasSetter, m.IsWritePublic, "#6");
Assert.AreEqual (name, m.Name, "#7");
Assert.IsTrue (m.IsNameValid, "#8");
Assert.AreEqual (XamlLanguage.Xaml2006Namespace, m.PreferredXamlNamespace, "#9");
// use declType here (mostly identical to targetType)
Assert.AreEqual (new XamlType (declType, m.TargetType.SchemaContext), m.TargetType, "#10");
Assert.IsNotNull (m.Type, "#11");
Assert.AreEqual (type, m.Type.UnderlyingType, "#11-2");
// Property.Type is a special case here.
if (name == "Type" && m.DeclaringType != XamlLanguage.Property)
Assert.AreEqual (m.Type.TypeConverter, m.TypeConverter, "#12");
// String type is a special case here.
if (type == typeof (string))
Assert.AreEqual (m.Type.ValueSerializer, m.ValueSerializer, "#13a");
else
Assert.IsNull (m.ValueSerializer, "#13b");
Assert.IsNull (m.DeferringLoader, "#14");
Assert.IsNotNull (m.UnderlyingMember, "#15");
Assert.AreEqual (!hasSetter, m.IsReadOnly, "#16");
Assert.IsFalse (m.IsWriteOnly, "#17");
Assert.IsFalse (m.IsAttachable, "#18");
Assert.IsFalse (m.IsEvent, "#19");
Assert.IsFalse (m.IsDirective, "#20");
Assert.IsNotNull (m.DependsOn, "#21");
Assert.AreEqual (0, m.DependsOn.Count, "#21-2");
Assert.IsFalse (m.IsAmbient, "#22");
}
开发者ID:jdecuyper,项目名称:mono,代码行数:40,代码来源:XamlLanguageTest.cs
示例14: GetNodes
IEnumerable<XamlNodeInfo> GetNodes (XamlMember xm, XamlObject xobj)
{
return GetNodes (xm, xobj, null, false);
}
开发者ID:nagyist,项目名称:XamlForIphone,代码行数:4,代码来源:XamlObjectNodeIterator.cs
示例15: GetItemsNodes
IEnumerable<XamlNodeInfo> GetItemsNodes (XamlMember xm, XamlObject xobj)
{
var obj = xobj.GetRawValue ();
if (obj == null)
yield break;
var ie = xobj.Type.Invoker.GetItems (obj);
while (ie.MoveNext ()) {
var iobj = ie.Current;
// If it is dictionary, then retrieve the key, and rewrite the item as the Value part.
object ikey = null;
if (xobj.Type.IsDictionary) {
Type kvpType = iobj.GetType ();
bool isNonGeneric = kvpType == typeof (DictionaryEntry);
var kp = isNonGeneric ? null : kvpType.GetProperty ("Key");
var vp = isNonGeneric ? null : kvpType.GetProperty ("Value");
ikey = isNonGeneric ? ((DictionaryEntry) iobj).Key : kp.GetValue (iobj, null);
iobj = isNonGeneric ? ((DictionaryEntry) iobj).Value : vp.GetValue (iobj, null);
}
var wobj = TypeExtensionMethods.GetExtensionWrapped (iobj);
var xiobj = new XamlObject (GetType (wobj), wobj);
if (ikey != null) {
// Key member is written *inside* the item object.
//
// It is messy, but Key and Value are *sorted*. In most cases Key goes first, but for example PositionalParameters comes first.
// To achieve this behavior, we compare XamlLanguage.Key and value's Member and returns in order. It's all nasty hack, but at least it could be achieved like this!
var en = GetNodes (null, xiobj).ToArray ();
yield return en [0]; // StartObject
var xknm = new XamlNodeMember (xobj, XamlLanguage.Key);
var nodes1 = en.Skip (1).Take (en.Length - 2);
var nodes2 = GetKeyNodes (ikey, xobj.Type.KeyType, xknm);
foreach (var xn in EnumerateMixingMember (nodes1, XamlLanguage.Key, nodes2))
yield return xn;
yield return en [en.Length - 1];
}
else
foreach (var xn in GetNodes (null, xiobj))
yield return xn;
}
}
开发者ID:nagyist,项目名称:XamlForIphone,代码行数:42,代码来源:XamlObjectNodeIterator.cs
示例16: Logic_DuplicatePropertyCheck
private void Logic_DuplicatePropertyCheck(ObjectWriterContext ctx, XamlMember property, bool onParent)
{
if (!this._skipDuplicatePropertyCheck)
{
System.Xaml.Context.HashSet<XamlMember> set = onParent ? ctx.ParentAssignedProperties : ctx.CurrentAssignedProperties;
if (set.ContainsKey(property))
{
if (property != XamlLanguage.Space)
{
XamlType type = onParent ? ctx.ParentType : ctx.CurrentType;
throw this.WithLineInfo(new XamlDuplicateMemberException(property, type));
}
}
else
{
set.Add(property);
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:XamlObjectWriter.cs
示例17: ValidateUnknown
private void ValidateUnknown(XamlMember member)
{
if (member == XamlLanguage.UnknownContent)
{
ValidationError(SR.MemberUnknownContect(GetXamlTypeName(_stack.TopFrame.Type)));
}
else if (member.IsUnknown)
{
bool retryAttachable = false;
XamlType declaringType = member.DeclaringType;
if (_stack.Depth == 1 && declaringType.IsUnknown &&
!string.IsNullOrEmpty(this.rootNamespace) &&
this.definedType != null && declaringType.Name == this.definedType.Name)
{
// Need to handle the case where the namespace of a member on the document root
// is missing the project root namespace
string clrNs;
if (XamlBuildTaskServices.TryExtractClrNs(declaringType.PreferredXamlNamespace, out clrNs))
{
clrNs = string.IsNullOrEmpty(clrNs) ? this.rootNamespace : this.rootNamespace + "." + clrNs;
if (clrNs == this.definedType.Namespace)
{
declaringType = SchemaContext.GetXamlType(this.definedType);
retryAttachable = true;
}
}
}
XamlMember typeMember = declaringType.GetMember(member.Name);
if (typeMember == null && retryAttachable)
{
typeMember = declaringType.GetAttachableMember(member.Name);
}
if (typeMember == null || typeMember.IsUnknown)
{
if (member.IsAttachable)
{
ValidationError(SR.UnresolvedAttachableMember(GetXamlTypeName(member.DeclaringType) + "." + member.Name));
}
else if (member.IsDirective)
{
ValidationError(SR.UnresolvedDirective(member.PreferredXamlNamespace + ":" + member.Name));
}
else
{
// Skip if declaring type is unknown as the member unknown error messages become redundant.
if (declaringType != null && !declaringType.IsUnknown)
{
ValidationError(SR.UnresolvedMember(member.Name, GetXamlTypeName(declaringType)));
}
}
}
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:53,代码来源:XamlValidatingReader.cs
示例18: AllowsMultiple
private bool AllowsMultiple(XamlMember member)
{
return
member == XamlLanguage.Items ||
member == XamlLanguage.PositionalParameters ||
member == XamlLanguage.UnknownContent;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:XamlValidatingReader.cs
示例19: XamlMemberInvokerAdapter
public XamlMemberInvokerAdapter(XamlMember member) : base(member)
{
this.member = member;
}
开发者ID:modulexcite,项目名称:OmniXAML,代码行数:4,代码来源:XamlMemberInvokerAdapter.cs
示例20: OnSetValue
protected virtual bool OnSetValue(object eventSender, XamlMember member, object value)
{
if (this._xamlSetValueHandler != null)
{
XamlSetValueEventArgs e = new XamlSetValueEventArgs(member, value);
this._xamlSetValueHandler(eventSender, e);
return e.Handled;
}
return false;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:XamlObjectWriter.cs
注:本文中的System.Xaml.XamlMember类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论