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


C# ColumnCollection.Clear方法代码示例

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


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

示例1: _BuildColumnsCollection

 /// <summary>
 /// Builds collection of columns.
 /// </summary>
 /// <param name="columns"></param>
 private void _BuildColumnsCollection(ColumnCollection columns)
 {
     columns.Clear();
     foreach (Column column in _columns)
     {
         if (column.FieldName.Equals("Capacities") || column.FieldName.Equals("CustomOrderProperties"))
         {
             Collection<Column> dynamicColumns = column.FieldName.Equals("Capacities") ?
                                                     _GetDynamicCapacitiesColumns(column.ReadOnly) :
                                                     _GetDynamicCustomOrderColumns(column.ReadOnly);
             foreach (Column dynamicColumn in dynamicColumns)
             {
                 if (column.CellEditor != null)
                     dynamicColumn.CellEditor = column.CellEditor;
                 dynamicColumn.Width = column.Width;
                 columns.Add(dynamicColumn);
             }
         }
         else if (column.FieldName.Equals("AddressFields"))
         {
             Collection<Column> dynamicColumns = _GetDynamicAddressColumns(column.ReadOnly);
             foreach (Column dynamicColumn in dynamicColumns)
                 columns.Add(dynamicColumn);
         }
         else
             columns.Add(column);
     }
 }
开发者ID:erindm,项目名称:route-planner-csharp,代码行数:32,代码来源:GridStructureInitializer.cs

示例2: _BuildColumnsCollection

        /// <summary>
        /// Builds collection of columns.
        /// </summary>
        /// <param name="parametersCount">Parameters count.</param>
        /// <param name="readedColumns">Readed columns.</param>
        /// <param name="columns">Colums.</param>
        private void _BuildColumnsCollection(int parametersCount,
                                             ArrayList readedColumns,
                                             ColumnCollection columns)
        {
            Debug.Assert(null != readedColumns);
            Debug.Assert(null != columns);

            columns.Clear();

            foreach (Column column in readedColumns)
            {
                if (!column.FieldName.Equals(DYNAMIC_FIELDS_ALIAS))
                    columns.Add(column);
                else
                {
                    string parameterColumnTitleFormat =
                        App.Current.FindString("ParameterColumnHeaderFormat");

                    for (int index = 0; index < parametersCount; ++index)
                    {
                        var col = new Column();
                        col.FieldName = _GetDynamicFieldName(index);
                        col.Title = string.Format(parameterColumnTitleFormat,
                            (0 == index) ? "" : (index + 1).ToString());
                        col.CellContentTemplate = column.CellContentTemplate;
                        col.CellEditor = column.CellEditor;
                        col.Width = column.Width;
                        col.MinWidth = column.MinWidth;
                        col.MaxWidth = column.MaxWidth;
                        col.CellValidationRules.Add(new ParameterValidationRule());
                        columns.Add(col);
                    }
                }
            }
        }
开发者ID:erindm,项目名称:route-planner-csharp,代码行数:41,代码来源:RoutingPreferencesPage.xaml.cs


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