private static NodeType GetNodeType(XamlInstruction current) { switch (current.InstructionType) { case XamlInstructionType.StartMember: case XamlInstructionType.EndMember: return(NodeType.Member); case XamlInstructionType.StartObject: case XamlInstructionType.EndObject: return(NodeType.Object); case XamlInstructionType.GetObject: return(NodeType.GetObject); case XamlInstructionType.NamespaceDeclaration: return(NodeType.NamespaceDeclaration); case XamlInstructionType.Value: return(NodeType.Value); case XamlInstructionType.None: return(NodeType.Root); } throw new InvalidOperationException("Cannot translate the type"); }
public void Process(XamlInstruction instruction) { Command command; switch (instruction.InstructionType) { case XamlInstructionType.NamespaceDeclaration: command = new NamespaceDeclarationCommand(this, instruction.NamespaceDeclaration); break; case XamlInstructionType.StartObject: command = new StartObjectCommand(this, instruction.XamlType, rootInstance); break; case XamlInstructionType.StartMember: command = new StartMemberCommand(this, GetMember(instruction.Member)); break; case XamlInstructionType.Value: command = new ValueCommand(this, topDownValueContext, (string)instruction.Value); break; case XamlInstructionType.EndObject: command = new EndObjectCommand(this); break; case XamlInstructionType.EndMember: command = new EndMemberCommand(this, topDownValueContext); break; case XamlInstructionType.GetObject: command = new GetObjectCommand(this); break; default: throw new XamlParseException($"The XamlInstructionType {instruction.InstructionType} has an unexpected value"); } command.Execute(); }
private static bool NodeHasSameType(XamlType oldType, XamlInstruction instruction) { var xamlType = instruction.XamlType; if (xamlType != null) { var nodeHasSameType = xamlType.Equals(oldType); return nodeHasSameType; } return false; }
private static bool NodeHasSameType(XamlType oldType, XamlInstruction instruction) { var xamlType = instruction.XamlType; if (xamlType != null) { var nodeHasSameType = xamlType.Equals(oldType); return(nodeHasSameType); } return(false); }
private Type GetMatchedInflatable(XamlInstruction xamlInstruction) { if (xamlInstruction.XamlType != null) { var matches = from inflatable in inflatables where inflatable.IsAssignableFrom(xamlInstruction.XamlType.UnderlyingType) select inflatable; return(matches.FirstOrDefault()); } return(null); }
private static bool RaisesLevel(XamlInstruction current) { return(current.InstructionType.ToString().Contains("Start") || current.InstructionType == XamlInstructionType.GetObject); }
private static bool LowersLevel(XamlInstruction current) { return(current.InstructionType.ToString().Contains("End")); }
public void Process(XamlInstruction instruction) { objectAssembler.Process(instruction); }
private static bool RaisesLevel(XamlInstruction current) { return current.InstructionType.ToString().Contains("Start") || current.InstructionType == XamlInstructionType.GetObject; }
private static bool LowersLevel(XamlInstruction current) { return current.InstructionType.ToString().Contains("End"); }
public void AddNode(XamlInstruction instruction) { nodes.Enqueue(instruction); }
public MemberNodesBlock(XamlInstruction headingInstruction) { member = (MutableXamlMember)headingInstruction.Member; }
public void Process(XamlInstruction node) { _objectAssembler.Process(node); }
public VisualizationNode(XamlInstruction xamlInstruction) { this.XamlInstruction = xamlInstruction; this.Children = new Collection <VisualizationNode>(); }
private Type GetMatchedInflatable(XamlInstruction xamlInstruction) { if (xamlInstruction.XamlType != null) { var matches = from inflatable in inflatables where inflatable.IsAssignableFrom(xamlInstruction.XamlType.UnderlyingType) select inflatable; return matches.FirstOrDefault(); } return null; }