Ejemplo n.º 1
0
        public void ApplyPropertiesVisitorVisit2()
        {
            tlog.Debug(tag, $"ApplyPropertiesVisitorVisit2 START");

            try
            {
                HydrationContext context       = new HydrationContext();
                object           o1            = new object();
                INodeImpl        nodeImplement = new INodeImpl();
                Assert.IsNotNull(nodeImplement, "null INodeImplement");

                IList <XmlType> list    = null;
                XmlType         xmlType = new XmlType("myNameSpace", "myName", list);
                Assert.IsNotNull(xmlType, "null XmlType");
                IXmlNamespaceResolverImplement ix1 = new IXmlNamespaceResolverImplement();
                Assert.IsNotNull(ix1, "null IXmlNamespaceResolverImplement");
                ElementNode n1 = new ElementNode(xmlType, "myNameSpace", ix1);
                Assert.IsNotNull(n1, "null ElementNode");
                context.Values[n1]            = o1;
                context.Values[nodeImplement] = o1;
                ApplyPropertiesVisitor a2 = new ApplyPropertiesVisitor(context, false);
                Assert.IsNotNull(a2, "null ApplyPropertiesVisitor");
                a2.Visit(n1, nodeImplement);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }
            tlog.Debug(tag, $"ApplyPropertiesVisitorVisit2 END");
        }
Ejemplo n.º 2
0
        public void ApplyPropertiesVisitorIsResourceDictionary()
        {
            tlog.Debug(tag, $"ApplyPropertiesVisitorIsResourceDictionary START");

            try
            {
                HydrationContext context = new HydrationContext();
                IList <XmlType>  list    = new List <XmlType>();
                XmlType          xmlType = new XmlType("myNameSpace", "myName", list);
                Assert.IsNotNull(xmlType, "null XmlType");
                IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
                Assert.IsNotNull(i1, "null IXmlNamespaceResolverImplement");
                ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
                Assert.IsNotNull(n1, "null ElementNode");
                context.Types[n1] = typeof(ResourceDictionary);
                ApplyPropertiesVisitor a2 = new ApplyPropertiesVisitor(context, false);
                Assert.IsNotNull(a2, "null ApplyPropertiesVisitor");
                bool b1 = a2.IsResourceDictionary(n1);
                Assert.True(b1, "Should be true");
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }
            tlog.Debug(tag, $"ApplyPropertiesVisitorIsResourceDictionary END");
        }
Ejemplo n.º 3
0
        public void ApplyPropertiesVisitorVisit1()
        {
            tlog.Debug(tag, $"ApplyPropertiesVisitorVisit1 START");

            try
            {
                HydrationContext context          = new HydrationContext();
                object           o1               = new object();
                IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
                Assert.IsNotNull(i1, "null IXmlNamespaceResolverImplement");
                ValueNode valueNode = new ValueNode(o1, i1);
                Assert.IsNotNull(valueNode, "null ValueNode");

                INodeImpl nodeImplement = new INodeImpl();
                Assert.IsNotNull(nodeImplement, "null INodeImplement");
                context.Values[valueNode]     = o1;
                context.Values[nodeImplement] = o1;
                ApplyPropertiesVisitor a2 = new ApplyPropertiesVisitor(context, false);
                Assert.IsNotNull(a2, "null ApplyPropertiesVisitor");
                a2.Visit(valueNode, nodeImplement);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }
            tlog.Debug(tag, $"ApplyPropertiesVisitorVisit1 END");
        }
Ejemplo n.º 4
0
        public void ExpandMarkupsVisitorIsResourceDictionary()
        {
            tlog.Debug(tag, $"ExpandMarkupsVisitorIsResourceDictionary START");

            try
            {
                IList <XmlType> list    = null;
                XmlType         xmlType = new XmlType("myNameSpace", "myName", list);
                Assert.IsNotNull(xmlType, "null XmlType");

                IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
                Assert.IsNotNull(i1, "null IXmlNamespaceResolverImplement");
                ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
                Assert.IsNotNull(n1, "null ElementNode");

                bool b1 = visitor.IsResourceDictionary(n1);
            }
            catch (Exception e)
            {
                Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"ExpandMarkupsVisitorIsResourceDictionary END");
        }
Ejemplo n.º 5
0
        public void XamlServiceProviderXamlTypeResolver()
        {
            tlog.Debug(tag, $"XamlServiceProviderXamlTypeResolver START");

            try
            {
                IXmlNamespaceResolverImplement xmlNamespaceResolverImplement = new IXmlNamespaceResolverImplement();
                AssemblyImplement currentAssembly  = new AssemblyImplement();
                XamlTypeResolver  xamlTypeResolver = new XamlTypeResolver(xmlNamespaceResolverImplement, currentAssembly);
            }
            catch (Exception e)
            {
                Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"XamlServiceProviderXamlTypeResolver END (OK)");
            Assert.Pass("XamlServiceProviderXamlTypeResolver");
        }
Ejemplo n.º 6
0
        public void FillResourceDictionariesVisitorIsResourceDictionary()
        {
            tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate START");

            try
            {
                IList <XmlType> list    = null;
                XmlType         xmlType = new XmlType("myNameSpace", "myName", list);

                IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
                ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);

                bool b1 = f1.IsResourceDictionary(n1);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate END (OK)");
                Assert.Pass("Caught Exception : passed!");
            }
        }
Ejemplo n.º 7
0
        public void ExpandMarkupsVisitorVisit()
        {
            tlog.Debug(tag, $"ExpandMarkupsVisitorVisit START");

            try
            {
                IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
                Assert.IsNotNull(i1, "null IXmlNamespaceResolverImplement");
                MarkupNode markupnode = new MarkupNode("markup", i1);
                Assert.IsNotNull(markupnode, "null MarkupNode");
                INodeImpl parentNode = new INodeImpl();
                Assert.IsNotNull(parentNode, "null INodeImplement");
                visitor.Visit(markupnode, parentNode);
            }
            catch (Exception e)
            {
                Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"ExpandMarkupsVisitorVisit END");
        }
Ejemplo n.º 8
0
        public void NamescopingVisitorIsResourceDictionary()
        {
            tlog.Debug(tag, $"NamescopingVisitorIsResourceDictionary START");

            try
            {
                Assert.IsNotNull(visitor, "null PruneIgnoredNodesVisitor");
                IList <XmlType> list    = null;
                XmlType         xmlType = new XmlType("myNameSpace", "myName", list);

                IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
                ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);

                bool b1 = visitor.IsResourceDictionary(n1);
            }
            catch (Exception e)
            {
                Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"NamescopingVisitorIsResourceDictionary END");
        }