コード例 #1
0
        public static RootElement TestElements()
        {
            RootElement re1 = new RootElement("re1");

            Debug.WriteLine(re1.ToString());
            Section s1 = new Section();

            Debug.WriteLine(s1.ToString());
            //Section s2 = new Section(new Android.Views.View(a1));
            //Debug.WriteLine(s2.ToString());
            Section s3 = new Section("s3");

            Debug.WriteLine(s3.ToString());
            //Section s4 = new Section
            //					(
            //					  new Android.Views.View(a1)
            //					, new Android.Views.View(a1)
            //					);
            //Debug.WriteLine(s4.ToString());
            Section s5 = new Section("caption", "footer");

            Debug.WriteLine(s5.ToString());

            StringElement se1 = new StringElement("se1");

            Debug.WriteLine(se1.ToString());
            StringElement se2 = new StringElement("se2", delegate() { });

            Debug.WriteLine(se2.ToString());
            //StringElement se3 = new StringElement("se3", 4);
            StringElement se4 = new StringElement("se4", "v4");

            Debug.WriteLine(se4.ToString());
            //StringElement se5 = new StringElement("se5", "v5", delegate() { });

            // removed - protected (all with LayoutID)
            // StringElement se6 = new StringElement("se6", "v6", 4);
            // Debug.WriteLine(se6.ToString());

            // not cross platform!
            // TODO: make it!?!?!?
            // AchievementElement

            BooleanElement be1 = new BooleanElement("be1", true);

            Debug.WriteLine(be1.ToString());
            BooleanElement be2 = new BooleanElement("be2", false, "key");

            Debug.WriteLine(be2.ToString());

            // Abstract
            // BoolElement be3 = new BoolElement("be3", true);

            CheckboxElement cb1 = new CheckboxElement("cb1");

            Debug.WriteLine(cb1.ToString());
            CheckboxElement cb2 = new CheckboxElement("cb2", true);

            Debug.WriteLine(cb2.ToString());
            CheckboxElement cb3 = new CheckboxElement("cb3", false, "group1");

            Debug.WriteLine(cb3.ToString());
            CheckboxElement cb4 = new CheckboxElement("cb4", false, "subcaption", "group2");

            Debug.WriteLine(cb4.ToString());

            DateElement de1 = new DateElement("dt1", DateTime.Now);

            Debug.WriteLine(de1.ToString());

            // TODO: see issues
            // https://github.com/kevinmcmahon/MonoDroid.Dialog/issues?page=1&state=open
            EntryElement ee1 = new EntryElement("ee1", "ee1");

            Debug.WriteLine(ee1.ToString());
            EntryElement ee2 = new EntryElement("ee2", "ee2 placeholder", "ee2 value");

            Debug.WriteLine(ee2.ToString());
            EntryElement ee3 = new EntryElement("ee3", "ee3 placeholder", "ee3 value", true);

            Debug.WriteLine(ee3.ToString());

            FloatElement fe1 = new FloatElement("fe1");

            Debug.WriteLine(fe1.ToString());
            FloatElement fe2 = new FloatElement(-0.1f, 0.1f, 3.2f);

            Debug.WriteLine(fe2.ToString());
            FloatElement fe3 = new FloatElement
                               (
                null
                , null                                                         // no ctors new Android.Graphics.Bitmap()
                , 1.0f
                               );

            Debug.WriteLine(fe3.ToString());

            HtmlElement he1 = new HtmlElement("he1", "http://holisiticware.net");

            Debug.WriteLine(he1.ToString());


            // TODO: image as filename - cross-platform
            ImageElement ie1 = new ImageElement(null);

            Debug.WriteLine(ie1.ToString());

            // TODO: not in Kevin's MA.D
            // ImageStringElement

            MultilineElement me1 = new MultilineElement("me1");

            Debug.WriteLine(me1.ToString());
            MultilineElement me2 = new MultilineElement("me2", delegate() { });

            Debug.WriteLine(me2.ToString());
            MultilineElement me3 = new MultilineElement("me3", "me3 value");

            Debug.WriteLine(me3.ToString());

            RadioElement rde1 = new RadioElement("rde1");

            Debug.WriteLine(rde1.ToString());
            RadioElement rde2 = new RadioElement("rde1", "group3");

            Debug.WriteLine(rde2.ToString());

            // TODO: not in Kevin's MA.D
            // StyledMultilineElement

            TimeElement te1 = new TimeElement("TimeElement", DateTime.Now);

            Debug.WriteLine(te1.ToString());



            re1.Add(s1);
            //re1.Add(s2);
            re1.Add(s3);
            //re1.Add(s4);
            re1.Add(s5);

            return(re1);
        }