Пример #1
0
        public override void Execute(GrapeCity.Documents.Excel.Workbook workbook)
        {
            IWorksheet worksheet = workbook.Worksheets[0];

            IRange b2 = worksheet.Range["B2"];

            b2.Value               = "GrapeCity Documents for Excel";
            b2.Font.Size           = 26;
            b2.EntireRow.RowHeight = 42;

            // customize the 'GrapeCity' run
            ITextRun run1 = b2.Characters(0, 9);

            run1.Font.Name       = "Agency FB";
            run1.Font.ThemeColor = ThemeColor.Accent1;
            run1.Font.Bold       = true;

            // customize the 'Documents' run
            ITextRun run2 = b2.Characters(10, 9);

            run2.Font.ThemeColor = ThemeColor.Accent2;
            run2.Font.Name       = "Arial Black";
            run2.Font.Underline  = UnderlineType.Single;

            // customize the 'for' run
            ITextRun run3 = b2.Characters(20, 3);

            run3.Font.Italic = true;

            // customize the 'Excel' run
            ITextRun run4 = b2.Characters(24, 5);

            run4.Font.Color = System.Drawing.Color.Blue;
            run4.Font.Bold  = true;
        }
Пример #2
0
 public bool Equals(ITextRun other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.SourceFile, SourceFile) && other.StartLine == StartLine && other.StartColumn == StartColumn && other.EndLine == EndLine && other.EndColumn == EndColumn);
 }
Пример #3
0
        public override void Execute(GrapeCity.Documents.Excel.Workbook workbook)
        {
            IWorksheet worksheet = workbook.Worksheets[0];

            IRange a2 = worksheet.Range["A2"];

            a2.Font.Size         = 18;
            a2.Font.Bold         = true;
            a2.VerticalAlignment = VerticalAlignment.Center;

            a2.EntireRow.RowHeight      = 42;
            a2.EntireColumn.ColumnWidth = 40;
            a2.Value = "Perfect square trinomial";

            ITextRun run1 = a2.Characters(8, 7);

            run1.Font.Italic     = true;
            run1.Font.ThemeColor = ThemeColor.Accent1;

            IRange b2 = worksheet.Range["B2"];

            b2.Font.Size = 26;
            b2.EntireColumn.ColumnWidth = 60;

            b2.Value = "(a+b)2 = a2+2ab+b2";

            ITextRun superRun1 = b2.Characters(5, 1);

            superRun1.Font.Superscript = true;
            superRun1.Font.Color       = System.Drawing.Color.Red;

            ITextRun superRun2 = b2.Characters(10, 1);

            superRun2.Font.Superscript = true;
            superRun2.Font.Color       = System.Drawing.Color.Green;

            ITextRun superRun3 = b2.Characters(17, 1);

            superRun3.Font.Superscript = true;
            superRun3.Font.Color       = System.Drawing.Color.Blue;
        }
Пример #4
0
        public override void Execute(GrapeCity.Documents.Excel.Workbook workbook)
        {
            IWorksheet worksheet = workbook.Worksheets[0];

            IRange b2 = worksheet.Range["B2"];

            // customize the 'GrapeCity' run
            ITextRun run1 = b2.RichText.Add("GrapeCity");

            run1.Font.Name       = "Agency FB";
            run1.Font.Size       = 26;
            run1.Font.ThemeColor = ThemeColor.Accent1;
            run1.Font.Bold       = true;

            // customize the 'Documents' run
            ITextRun run2 = b2.RichText.Add(" Documents");

            run2.Font.ThemeColor = ThemeColor.Accent2;
            run2.Font.Name       = "Arial Black";
            run2.Font.Size       = 20;

            // customize the 'for' run
            ITextRun run3 = b2.RichText.Add(" for ");

            run3.Font.Italic = true;

            // customize the 'Excel' run
            ITextRun run4 = b2.RichText.Add("Excel");

            run4.Font.Color     = System.Drawing.Color.Blue;
            run4.Font.Bold      = true;
            run4.Font.Size      = 26;
            run4.Font.Underline = UnderlineType.Double;

            b2.EntireRow.RowHeight = 42;
        }