• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Documents.Table类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Documents.Table的典型用法代码示例。如果您正苦于以下问题:C# Table类的具体用法?C# Table怎么用?C# Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Table类属于System.Windows.Documents命名空间,在下文中一共展示了Table类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateTable

        public void CreateTable(int count)
        {
            // Create the parent FlowDocument...
            flowDoc = new FlowDocument();

            // Create the Table...
            table1 = new Table();
            table1.BringIntoView();
            // ...and add it to the FlowDocument Blocks collection.
            flowDoc.Blocks.Add(table1);

            // Set some global formatting properties for the table.
            table1.CellSpacing = 10;
            table1.Background = Brushes.White;
            // Create 6 columns and add them to the table's Columns collection.
            int numberOfColumns = 6;
            for (int x = 0; x < numberOfColumns; x++)
            {
                table1.Columns.Add(new TableColumn());

                // Set alternating background colors for the middle colums.
                if (x % 2 == 0)
                    table1.Columns[x].Background = Brushes.Beige;
                else
                    table1.Columns[x].Background = Brushes.LightSteelBlue;
            }
        }
开发者ID:berwyn,项目名称:HUM150-truthtables,代码行数:27,代码来源:TruthTable.cs


示例2: BuildTable

        internal static Table BuildTable(int rowCount, 
                                         int columnCount,
                                         Brush borderBrush,
                                         Thickness borderThickness,
                                         double dLineHeight,
                                         TableType tableType)
        {
            Table table = new Table();
            table.Tag = tableType;
            table.CellSpacing = 2;
            table.BorderBrush = borderBrush;
            table.BorderThickness = borderThickness;
            table.MouseEnter += new MouseEventHandler(table_MouseEnter);
            table.MouseLeave += new MouseEventHandler(table_MouseLeave);

            for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
            {
                TableColumn tableColumn = new TableColumn();
                tableColumn.Width = double.IsNaN(dLineHeight) ? GridLength.Auto : new GridLength(dLineHeight);
                table.Columns.Add(tableColumn);
            }

            TableRowGroup rowGroup = new TableRowGroup();
            for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
            {
                TableRow row = BuildTableRow(columnCount,borderBrush,borderThickness,dLineHeight);
                rowGroup.Rows.Add(row);
            }
            table.RowGroups.Add(rowGroup);
            return table;
        }
开发者ID:DVitinnik,项目名称:UniversityApps,代码行数:31,代码来源:Helper.cs


示例3: GetThreatTable

        public Table GetThreatTable()
        {
            var threatTable = new Table();
            threatTable.CellSpacing = 0;
            threatTable.Columns.Add(new TableColumn());
            threatTable.Columns.Add(new TableColumn());
            threatTable.Columns.Add(new TableColumn());
            threatTable.Columns.Add(new TableColumn());
            var headerGroup = new TableRowGroup();
            headerGroup.Rows.Add(new TableRow());
            headerGroup.Rows[0].FontWeight = FontWeights.Bold;
            var headerRow = headerGroup.Rows[0];
            headerRow.Cells.Add(new TableCell(new Paragraph(new Run("Skill"))));
            headerRow.Cells.Add(new TableCell(new Paragraph(new Run("Count"))));
            headerRow.Cells.Add(new TableCell(new Paragraph(new Run("Threat"))));
            headerRow.Cells.Add(new TableCell(new Paragraph(new Run("Threat %"))));
            threatTable.RowGroups.Add(headerGroup);

            var rowGroup = new TableRowGroup();
            var totalThreat = TotalThreat;
            foreach (var item in ThreatRecordsBySkill.OrderByDescending(records => records.Sum(record => record.Threat)))
            {
                var row = new TableRow();

                row.Cells.Add(new TableCell(new Paragraph(new Run(item.Key))));
                row.Cells.Add(new TableCell(new Paragraph(new Run(item.Count().ToString()))));
                row.Cells.Add(new TableCell(new Paragraph(new Run(item.Sum(record => record.Threat).ToString()))));
                row.Cells.Add(new TableCell(new Paragraph(new Run(item.Sum(record => (double)record.Threat / totalThreat).ToString("0.##%")))));
                rowGroup.Rows.Add(row);
            }
            rowGroup.Rows.Add(new TableRow());
            threatTable.RowGroups.Add(rowGroup);
            return threatTable;
        }
开发者ID:Corprus,项目名称:swparse,代码行数:34,代码来源:ThreatCalculator.cs


示例4: AddTable

        public void AddTable(string tableName, params string[] headers)
        {
            var table = new Table
                            {
                                CellSpacing = 0,
                                BorderThickness = new Thickness(0.5, 0.5, 0, 0),
                                BorderBrush = Brushes.Black

                            };

            Document.Blocks.Add(table);
            Tables.Add(tableName, table);

            var lengths = ColumnLengths.ContainsKey(tableName)
                ? ColumnLengths[tableName]
                : new[] { GridLength.Auto, GridLength.Auto, new GridLength(1, GridUnitType.Star) };

            for (var i = 0; i < headers.Count(); i++)
            {
                var c = new TableColumn { Width = lengths[i] };
                table.Columns.Add(c);
            }

            var rows = new TableRowGroup();
            table.RowGroups.Add(rows);
            rows.Rows.Add(CreateRow(headers, new[] { TextAlignment.Center }, true));
        }
开发者ID:hpbaotho,项目名称:sambapos,代码行数:27,代码来源:SimpleReport.cs


示例5: CancelPreviewInsertTable

 internal void CancelPreviewInsertTable()
 {
     if (_previousTable != null)
     {
         flowDoc.Blocks.Remove(_previousTable);
         _previousTable = null;
     }
 }
开发者ID:amitkr2007,项目名称:groups-dct-sms,代码行数:8,代码来源:UserControlWord.xaml.cs


示例6: AddTitleRow

        private void AddTitleRow(Table table, string titleName)
        {
            table.RowGroups[0].Rows.Add(new TableRow());
            var row = table.RowGroups[0].Rows[table.RowGroups[0].Rows.Count - 1];
            row.Style = (Style)row.FindResource("TableHeaderStyle");

            row.Cells.Add(new TableCell(new Paragraph(new Run(titleName))) {ColumnSpan = 2});
        }
开发者ID:kyleabrock,项目名称:StudioV,代码行数:8,代码来源:HardDescr.xaml.cs


示例7: AddDescrRow

        private void AddDescrRow(Table table, string leftCellText, string rightCellText)
        {
            table.RowGroups[0].Rows.Add(new TableRow());
            var row = table.RowGroups[0].Rows[table.RowGroups[0].Rows.Count - 1];
            row.Style = (Style)row.FindResource("TableTextStyle");

            row.Cells.Add(new TableCell(new Paragraph(new Run(leftCellText))));
            row.Cells.Add(new TableCell(new Paragraph(new Run(rightCellText))));
        }
开发者ID:kyleabrock,项目名称:StudioV,代码行数:9,代码来源:HardDescr.xaml.cs


示例8: UserControl_Loaded

 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     //rtbMessages.Document.Blocks.Add(new Paragraph());
     msgTable = new Table();
     rtbMessages.Document.Blocks.Add(msgTable);
     msgTable.CellSpacing = 10;
     msgTable.Background = Brushes.White;
     msgTable.RowGroups.Add(new TableRowGroup());
     TX = msgTable.RowGroups[0];
 }
开发者ID:XEonAX,项目名称:Grind,代码行数:10,代码来源:ChatsControl.xaml.cs


示例9: ReadTable

        private static IEnumerable<string> ReadTable(Table table)
        {
            var result = new List<string> { " " };
            var colLenghts = new int[table.Columns.Count];
            var colAlignments = new TextAlignment[table.Columns.Count];

            foreach (var row in table.RowGroups[0].Rows)
            {
                for (var i = 0; i < row.Cells.Count; i++)
                {
                    if (row == table.RowGroups[0].Rows[1])
                        colAlignments[i] = (row.Cells[i].Blocks.First()).TextAlignment;

                    var value = string.Join(" ", ReadBlocks(row.Cells[i].Blocks));
                    if (value.Length > colLenghts[i] && row.Cells[0].ColumnSpan == 1)
                        colLenghts[i] = value.Length;
                }
            }

            foreach (var row in table.RowGroups[0].Rows)
            {
                if (row == table.RowGroups[0].Rows[0]) result.Add("<EB>");

                var rowValue = "";
                for (var i = 0; i < row.Cells.Count; i++)
                {
                    var values = ReadBlocks(row.Cells[i].Blocks);

                    if (i == row.Cells.Count - 1 && row != table.RowGroups[0].Rows[0])
                        rowValue += " | " + string.Join(" ", values);
                    else
                    {
                        var value = string.Join(" ", values);

                        if (i < row.Cells.Count)
                        {
                            value = colAlignments[i] == TextAlignment.Right
                                ? value.PadLeft(colLenghts[i] + 1)
                                : value.PadRight(colLenghts[i] + 1);
                        }

                        rowValue += value;
                    }
                }

                if (row == table.RowGroups[0].Rows[0])
                {
                    result.Add("<C00>" + rowValue);
                    result.Add("<DB>");
                }
                else result.Add("<J00>" + rowValue);
            }
            return result;
        }
开发者ID:noromamai,项目名称:SambaPOS-3,代码行数:54,代码来源:PrinterTools.cs


示例10: ReporterCreator

		public ReporterCreator(DataBase data, ReportKind reportKind)
		{
			_reportKind = reportKind;
			Document = new FlowDocument { ColumnWidth = 15000 };
			var mainTable = new Table
			{
				FontFamily = new FontFamily("Arial")
			};
			BaseRows(data, ref mainTable);
			Document.Blocks.Add(mainTable);
		}
开发者ID:pashkados,项目名称:EngineCalculate,代码行数:11,代码来源:ReporterCreator.cs


示例11: FillTableWithEmptyCells

 private void FillTableWithEmptyCells(Table t)
 {
             foreach(TableRowGroup trg in t.RowGroups)
     {
         foreach(TableRow tr in trg.Rows)
         {
             int addcells  = maxc - tr.Cells.Count ;
             for (int i = 0; i < addcells;i++ )
             {
                 tr.Cells.Add(new TableCell());
             }
         }
     }
 }
开发者ID:alexiej,项目名称:YATE,代码行数:14,代码来源:HTMLToFlowConverter.table.cs


示例12: UpdateTable

        // Build a table with a given number of rows and columns
        internal static Table UpdateTable(Table table,
                                         int rowCount, 
                                         int columnCount,
                                         Brush borderBrush,
                                         Thickness borderThickness,
                                         double dLineHeight,
                                         TableType tableType)
        {
            table.Tag = tableType;
            table.CellSpacing = 2;
            table.BorderBrush = borderBrush;
            table.BorderThickness = borderThickness;
            table.MouseEnter += new MouseEventHandler(table_MouseEnter);
            table.MouseLeave += new MouseEventHandler(table_MouseLeave);
         
            if (0 >= table.Columns.Count)
            {
                for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
                {
                    TableColumn tableColumn = new TableColumn();
                    tableColumn.Width = double.IsNaN(dLineHeight) ? GridLength.Auto : new GridLength(dLineHeight);
                    table.Columns.Add(tableColumn);
                }
            }
            else
            {
                foreach (TableColumn tableColumn in table.Columns)
                {
                    tableColumn.Width = double.IsNaN(dLineHeight) ? GridLength.Auto : new GridLength(dLineHeight);
                }
            }

            foreach(TableRowGroup rowGroup in table.RowGroups)
            {
                foreach (TableRow row in rowGroup.Rows)
                {
                    foreach (TableCell cell in row.Cells)
                    {
                        cell.BorderBrush = borderBrush;
                        cell.BorderThickness = borderThickness; 
                    }
                }
            }

            return table;
        }
开发者ID:DVitinnik,项目名称:UniversityApps,代码行数:47,代码来源:Helper.cs


示例13: AddSmallContainers

 private void AddSmallContainers(Table tab, List<Container> tempList, int i, int i2)
 {
     //печатаем заголовок
     var i3 = 1;
     tab.RowGroups[0].Rows.Add(new TableRow());
     var currentRow = tab.RowGroups[0].Rows[i2 + i3];
     currentRow.Background = Brushes.White;
     currentRow.FontSize = 18;
     currentRow.FontWeight = FontWeights.Normal;
     currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Шаг " + i + ": Загрузите следующие контейнеры:"))));
     currentRow.Cells[0].ColumnSpan = 2;
     foreach (var c in tempList)
     {
         i3++;
         tab.RowGroups[0].Rows.Add(new TableRow());
         currentRow = tab.RowGroups[0].Rows[i2 + i3];
         currentRow.Background = Brushes.White;
         currentRow.FontSize = 14;
         currentRow.FontWeight = FontWeights.Normal;
         currentRow.Cells.Add(
         new TableCell(new Paragraph(new Run(c.Name + ": " + c.Vgh + "; " + c.Mass + " кг."))));
         currentRow.Cells[0].ColumnSpan = 2;
     }
 }
开发者ID:RadSt,项目名称:WPF-App-For-Ref,代码行数:24,代码来源:LoadSchemeCalculation.cs


示例14: FormatFragmentsList

        public static Table FormatFragmentsList(IEnumerable<Fragment> fragments)
        {
            var thetable = new Table();
            var tableRowGroup = new TableRowGroup();

            var headerRow = new TableRow { Background = new SolidColorBrush(Colors.LightGray) };
            headerRow.Cells.Add(new TableCell(new Paragraph(new Run("Déplacement"))) { BorderBrush = new SolidColorBrush(Colors.Gray) });
            headerRow.Cells.Add(new TableCell(new Paragraph(new Run("Taille"))) { BorderBrush = new SolidColorBrush(Colors.Gray) });
            headerRow.Cells.Add(new TableCell(new Paragraph(new Run("Bit More Fragments"))) { BorderBrush = new SolidColorBrush(Colors.Gray) });

            tableRowGroup.Rows.Add(headerRow);

            foreach (var fragment in fragments)
            {
                var row = new TableRow();
                row.Cells.Add(new TableCell(new Paragraph(new Run(fragment.Offset.ToString()))) { BorderBrush = new SolidColorBrush(Colors.Gray), BorderThickness = new Thickness(0, 0, 0, 0.2) });
                row.Cells.Add(new TableCell(new Paragraph(new Run(fragment.Length.ToString()))) { BorderBrush = new SolidColorBrush(Colors.Gray), BorderThickness = new Thickness(0, 0, 0, 0.2) });
                row.Cells.Add(new TableCell(new Paragraph(new Run(fragment.MoreFragments.ToString()))) { BorderBrush = new SolidColorBrush(Colors.Gray), BorderThickness = new Thickness(0, 0, 0, 0.2) });
                tableRowGroup.Rows.Add(row);
            }
            thetable.RowGroups.Add(tableRowGroup);

            return thetable;
        }
开发者ID:0xffffabcd,项目名称:PacketsFragmentationSimulator,代码行数:24,代码来源:Helpers.cs


示例15: GetCellInfoFromPoint

        /// <summary>
        /// Returns a cellinfo class for a point that may be inside of a cell 
        /// </summary> 
        /// <param name="point">
        /// Point to hit test 
        /// </param>
        /// <param name="tableFilter">
        /// Filter out all results not specific to a given table
        /// </param> 
        /// <returns>
        /// Returns cellinfo structure. 
        /// </returns> 
        internal CellInfo GetCellInfoFromPoint(Point point, Table tableFilter)
        { 
            // Verify that layout information is valid. Cannot continue if not valid.
            if (!IsValid)
            {
                throw new InvalidOperationException(SR.Get(SRID.TextViewInvalidLayout)); 
            }
 
            return GetCellInfoFromPoint(Columns, FloatingElements, point, tableFilter); 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:22,代码来源:TextDocumentView.cs


示例16: Render

 Table Render(HTMLTableElement element)
 {
     var table = new Table();
     return table;
 }
开发者ID:mydataprovider,项目名称:.NET-AngleSharp,代码行数:5,代码来源:RendererViewModel.cs


示例17: ShowVehicles

        private FlowDocument ShowVehicles()
        {
            var doc = new FlowDocument();
            foreach (var v in vehicles)
            {
                AddMainHeader(doc,
                    "Схема загрузки автомобиля " + v.Name + " (" + v.Count + " контейнеров; общий вес груза " + v.Mass +
                    " кг.)");

                if (v.Blocks.Count == 0)
                {
                    AddHeader(doc, "Автомобиль загружать не нужно");
                }
                else
                {
                    var i = 0;
                    var i2 = 0;
                    var table1 = new Table();
                    // ...and add it to the FlowDocument Blocks collection.
                    doc.Blocks.Add(table1);
                    // Set some global formatting properties for the table.
                    table1.CellSpacing = 10;
                    table1.Background = Brushes.White;

                    // Create 6 columns and add them to the table's Columns collection.
                    const int numberOfColumns = 2;
                    for (var x = 0; x < numberOfColumns; x++)
                    {
                        table1.Columns.Add(new TableColumn());

                        // Set alternating background colors for the middle colums.
                        table1.Columns[x].Background = x % 2 == 0 ? Brushes.Beige : Brushes.LightSteelBlue;
                    }

                    table1.Columns[0].Width = new GridLength(300);


                    //Добавляем заголовок таблицы
                    table1.RowGroups.Add(new TableRowGroup());
                    table1.RowGroups.Add(new TableRowGroup());

                    // AddContainer the first (title) row.
                    table1.RowGroups[0].Rows.Add(new TableRow());
                    var currentRow = table1.RowGroups[0].Rows[0];
                    currentRow.Background = Brushes.Silver;
                    currentRow.FontSize = 14;
                    currentRow.FontWeight = FontWeights.Bold;
                    currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Контейнеры"))));
                    currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Схема загрузки ряда"))));
                    //получаем список заказов
                    var orderList = DistinctOrdersInRow(v.Blocks);
                    orderList.OrderBy(o => o);
                    foreach (var order in orderList)
                    {
                        foreach (var r in v.Blocks)
                        {
                            if (r.Order == order)
                            {
                                i++;
                                i2 = i2 + 2;
                                AddRow(table1, r, v, i, i2);
                            }
                        }
                        var tempList = v.SmallBlocks.Where(c => c.Order == order).ToList();
                        if (tempList.Any())
                        {
                            i++;
                            AddSmallContainers(table1, tempList, i, i2);
                            i2 = i2 + 1 + tempList.Count();
                        }
                    }
                }
            }
            return doc;
        }
开发者ID:RadSt,项目名称:WPF-App-For-Ref,代码行数:75,代码来源:LoadSchemeCalculation.cs


示例18: WriteTableColumnsInformation

        // Write columns related to the given table cell range.
        private static void WriteTableColumnsInformation(ITextRange range, Table table, XmlWriter xmlWriter, XamlTypeMapper xamlTypeMapper)
        {
            TableColumnCollection columns = table.Columns;
            int startColumn;
            int endColumn;

            if (!TextRangeEditTables.GetColumnRange(range, table, out startColumn, out endColumn))
            {
                startColumn = 0;
                endColumn = columns.Count - 1;
            }

            Invariant.Assert(startColumn >= 0, "startColumn index is supposed to be non-negative");

            if(columns.Count > 0)
            {
                // Build an appropriate name for the complex property
                string complexPropertyName = table.GetType().Name + ".Columns";

                // Write the start element for the complex property.
                xmlWriter.WriteStartElement(complexPropertyName);

                for (int i = startColumn; i <= endColumn && i < columns.Count; i++)
                {
                    WriteXamlAtomicElement(columns[i], xmlWriter, /*reduceElement:*/false);
                }

                // Close the element for the complex property
                xmlWriter.WriteEndElement();
            }

        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:33,代码来源:TextRangeSerialization.cs


示例19: BuildObjectTree

        internal object BuildObjectTree()
        { 
            IAddChild root;
            switch (_type) 
            { 
                case ElementType.Table:
                    root = new Table(); 
                    break;
                case ElementType.TableRowGroup:
                    root = new TableRowGroup();
                    break; 
                case ElementType.TableRow:
                    root = new TableRow(); 
                    break; 
                case ElementType.TableCell:
                    root = new TableCell(); 
                    break;
                case ElementType.Paragraph:
                    root = new Paragraph();
                    break; 
                case ElementType.Hyperlink:
                    Hyperlink link = new Hyperlink(); 
                    link.NavigateUri = GetValue(NavigateUriProperty) as Uri; 
                    link.RequestNavigate += new RequestNavigateEventHandler(ClickHyperlink);
                    AutomationProperties.SetHelpText(link, (String)this.GetValue(HelpTextProperty)); 
                    AutomationProperties.SetName(link, (String)this.GetValue(NameProperty));
                    root = link;
                    break;
                default: 
                    Debug.Assert(false);
                    root = null; 
                    break; 
            }
 
            ITextPointer pos = ((ITextPointer)_start).CreatePointer();

            while (pos.CompareTo((ITextPointer)_end) < 0)
            { 
                TextPointerContext tpc = pos.GetPointerContext(LogicalDirection.Forward);
                if (tpc == TextPointerContext.Text) 
                { 
                    root.AddText(pos.GetTextInRun(LogicalDirection.Forward));
                } 
                else if (tpc == TextPointerContext.EmbeddedElement)
                {
                    root.AddChild(pos.GetAdjacentElement(LogicalDirection.Forward));
                } 
                else if (tpc == TextPointerContext.ElementStart)
                { 
                    object obj = pos.GetAdjacentElement(LogicalDirection.Forward); 
                    if (obj != null)
                    { 
                        root.AddChild(obj);
                        pos.MoveToNextContextPosition(LogicalDirection.Forward);
                        pos.MoveToElementEdge(ElementEdge.BeforeEnd);
                    } 
                }
 
                pos.MoveToNextContextPosition(LogicalDirection.Forward); 

            } 
            return root;
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:63,代码来源:FixedElement.cs


示例20: DrawTab

        private void DrawTab()
        {
            ImageBrush One = new ImageBrush
                {
                    ImageSource =
                      new BitmapImage(
                        new Uri(@"pack://application:,,,/Images/One.png", UriKind.RelativeOrAbsolute)
                      )
                };

            TotalLbl.Content = "Results Found: " + Fingerings.Count;

            foreach (string Fingering in Fingerings)
            {
                Figure fig = new Figure();
                fig.CanDelayPlacement = false;
                // Create Table ...
                Table tbl = new Table();
                tbl.FontSize = 14;
                tbl.Background = new ImageBrush
                {
                    Stretch = Stretch.Fill,
                    ImageSource =
                      new BitmapImage(
                        new Uri(@"pack://application:,,,/Images/ChordBG.png", UriKind.RelativeOrAbsolute)
                      )
                };

                tbl.CellSpacing = 2;

                tbl.Margin = new Thickness(0, 10, 0, 0);
                // tbl.Background = new Brush("Images/ChordBG.png");
                for (int x = 0; x < 7; x++)
                {
                    tbl.Columns.Add(new TableColumn());
                    tbl.Columns[tbl.Columns.Count - 1].Width = new GridLength(23);
                }
                tbl.Columns[0].Width = new GridLength(18);
                // Create and add an empty TableRowGroup to hold the table's Rows.
                tbl.RowGroups.Add(new TableRowGroup());
                // Add the first (title) row.
                for (int i = 0; i < 7; i++)
                {
                    TableRow currentRow = new TableRow();
                    tbl.RowGroups[0].Rows.Add(currentRow);

                    for (int j = 0; j < 7; j++)
                    {
                        TableCell cell = new TableCell();
                        currentRow.Cells.Add(cell);
                        cell.BorderThickness = new Thickness(0);
                        cell.Padding = new Thickness(0, 0, 0, 0);
                    }
                }

                // Fill table with fingering values
                string[] vals = Fingering.Split('/');
                string b = vals.Where(a => !a.Contains("-1") && a.Split(',')[0] != "0").Last();
                int MinFrett = Convert.ToInt32(b.Split(',')[0]);

                // Showing the starting Frett
                Paragraph paragraph2 = new Paragraph();
                paragraph2.Inlines.Add(new Run(MinFrett.ToString()));
                tbl.RowGroups[0].Rows[1].Cells[0].Blocks.Add(paragraph2);

                // Showing finger positions
                foreach (string val in vals)
                {
                    string[] points = val.Split(',');
                    if (points.Length == 2)
                    {
                        int ColumnIndex = Math.Abs(Convert.ToInt32(points[1]) - 6);
                        if (points[0] == "-1")
                        {
                            Paragraph paragraph = new Paragraph();
                            paragraph.Inlines.Add(new Run("X"));
                            tbl.RowGroups[0].Rows[0].Cells[ColumnIndex].Blocks.Add(paragraph);
                        }
                        else
                        {
                            Paragraph paragraph = new Paragraph();
                            paragraph.Inlines.Add(new Run("O"));
                            tbl.RowGroups[0].Rows[0].Cells[ColumnIndex].Blocks.Add(paragraph);
                        }
                    }
                    else
                    {
                        int RowIndex = Convert.ToInt32(points[0]) - MinFrett + 1;
                        int ColumnIndex = Math.Abs(Convert.ToInt32(points[1]) - 6);

                        Paragraph paragraph = new Paragraph();
                        paragraph.Inlines.Add(new Run(points[2]));
                        tbl.RowGroups[0].Rows[RowIndex].Cells[ColumnIndex].Blocks.Add(paragraph);

                    }
                }

                fig.Blocks.Add(tbl);
                Paragraph MainParag = new Paragraph(fig);
                doc1.Blocks.Add(MainParag);
//.........这里部分代码省略.........
开发者ID:Danial473,项目名称:ChordFinderWPF,代码行数:101,代码来源:VisualFingering.xaml.cs



注:本文中的System.Windows.Documents.Table类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Documents.TextEditor类代码示例发布时间:2022-05-26
下一篇:
C# Documents.StaticTextPointer类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap