// TODO: Refactor this shit. private ProtoXamlInstruction ConvertAttributeToNode(XamlType containingType, AttributeAssignment rawAttributeAssignment) { MutableXamlMember member; if (rawAttributeAssignment.Locator.IsDotted) { member = GetMemberForDottedLocator(rawAttributeAssignment.Locator); } else { if (IsNameDirective(rawAttributeAssignment.Locator, containingType)) { return instructionBuilder.Directive(CoreTypes.Name, rawAttributeAssignment.Value); } member = containingType.GetMember(rawAttributeAssignment.Locator.PropertyName); } var namespaceDeclaration = new NamespaceDeclaration(rawAttributeAssignment.Locator.Namespace, rawAttributeAssignment.Locator.Prefix); return instructionBuilder.Attribute(member, rawAttributeAssignment.Value, namespaceDeclaration.Prefix); }
private ProtoXamlInstruction ConvertAttributeToNode(XamlType containingType, AttributeAssignment rawAttributeAssignment) { MutableXamlMember member; if (rawAttributeAssignment.Locator.IsDotted) { var ownerName = rawAttributeAssignment.Locator.Owner.PropertyName; var ownerPrefix = rawAttributeAssignment.Locator.Owner.Prefix; var owner = wiringContext.TypeContext.GetByPrefix(ownerPrefix, ownerName); member = owner.GetAttachableMember(rawAttributeAssignment.Locator.PropertyName); } else { member = containingType.GetMember(rawAttributeAssignment.Locator.PropertyName); } var namespaceDeclaration = new NamespaceDeclaration(rawAttributeAssignment.Locator.Namespace, rawAttributeAssignment.Locator.Prefix); return instructionBuilder.Attribute(member, rawAttributeAssignment.Value, namespaceDeclaration.Prefix); }
private ProtoXamlInstruction ConvertAttributeToNode(XamlType containingType, AttributeAssignment rawAttributeAssignment) { MutableXamlMember member; if (rawAttributeAssignment.Locator.IsDotted) { var ownerName = rawAttributeAssignment.Locator.Owner.PropertyName; var ownerPrefix = rawAttributeAssignment.Locator.Owner.Prefix; var owner = wiringContext.TypeContext.GetByPrefix(ownerPrefix, ownerName); member = owner.GetAttachableMember(rawAttributeAssignment.Locator.PropertyName); } else { member = containingType.GetMember(rawAttributeAssignment.Locator.PropertyName); } var namespaceDeclaration = new NamespaceDeclaration(rawAttributeAssignment.Locator.Namespace, rawAttributeAssignment.Locator.Prefix); return(instructionBuilder.Attribute(member, rawAttributeAssignment.Value, namespaceDeclaration.Prefix)); }
// TODO: Refactor this shit. private ProtoInstruction ConvertAttributeToNode(XamlType containingType, AttributeAssignment rawAttributeAssignment) { MutableMember member; if (rawAttributeAssignment.Locator.IsDotted) { member = GetMemberForDottedLocator(rawAttributeAssignment.Locator); } else { if (IsNameDirective(rawAttributeAssignment.Locator, containingType)) { return(instructionBuilder.Directive(CoreTypes.Name, rawAttributeAssignment.Value)); } member = containingType.GetMember(rawAttributeAssignment.Locator.PropertyName); } var namespaceDeclaration = new NamespaceDeclaration(rawAttributeAssignment.Locator.Namespace, rawAttributeAssignment.Locator.Prefix); return(instructionBuilder.Attribute(member, rawAttributeAssignment.Value, namespaceDeclaration.Prefix)); }
private static bool IsNsThatMatchesSpecialValue(AttributeAssignment assignment) { return(assignment.Locator.IsNsPrefixDefinition && assignment.Value == CoreTypes.SpecialNamespace); }
private static DirectiveAssignment ExtractDirectives(AttributeAssignment assignment) { var xamlDirective = CoreTypes.GetDirective(assignment.Locator.PropertyName); return(new DirectiveAssignment(xamlDirective, assignment.Value)); }
private bool IsDirective(AttributeAssignment attributeAssignment) { return(attributeAssignment.Locator.Prefix == specialPrefix); }
private bool IsAttribute(AttributeAssignment assignment) { return(!IsDirective(assignment) && !IsNamespaceDefinition(assignment)); }
private static bool IsNamespaceDefinition(AttributeAssignment assignment) { return(assignment.Locator.IsNsPrefixDefinition); }
private static bool IsNsThatMatchesSpecialValue(AttributeAssignment assignment) { return assignment.Locator.IsNsPrefixDefinition && assignment.Value == CoreTypes.SpecialNamespace; }
private bool IsDirective(AttributeAssignment attributeAssignment) { return attributeAssignment.Locator.Prefix == specialPrefix; }
private static DirectiveAssignment ExtractDirectives(AttributeAssignment assignment) { var xamlDirective = CoreTypes.GetDirective(assignment.Locator.PropertyName); return new DirectiveAssignment(xamlDirective, assignment.Value); }
private static bool IsNamespaceDefinition(AttributeAssignment assignment) { return assignment.Locator.IsNsPrefixDefinition; }
private bool IsAttribute(AttributeAssignment assignment) { return !IsDirective(assignment) && !IsNamespaceDefinition(assignment); }