Пример #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);
        }
 public SecureNestProxy(INest nest)
 {
     this.nest = nest;
 }