示例#1
0
        public RelativeLayout getViewSlide()
        {
            if (_type == 1)
            {
                Template1 plantilla = new Template1(context);
                plantilla.Title      = _title;
                plantilla.Author     = _author;
                plantilla.Contenido  = _paragraph;
                plantilla.ImageUrl   = _imageurl;
                plantilla.ColorTexto = _colorS;
                //Console.WriteLine ("CREA PLANTILLAAAAAAAAA  111111");
                return(plantilla);
            }
            if (_type == 2)
            {
                Template2 plantilla = new Template2(context);
                plantilla.Title      = _title;
                plantilla.Contenido  = _paragraph;
                plantilla.ColorTexto = _colorS;

                //Console.WriteLine ("CREA PLANTILLAAAAAAAAA  222222");
                return(plantilla);
            }
            if (_type == 3)
            {
                Template3 plantilla = new Template3(context);
                plantilla.Title = _title;
                string [] lista = new string[_itemize.Count];
                for (int i = 0; i < _itemize.Count; i++)
                {
                    lista[i] = _itemize[i].Text;
                }
                //string[] lista = {"sdfsdf sdfs fsdf sf sdfs"," dfsdfsdf sdfsd fsd ds"," fsdf sfsdf sdfsd"," fdsfsdf sdfsdf sdfsf"};
                //Console.WriteLine ("CREA PLANTILLAAAAAAAAA  333333");
                plantilla.ListItems = lista;
                return(plantilla);
            }
            if (_type == 4)
            {
                Template4 plantilla = new Template4(context);
                return(plantilla);
                //Console.WriteLine ("CREA PLANTILLAAAAAAAAA  4444444444");
            }
            if (_type == 5)
            {
                PhraseView plantilla = new PhraseView(context);
                plantilla.Author        = _author;
                plantilla.Phrase        = _paragraph;
                plantilla.ImagenComilla = "icons/comillasa.png";
                plantilla.ImagenBarra   = "icons/lineafraseamarilla.png";
                //Console.WriteLine ("CREA PLANTILLAAAAAAAAA  5");
                return(plantilla);
            }
            if (_type == 6)
            {
                CustomerImageView plantilla = new CustomerImageView(context);
                plantilla.Title       = _title;
                plantilla.Description = _paragraph;
                plantilla.Imagen      = _imageurl;           //BitmapFactory.DecodeByteArray (_imagebytes, 0, _imagebytes.Length);
                plantilla.ColorTexto  = _colorS;
                return(plantilla);
            }

            if (_type == 7)
            {
                CustomerVideoView plantilla = new CustomerVideoView(context);
                plantilla.Title      = _title;
                plantilla.Imagen     = _imageurl;
                plantilla.ImagenPlay = "images/playa.png";
                return(plantilla);
            }
            return(null);
        }
示例#2
0
文件: Template.cs 项目: alakim/grains
 public void SimpleTableTest()
 {
     Template2 template = new Template2(new string[] {"Иванов", "Петров"}, new string[] {"444-4444", "222-2222" });
     Assert.AreEqual("<table border=\"0\"><tr><td>Иванов</td><td>444-4444</td></tr><tr><td>Петров</td><td>222-2222</td></tr></table>", template.Render());
 }
示例#3
0
        public RelativeLayout getViewSlide()
        {
            if (_type == 1)
            {
                Template1 plantilla = new Template1(context);
                plantilla.Title  = _title;
                plantilla.Author = _author;

                plantilla.ImageUrl   = _imageurl;              //<----------HUILLCA
                plantilla.Contenido  = eraseLastBR(_paragraph);;
                plantilla.ColorTexto = _colorS;
                //Console.WriteLine ("CREA PLANTILLAAAAAAAAA  111111");
                return(plantilla);
            }
            if (_type == 2)
            {
                Template2 plantilla = new Template2(context);

                if (_title == null)
                {
                    _title = " ";
                }
                List <string> elements = parseContent(_title);
                //Console.WriteLine (String.Format("Holaaaa {0}",elements.Count));


                if (elements.Count != 0 && elements [0] == "@")                  //Console.WriteLine (elements.ToString());
                {
                    plantilla.ColorBackgroundTemplate = elements [1];
                    plantilla.ColorTitle       = elements [2];
                    plantilla.ColorDescription = elements [2];
                }
                else
                {
                    plantilla.ColorTexto = _colorS;
                }


                plantilla.Title     = _title;
                plantilla.Contenido = eraseLastBR(_paragraph);

                /*Datos básicos*/
                if (_title.Equals("Datos básicos"))
                {
                    string pathImg = "mapas/" + replaceForImages(title_page) + ".png";
                    plantilla.Image = getBitmapFromAsset(pathImg);
                    Console.WriteLine(pathImg);
                }

                return(plantilla);
            }
            if (_type == 3)
            {
                Template3 plantilla = new Template3(context);
                plantilla.Title = _title;
                string [] lista = new string[_itemize.Count];
                for (int i = 0; i < _itemize.Count; i++)
                {
                    lista[i] = _itemize[i].Text;
                }
                plantilla.ListItems = lista;
                return(plantilla);
            }
            if (_type == 4)
            {
                Template4 plantilla = new Template4(context);
                return(plantilla);
                //Console.WriteLine ("CREA PLANTILLAAAAAAAAA  4444444444");
            }
            if (_type == 5)
            {
                PhraseView plantilla = new PhraseView(context);
                //plantilla.Author = _author;
                plantilla.Phrase = _paragraph;
                //plantilla.ImagenComilla = "icons/comillasa.png";
                //plantilla.ImagenBarra = "icons/lineafraseamarilla.png";
                //Console.WriteLine ("CREA PLANTILLAAAAAAAAA  5");
                return(plantilla);
            }
            if (_type == 6)
            {
                CustomerImageView plantilla = new CustomerImageView(context);
                plantilla.Title       = _title;
                plantilla.Description = _paragraph;
                plantilla.Imagen      = _imageurl;           //BitmapFactory.DecodeByteArray (_imagebytes, 0, _imagebytes.Length);
                plantilla.ColorTexto  = _colorS;
                return(plantilla);
            }

            if (_type == 7)
            {
                CustomerVideoView plantilla = new CustomerVideoView(context);
                plantilla.Title      = _title;
                plantilla.Imagen     = _imageurl;
                plantilla.ImagenPlay = "images/playa.png";
                return(plantilla);
            }
            return(null);
        }