コード例 #1
0
        public void NestedInterfacetest()
        {
            dynamic tNew = new ExpandoObject();

            tNew.NameLevel1        = "one";
            tNew.Nested            = new ExpandoObject();
            tNew.Nested.NameLevel2 = "two";

            INest tActsLike = Impromptu.ActLike <INest>(tNew);

            Assert.AreEqual(tNew.NameLevel1, tActsLike.NameLevel1);
            Assert.AreEqual(tNew.Nested.NameLevel2, tActsLike.Nested.NameLevel2);
        }
コード例 #2
0
        //@qdmfunction(Calls get line on each nested item implementing ILineConvertable or ILinesConvertable and returns as one line.*string)
        //@qdparam(element*The element.*HTMLElement)
        public static string GetNestedLine(HTMLElement element)
        {
            string line = "";

            if (typeof(INest).IsAssignableFrom(element.GetType()))
            {
                INest nest = (INest)element;

                foreach (HTMLElement nestedElement in nest.NestedElements)
                {
                    line += nestedElement.GetLine();
                }
                line += string.Format("</{0}>", element.name);
            }
            return(line);
        }
コード例 #3
0
        //@qdmfunction(Calls get lines on each nested item implementing ILinesConvertable and returns the lines in a big list.*List<string>)
        //@qdparam(element*The element.*HTMLElement)
        public static List <string> GetNestedLines(HTMLElement element)
        {
            List <string> lines = new List <string>();

            if (typeof(INest).IsAssignableFrom(element.GetType()))
            {
                INest nest = (INest)element;

                foreach (HTMLElement nestedElement in nest.NestedElements)
                {
                    lines = lines.Add(nestedElement.GetLines());
                }
                lines.Add(string.Format("</{0}>", element.name));
            }
            return(lines);
        }
コード例 #4
0
 public SecureNestProxy(INest nest)
 {
     this.nest = nest;
 }