コード例 #1
0
        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
ファイル: ObjectAssembler.cs プロジェクト: lairtonb/OmniXAML
        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
ファイル: Hydrator.cs プロジェクト: furesoft/OmniXAML
        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
ファイル: NodeVisualizer.cs プロジェクト: keichinger/OmniXAML
 private static bool RaisesLevel(XamlInstruction current)
 {
     return(current.InstructionType.ToString().Contains("Start") || current.InstructionType == XamlInstructionType.GetObject);
 }
コード例 #8
0
ファイル: NodeVisualizer.cs プロジェクト: keichinger/OmniXAML
 private static bool LowersLevel(XamlInstruction current)
 {
     return(current.InstructionType.ToString().Contains("End"));
 }
コード例 #9
0
ファイル: ObjectAssembler.cs プロジェクト: rdterner/OmniXAML
 public void Process(XamlInstruction instruction)
 {
     objectAssembler.Process(instruction);
 }
コード例 #10
0
ファイル: NodeVisualizer.cs プロジェクト: rdterner/OmniXAML
 private static bool RaisesLevel(XamlInstruction current)
 {
     return current.InstructionType.ToString().Contains("Start") || current.InstructionType == XamlInstructionType.GetObject;
 }
コード例 #11
0
ファイル: NodeVisualizer.cs プロジェクト: rdterner/OmniXAML
 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
ファイル: Hydrator.cs プロジェクト: furesoft/OmniXAML
        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;
        }