当前位置: 首页>>代码示例>>C#>>正文


C# Table.GetNumColumns方法代码示例

本文整理汇总了C#中PathMaker.Table.GetNumColumns方法的典型用法代码示例。如果您正苦于以下问题:C# Table.GetNumColumns方法的具体用法?C# Table.GetNumColumns怎么用?C# Table.GetNumColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PathMaker.Table的用法示例。


在下文中一共展示了Table.GetNumColumns方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetRowsFromTable

        public static BindingList<NameValuePairRow> GetRowsFromTable(Table table)
        {
            BindingList<NameValuePairRow> list = new BindingList<NameValuePairRow>();

            Boolean newStartStep = false;
            //Version 1.6.1.13+ uses a new set of fields for init data NV pairs - Notes column was added JDK 08-25-2014
            if (table.GetNumColumns() >= 5)
            {
                newStartStep = true;
            }

            if (newStartStep)
            {
                for (int r = 0; r < table.GetNumRows(); r++)
                {
                    NameValuePairRow nv = new NameValuePairRow();
                    nv.Name = table.GetData(r, (int)TableColumns.NameValuePairs.Name);
                    nv.Value = table.GetData(r, (int)TableColumns.NameValuePairs.Value);
                    nv.Notes = table.GetData(r, (int)TableColumns.NameValuePairs.Notes);
                    nv.NameDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp);
                    nv.ValueDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);
                    nv.NotesDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NotesDateStamp);
                    list.Add(nv);
                }
            } else {
                for (int r = 0; r < table.GetNumRows(); r++)
                {
                    NameValuePairRow nv = new NameValuePairRow();
                    nv.Name = table.GetData(r, (int)TableColumns.NameValuePairs.Name);
                    nv.Value = table.GetData(r, (int)TableColumns.NameValuePairs.Value);
                    nv.Notes = "";
                    nv.NameDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp);
                    nv.ValueDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);
                    nv.NotesDateStamp = "";
                    list.Add(nv);
                }
            }
            return list;
        }
开发者ID:pathmakertool,项目名称:pathmaker_os_files,代码行数:39,代码来源:NameValuePairRow.cs

示例2: GetTableFromRows

        public static Table GetTableFromRows(BindingList<NameValuePairRow> rows)
        {
            Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.NameValuePairs)).Length);

            Boolean newStartStep = false;
            //Version 1.6.1.13+ uses a new set of fields for init data NV pairs - Notes column was added JDK 08-25-2014
            if (table.GetNumColumns() >= 5)
            {
                newStartStep = true;
            }

            if (newStartStep)
            {
                int row = 0;
                foreach (NameValuePairRow nv in rows)
                {
                    table.SetData(row, (int)TableColumns.NameValuePairs.Name, nv.Name);
                    table.SetData(row, (int)TableColumns.NameValuePairs.Value, nv.Value);
                    table.SetData(row, (int)TableColumns.NameValuePairs.Notes, nv.Notes);
                    table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, nv.NameDateStamp);
                    table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, nv.ValueDateStamp);
                    table.SetData(row, (int)TableColumns.NameValuePairs.NotesDateStamp, nv.NotesDateStamp);
                    row++;
                }
            }
            else
            {
                int row = 0;
                foreach (NameValuePairRow nv in rows)
                {
                    table.SetData(row, (int)TableColumns.NameValuePairs.Name, nv.Name);
                    table.SetData(row, (int)TableColumns.NameValuePairs.Value, nv.Value);
                    //table.SetData(row, (int)TableColumns.NameValuePairs.Notes, nv.Notes);
                    table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, nv.NameDateStamp);
                    table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, nv.ValueDateStamp);
                    //table.SetData(row, (int)TableColumns.NameValuePairs.NotesDateStamp, nv.NotesDateStamp);
                    row++;
                }
            }
            return table;
        }
开发者ID:pathmakertool,项目名称:pathmaker_os_files,代码行数:41,代码来源:NameValuePairRow.cs


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