當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。