예제 #1
0
        public virtual bool SetFontColor(string colorStr)
        {
            if (ViewX == null)
            {
                return(false);
            }

            Color color = UtilsDroid.String2Color(colorStr);

            if (ViewX is Button)
            {
                ((Button)ViewX).SetTextColor(color);
            }
            else if (ViewX is TextView)
            {
                ((TextView)ViewX).SetTextColor(color);
            }
            else if (ViewX is EditText)
            {
                ((EditText)ViewX).SetTextColor(color);
            }
            else
            {
                return(false);
            }
            return(true);
        }
예제 #2
0
        public virtual void AddText(string text, string colorStr, double alpha = 1.0)
        {
            var             color   = UtilsDroid.String2Color(colorStr);
            SpannableString newText = new SpannableString(text);

            newText.SetSpan(new ForegroundColorSpan(color), 0, text.Length,
                            SpanTypes.InclusiveExclusive);
            if (m_viewX is EditText)
            {
                var editTextView = m_viewX as EditText;
                if (editTextView.Text.Length > 0)
                {
                    editTextView.Append("\n");
                }
                editTextView.Append(newText);
            }
            else if (m_viewX is TextView)
            {
                var textView = m_viewX as TextView;
                if (textView.Text.Length > 0)
                {
                    textView.Append("\n");
                }
                textView.Append(newText);
            }
        }
예제 #3
0
파일: SfPdf.cs 프로젝트: ammogcoder/mobile
        public void AddImage(string imagePath, int x, int y, int w, int h)
        {
            Stream   pngImageStream = UTILS.ImageToStream(imagePath);
            PdfImage pngImage       = new PdfBitmap(pngImageStream);

            m_grapics.DrawImage(pngImage, x, y, w, h);
        }
예제 #4
0
        TTS(string voice)
        {
            m_language = UtilsDroid.LocaleFromString(voice, false);

            m_textToSpeech = new TextToSpeech(Application.Context, this, "com.google.android.tts");
            m_textToSpeech.SetLanguage(m_language);

            Console.WriteLine("Initializing TTS {0} --> {1}", voice, m_language);
        }
예제 #5
0
        public virtual void AdjustTranslation(DroidVariable location, bool isX, bool sameWidget = true)
        {
            int        offset     = 0;
            ScreenSize screenSize = UtilsDroid.GetScreenSize();

            if (isX && sameWidget && ViewX is Switch)
            {
                offset = (int)AutoScaleFunction.TransformSize(UtilsDroid.SWITCH_MARGIN, screenSize.Width, 3);
                if (screenSize.Width <= AutoScaleFunction.BASE_WIDTH)
                {
                    offset = UtilsDroid.SWITCH_MARGIN; // from -45, 480
                }
                //offset = -112; // (before -168) // from 1200
                //offset = -135; // from 1440
            }
            location.TranslationX += offset;
        }
예제 #6
0
        public virtual bool SetBackgroundColor(string colorStr, double alpha = 1.0)
        {
            if (ViewX == null)
            {
                return(false);
            }

            var color = UtilsDroid.String2Color(colorStr);

            if (alpha < 1.0)
            {
                color = Color.Argb((int)(alpha * 255), color.R, color.G, color.B);
            }
            ViewX.SetBackgroundColor(color);

            return(true);
        }
예제 #7
0
        public static List <int> GetPicList(List <string> items, string first = null)
        {
            List <int> pics = new List <int>();

            if (first != null)
            {
                pics.Add(-1);
            }
            for (int index = 0; index < items.Count; index++)
            {
                string item  = items[index];
                int    picId = UtilsDroid.String2Pic(item);
                pics.Add(picId);
            }

            return(pics);
        }
예제 #8
0
        public static JavaList <int> GetJavaPicList(List <string> items, string first = null)
        {
            JavaList <int> javaObjects = new JavaList <int>();

            if (first != null)
            {
                javaObjects.Add(-1);
            }
            for (int index = 0; index < items.Count; index++)
            {
                string item  = items[index];
                int    picId = UtilsDroid.String2Pic(item);
                javaObjects.Add(item);
            }

            return(javaObjects);
        }
예제 #9
0
        public void ProcessTranslationY(DroidVariable location)
        {
            if (location.RuleY == "CENTER" && WidgetType == UIType.LABEL)
            {
                int deltaY = (int)AutoScaleFunction.TransformSize(20, UtilsDroid.GetScreenSize().Width);;
                location.TranslationY += deltaY;
            }

            if (location.TranslationY < 0 && location.LayoutRuleY == LayoutRules.AlignParentTop)
            {
                location.TranslationY = 0;
            }
            else if (location.ViewY is Spinner)
            {
                if (location.LayoutRuleY == LayoutRules.AlignParentBottom ||
                    location.LayoutRuleY == LayoutRules.Below)
                {
                    location.ExtraY        = (int)AutoScaleFunction.TransformSize(10, UtilsDroid.GetScreenSize().Width);
                    location.TranslationY -= location.ExtraY;
                }
            }
        }
예제 #10
0
        public virtual bool AlignText(string alignment)
        {
            if (string.IsNullOrEmpty(alignment))
            {
                return(false);
            }
            alignment = alignment.ToLower();

            //m_viewX.TextAlignment = TextAlignment.Gravity;
            var al = UtilsDroid.GetAlignment(alignment);

            if (ViewX is Button)
            {
                ((Button)ViewX).Gravity       = al.Item1;
                ((Button)ViewX).TextAlignment = al.Item2;
            }
            else if (ViewX is TextView)
            {
                ((TextView)ViewX).Gravity       = al.Item1;
                ((TextView)ViewX).TextAlignment = al.Item2;
            }
            else if (ViewX is EditText)
            {
                ((EditText)ViewX).Gravity       = al.Item1;
                ((EditText)ViewX).TextAlignment = al.Item2;
            }
            else
            {
                return(false);
            }

            /*var layoutParams = ViewX.LayoutParameters as RelativeLayout.LayoutParams;
             * if (alignment == "center") {
             * layoutParams.AddRule(LayoutRules.CenterHorizontal);
             * }
             * ViewX.LayoutParameters = layoutParams;*/

            return(true);
        }
예제 #11
0
        public void AddImage(string imagePath,
                             float horizontalPosition = 0f,
                             float verticalPosition   = 0f,
                             string textWrap          = "InFrontOfText",
                             string horizontalOrigin  = "Margin",
                             string verticalOrigin    = "Margin",
                             float widthScale         = 20f,
                             float heightScale        = 20f)
        {
            CheckParagraph();

            Stream   imageStream = UTILS.ImageToStream(imagePath);
            WPicture picture     = m_paragraph.AppendPicture(imageStream) as WPicture;

            picture.TextWrappingStyle  = SfUtils.String2TextWrappingStyle(textWrap);
            picture.HorizontalOrigin   = SfUtils.String2HorizontalOrigin(horizontalOrigin);
            picture.HorizontalPosition = horizontalPosition;
            picture.VerticalOrigin     = SfUtils.String2VerticalOrigin(verticalOrigin);
            picture.VerticalPosition   = verticalPosition;
            picture.WidthScale         = widthScale;
            picture.HeightScale        = heightScale;
        }
예제 #12
0
        public virtual DroidVariable GetWidget(string widgetType, string widgetName, string initArg,
                                               int width, int height)
        {
            UIVariable.UIType type = UIVariable.UIType.NONE;
            View widget            = null;

            switch (widgetType)
            {
            case "View":
                type   = UIVariable.UIType.VIEW;
                widget = new View(MainActivity.TheView);
                break;

            case "Button":
                type   = UIVariable.UIType.BUTTON;
                widget = new Button(MainActivity.TheView);
                ((Button)widget).SetTextColor(Color.Black);
                ((Button)widget).Text = initArg;
                UtilsDroid.AddViewBorder(widget, Color.Black);
                break;

            case "TextView":
                type   = UIVariable.UIType.TEXT_VIEW;
                widget = new TextView(MainActivity.TheView);
                ((TextView)widget).SetTextColor(Color.Black);
                ((TextView)widget).Text                       = initArg;
                ((TextView)widget).Gravity                    = GravityFlags.Top | GravityFlags.Left;
                ((TextView)widget).TextAlignment              = TextAlignment.TextStart;
                ((TextView)widget).MovementMethod             = new ScrollingMovementMethod();
                ((TextView)widget).VerticalScrollBarEnabled   = true;
                ((TextView)widget).HorizontalScrollBarEnabled = true;
                //((TextView)widget).SetMaxLines(40);
                //((TextView)widget).ScrollBarStyle = ScrollbarStyles.OutsideOverlay;
                //((TextView)widget).ScrollBarSize = 2;
                break;

            case "Label":
                type   = UIVariable.UIType.LABEL;
                widget = new TextView(MainActivity.TheView);
                ((TextView)widget).SetTextColor(Color.Black);
                ((TextView)widget).Text    = initArg;
                ((TextView)widget).Gravity = GravityFlags.CenterVertical | GravityFlags.Left;
                break;

            case "TextEdit":
                type   = UIVariable.UIType.TEXT_FIELD;
                widget = new EditText(MainActivity.TheView);
                ((EditText)widget).SetTextColor(Color.Black);
                ((EditText)widget).SetBackgroundColor(Color.White);
                ((EditText)widget).SetTextIsSelectable(true);
                ((EditText)widget).Focusable     = true;
                ((EditText)widget).LongClickable = true;
                ((EditText)widget).Hint          = initArg;
                break;

            case "TextEditView":
                type   = UIVariable.UIType.EDIT_VIEW;
                widget = new EditText(MainActivity.TheView);
                ((EditText)widget).SetTextColor(Color.Black);
                ((EditText)widget).SetBackgroundColor(Color.White);
                ((EditText)widget).Hint                       = initArg;
                ((EditText)widget).Gravity                    = GravityFlags.Top | GravityFlags.Left;
                ((EditText)widget).TextAlignment              = TextAlignment.TextStart;
                ((EditText)widget).MovementMethod             = new ScrollingMovementMethod();
                ((EditText)widget).VerticalScrollBarEnabled   = true;
                ((EditText)widget).HorizontalScrollBarEnabled = true;
                ((EditText)widget).SetTextIsSelectable(true);
                ((EditText)widget).Focusable     = true;
                ((EditText)widget).LongClickable = true;
                break;

            case "ImageView":
                type   = UIVariable.UIType.IMAGE_VIEW;
                widget = new ImageView(MainActivity.TheView);
                if (!string.IsNullOrWhiteSpace(initArg))
                {
                    int resourceID = MainActivity.String2Pic(initArg);
                    widget.SetBackgroundResource(resourceID);
                }
                break;

            case "Combobox":
                type   = UIVariable.UIType.COMBOBOX;
                widget = new Spinner(MainActivity.TheView);
                ((Spinner)widget).DescendantFocusability = DescendantFocusability.BlockDescendants;
                break;

            case "TypePicker":
                type   = UIVariable.UIType.PICKER_VIEW;
                widget = new NumberPicker(MainActivity.TheView);
                // Don't show the cursor on the picker:
                ((NumberPicker)widget).DescendantFocusability = DescendantFocusability.BlockDescendants;
                break;

            case "Picker":
                type   = UIVariable.UIType.PICKER_IMAGES;
                widget = new Spinner(MainActivity.TheView);
                // Don't show the cursor on the picker:
                ((Spinner)widget).DescendantFocusability = DescendantFocusability.BlockDescendants;
                break;

            case "ListView":
                type   = UIVariable.UIType.LIST_VIEW;
                widget = new ListView(MainActivity.TheView);
                // Don't show the cursor on the list view:
                ((ListView)widget).DescendantFocusability = DescendantFocusability.BlockDescendants;
                break;

            case "Switch":
                type   = UIVariable.UIType.SWITCH;
                widget = new Switch(MainActivity.TheView);
                break;

            case "SegmentedControl":
                type   = UIVariable.UIType.SEGMENTED;
                widget = new Switch(MainActivity.TheView);
                //widget = new Info.Hoang8f.Android.Segmented.SegmentedGroup(MainActivity.TheView);
                break;

            case "Slider":
                type   = UIVariable.UIType.SLIDER;
                widget = new SeekBar(MainActivity.TheView);
                break;

            case "Stepper":
                type   = UIVariable.UIType.STEPPER;
                widget = new View(MainActivity.TheView);
                break;
            }

            DroidVariable widgetFunc = new DroidVariable(type, widgetName, widget);

            widgetFunc.AddAction(widgetName, widgetName + "_click");

            SetValues(widgetFunc, initArg);
            return(widgetFunc);
        }
예제 #13
0
        void Fake()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            // Creating a new document.
            // Creating a new document.
            WordDocument document = new WordDocument();
            //Adding a new section to the document.
            WSection section = document.AddSection() as WSection;

            //Set Margin of the section
            section.PageSetup.Margins.All = 72;
            //Set page size of the section
            section.PageSetup.PageSize = new Syncfusion.Drawing.SizeF(612, 792);

            //Create Paragraph styles
            WParagraphStyle style = document.AddParagraphStyle("Normal") as WParagraphStyle;

            style.CharacterFormat.FontName      = "Calibri";
            style.CharacterFormat.FontSize      = 11f;
            style.ParagraphFormat.BeforeSpacing = 0;
            style.ParagraphFormat.AfterSpacing  = 8;
            style.ParagraphFormat.LineSpacing   = 13.8f;

            style = document.AddParagraphStyle("Heading 1") as WParagraphStyle;
            style.ApplyBaseStyle("Normal");
            style.CharacterFormat.FontName      = "Calibri Light";
            style.CharacterFormat.FontSize      = 16f;
            style.CharacterFormat.TextColor     = Syncfusion.Drawing.Color.FromArgb(46, 116, 181);
            style.ParagraphFormat.BeforeSpacing = 12;
            style.ParagraphFormat.AfterSpacing  = 0;
            style.ParagraphFormat.Keep          = true;
            style.ParagraphFormat.KeepFollow    = true;
            style.ParagraphFormat.OutlineLevel  = OutlineLevel.Level1;
            IWParagraph paragraph = section.HeadersFooters.Header.AddParagraph();

            Stream imageStream = assembly.GetManifestResourceStream("Resources.drawable.Adventure_Cycle.jpg");

            imageStream = UTILS.ImageToStream("AdventureCycle");
            WPicture picture = paragraph.AppendPicture(imageStream) as WPicture;

            picture.TextWrappingStyle  = TextWrappingStyle.InFrontOfText;
            picture.VerticalOrigin     = VerticalOrigin.Margin;
            picture.VerticalPosition   = -24;
            picture.HorizontalOrigin   = HorizontalOrigin.Column;
            picture.HorizontalPosition = 263.5f;
            picture.WidthScale         = 20;
            picture.HeightScale        = 15;

            paragraph.ApplyStyle("Normal");
            paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Left;
            WTextRange textRange = paragraph.AppendText("Adventure Works Cycles") as WTextRange;

            textRange.CharacterFormat.FontSize  = 12f;
            textRange.CharacterFormat.FontName  = "Calibri";
            textRange.CharacterFormat.TextColor = Syncfusion.Drawing.Color.Red;

            //Appends paragraph.
            paragraph = section.AddParagraph();
            paragraph.ApplyStyle("Heading 1");
            paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
            textRange = paragraph.AppendText("Adventure Works Cycles") as WTextRange;
            textRange.CharacterFormat.FontSize = 18f;
            textRange.CharacterFormat.FontName = "Calibri";


            //Appends paragraph.
            paragraph = section.AddParagraph();
            paragraph.ParagraphFormat.FirstLineIndent = 36;
            paragraph.BreakCharacterFormat.FontSize   = 12f;
            textRange = paragraph.AppendText("Adventure Works Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company. The company manufactures and sells metal and composite bicycles to North American, European and Asian commercial markets. While its base operation is located in Bothell, Washington with 290 employees, several regional sales teams are located throughout their market base.") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;

            paragraph = section.AddParagraph();
            paragraph.ParagraphFormat.FirstLineIndent = 36;
            paragraph.BreakCharacterFormat.FontSize   = 12f;
            textRange = paragraph.AppendText("In 2000, Adventure Works Cycles bought a small manufacturing plant, Importadores Neptuno, located in Mexico. Importadores Neptuno manufactures several critical subcomponents for the Adventure Works Cycles product line. These subcomponents are shipped to the Bothell location for final product assembly. In 2001, Importadores Neptuno, became the sole manufacturer and distributor of the touring bicycle product group.") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;

            paragraph = section.AddParagraph();
            paragraph.ApplyStyle("Heading 1");
            paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Left;
            textRange = paragraph.AppendText("Product Overview") as WTextRange;
            textRange.CharacterFormat.FontSize = 16f;
            textRange.CharacterFormat.FontName = "Calibri";


            //Appends table.
            IWTable table = section.AddTable();

            table.ResetCells(3, 2);
            table.TableFormat.Borders.BorderType = Syncfusion.DocIO.DLS.BorderStyle.None;
            table.TableFormat.IsAutoResized      = true;

            //Appends paragraph.
            paragraph = table[0, 0].AddParagraph();
            paragraph.ParagraphFormat.AfterSpacing  = 0;
            paragraph.BreakCharacterFormat.FontSize = 12f;
            imageStream = assembly.GetManifestResourceStream("Resources.drawable.Mountain_200.jpg");
            imageStream = UTILS.ImageToStream("Mountain200");
            //Appends picture to the paragraph.
            picture = paragraph.AppendPicture(imageStream) as WPicture;
            picture.TextWrappingStyle  = TextWrappingStyle.TopAndBottom;
            picture.VerticalOrigin     = VerticalOrigin.Paragraph;
            picture.VerticalPosition   = 0;
            picture.HorizontalOrigin   = HorizontalOrigin.Column;
            picture.HorizontalPosition = -5.15f;
            picture.WidthScale         = 79;
            picture.HeightScale        = 79;

            //Appends paragraph.
            paragraph = table[0, 1].AddParagraph();
            paragraph.ApplyStyle("Heading 1");
            paragraph.ParagraphFormat.AfterSpacing = 0;
            paragraph.ParagraphFormat.LineSpacing  = 12f;
            paragraph.AppendText("Mountain-200");
            //Appends paragraph.
            paragraph = table[0, 1].AddParagraph();
            paragraph.ParagraphFormat.AfterSpacing  = 0;
            paragraph.ParagraphFormat.LineSpacing   = 12f;
            paragraph.BreakCharacterFormat.FontSize = 12f;
            paragraph.BreakCharacterFormat.FontName = "Times New Roman";

            textRange = paragraph.AppendText("Product No: BK-M68B-38\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Size: 38\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Weight: 25\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Price: $2,294.99\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";

            //Appends paragraph.
            paragraph = table[0, 1].AddParagraph();
            paragraph.ParagraphFormat.AfterSpacing  = 0;
            paragraph.ParagraphFormat.LineSpacing   = 12f;
            paragraph.BreakCharacterFormat.FontSize = 12f;

            //Appends paragraph.
            paragraph = table[1, 0].AddParagraph();
            paragraph.ApplyStyle("Heading 1");
            paragraph.ParagraphFormat.AfterSpacing = 0;
            paragraph.ParagraphFormat.LineSpacing  = 12f;
            paragraph.AppendText("Mountain-300 ");
            //Appends paragraph.
            paragraph = table[1, 0].AddParagraph();
            paragraph.ParagraphFormat.AfterSpacing  = 0;
            paragraph.ParagraphFormat.LineSpacing   = 12f;
            paragraph.BreakCharacterFormat.FontSize = 12f;
            paragraph.BreakCharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Product No: BK-M47B-38\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Size: 35\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Weight: 22\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Price: $1,079.99\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";

            //Appends paragraph.
            paragraph = table[1, 0].AddParagraph();
            paragraph.ParagraphFormat.AfterSpacing  = 0;
            paragraph.ParagraphFormat.LineSpacing   = 12f;
            paragraph.BreakCharacterFormat.FontSize = 12f;

            //Appends paragraph.
            paragraph = table[1, 1].AddParagraph();
            paragraph.ApplyStyle("Heading 1");
            paragraph.ParagraphFormat.LineSpacing = 12f;
            imageStream = assembly.GetManifestResourceStream("Resources.drawable.Mountain_300.jpg");
            imageStream = UTILS.ImageToStream("Mountain300");
            //Appends picture to the paragraph.
            picture = paragraph.AppendPicture(imageStream) as WPicture;
            picture.TextWrappingStyle  = TextWrappingStyle.TopAndBottom;
            picture.VerticalOrigin     = VerticalOrigin.Paragraph;
            picture.VerticalPosition   = 8.2f;
            picture.HorizontalOrigin   = HorizontalOrigin.Column;
            picture.HorizontalPosition = -14.95f;
            picture.WidthScale         = 75;
            picture.HeightScale        = 75;

            //Appends paragraph.
            paragraph = table[2, 0].AddParagraph();
            paragraph.ApplyStyle("Heading 1");
            paragraph.ParagraphFormat.LineSpacing = 12f;
            imageStream = assembly.GetManifestResourceStream("Resources.drawable.Road_550_W.jpg");
            imageStream = UTILS.ImageToStream("Road550W");
            //Appends picture to the paragraph.
            picture = paragraph.AppendPicture(imageStream) as WPicture;
            picture.TextWrappingStyle  = TextWrappingStyle.TopAndBottom;
            picture.VerticalOrigin     = VerticalOrigin.Paragraph;
            picture.VerticalPosition   = 0;
            picture.HorizontalOrigin   = HorizontalOrigin.Column;
            picture.HorizontalPosition = -4.9f;
            picture.WidthScale         = 92;
            picture.HeightScale        = 92;

            //Appends paragraph.
            paragraph = table[2, 1].AddParagraph();
            paragraph.ApplyStyle("Heading 1");
            paragraph.ParagraphFormat.AfterSpacing = 0;
            paragraph.ParagraphFormat.LineSpacing  = 12f;
            paragraph.AppendText("Road-150 ");
            //Appends paragraph.
            paragraph = table[2, 1].AddParagraph();
            paragraph.ParagraphFormat.AfterSpacing  = 0;
            paragraph.ParagraphFormat.LineSpacing   = 12f;
            paragraph.BreakCharacterFormat.FontSize = 12f;
            paragraph.BreakCharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Product No: BK-R93R-44\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Size: 44\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Weight: 14\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            textRange = paragraph.AppendText("Price: $3,578.27\r") as WTextRange;
            textRange.CharacterFormat.FontSize = 12f;
            textRange.CharacterFormat.FontName = "Times New Roman";
            //Appends paragraph.
            paragraph = table[2, 1].AddParagraph();
            paragraph.ApplyStyle("Heading 1");
            paragraph.ParagraphFormat.LineSpacing = 12f;

            //Appends paragraph.
            section.AddParagraph();
            MemoryStream stream = new MemoryStream();

            document.Save(stream, FormatType.Word2013);
            document.Close();
            if (stream != null)
            {
#if __ANDROID__
                SaveAndroid.Save("GettingStarted.docx", "application/msword", stream, MainActivity.TheView);
#endif
            }
        }
예제 #14
0
 public void SetPics(List <string> pics)
 {
     m_pics = UtilsDroid.GetPicList(pics, m_first);
 }