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");
        }
Пример #2
0
        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();
        }
Пример #3
0
        private static bool NodeHasSameType(XamlType oldType, XamlInstruction instruction)
        {
            var xamlType = instruction.XamlType;
            if (xamlType != null)
            {
                var nodeHasSameType = xamlType.Equals(oldType);
                return nodeHasSameType;
            }

            return false;
        }
Пример #4
0
        private static bool NodeHasSameType(XamlType oldType, XamlInstruction instruction)
        {
            var xamlType = instruction.XamlType;

            if (xamlType != null)
            {
                var nodeHasSameType = xamlType.Equals(oldType);
                return(nodeHasSameType);
            }

            return(false);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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();
        }
Пример #7
0
 private static bool RaisesLevel(XamlInstruction current)
 {
     return(current.InstructionType.ToString().Contains("Start") || current.InstructionType == XamlInstructionType.GetObject);
 }
Пример #8
0
 private static bool LowersLevel(XamlInstruction current)
 {
     return(current.InstructionType.ToString().Contains("End"));
 }
Пример #9
0
 public void Process(XamlInstruction instruction)
 {
     objectAssembler.Process(instruction);
 }
Пример #10
0
 private static bool RaisesLevel(XamlInstruction current)
 {
     return current.InstructionType.ToString().Contains("Start") || current.InstructionType == XamlInstructionType.GetObject;
 }
Пример #11
0
 private static bool LowersLevel(XamlInstruction current)
 {
     return current.InstructionType.ToString().Contains("End");
 }
Пример #12
0
 public void AddNode(XamlInstruction instruction)
 {
     nodes.Enqueue(instruction);
 }
Пример #13
0
 public MemberNodesBlock(XamlInstruction headingInstruction)
 {
     member = (MutableXamlMember)headingInstruction.Member;
 }
Пример #14
0
 public void Process(XamlInstruction instruction)
 {
     objectAssembler.Process(instruction);
 }
Пример #15
0
 public void Process(XamlInstruction node)
 {
     _objectAssembler.Process(node);
 }
Пример #16
0
 public VisualizationNode(XamlInstruction xamlInstruction)
 {
     this.XamlInstruction = xamlInstruction;
     this.Children        = new Collection <VisualizationNode>();
 }
Пример #17
0
        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;
        }