本文整理汇总了C#中ColumnCollection类的典型用法代码示例。如果您正苦于以下问题:C# ColumnCollection类的具体用法?C# ColumnCollection怎么用?C# ColumnCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColumnCollection类属于命名空间,在下文中一共展示了ColumnCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Table
/// <summary>
/// Construct a new <see cref="Table" />.
/// </summary>
/// <param name="tableName">
/// The name of the <see cref="Table" />.
/// </param>
/// <param name="headerAlignment">
/// The method to use to align the text in the table's header.
/// Defaults to <see cref="StringFormatting.LeftJustified" />.
/// </param>
public Table(string tableName=null, Alignment headerAlignment=null)
{
Title = tableName ?? string.Empty;
HeaderAlignment = headerAlignment ?? StringFormatting.LeftJustified;
Columns = new ColumnCollection();
Rows = new RowCollection(this);
}
开发者ID:karldickman,项目名称:Utilities,代码行数:17,代码来源:Table.cs
示例2: CollectionWith2Columns
private ColumnCollection CollectionWith2Columns()
{
ColumnCollection cc = new ColumnCollection();
cc.Add (new SortColumn("Column1",typeof(System.String)));
cc.Add(new SortColumn("Column2",System.ComponentModel.ListSortDirection.Ascending,typeof(System.String),true));
return cc;
}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:8,代码来源:ColumnCollectionFixture.cs
示例3: TreeGrid1
public TreeGrid1()
{
InitializeComponent();
columns = new ColumnCollection(this);
realGrid.LostFocus += new EventHandler(realGrid_LostFocus);
realGrid.GotFocus += new EventHandler(realGrid_GotFocus);
}
开发者ID:rsdn,项目名称:janus,代码行数:8,代码来源:TreeGrid1.cs
示例4: PrimaryKeys
internal PrimaryKeys(ColumnCollection columns)
{
var pk = columns.Where(column => (column as ColumnSchema).PkContraintName != null);
this.keys = pk.Select(column => column.ColumnName).ToArray();
if (this.keys.Length != 0)
this.constraintName = pk.Select(column => (column as ColumnSchema).PkContraintName).First();
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:8,代码来源:PrimaryKeys.cs
示例5: AddColumnsInternal
private static void AddColumnsInternal(ColumnCollection columns, Type itemType, IPageableList owner, string prefix = null, string tableName = null)
{
var props = itemType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy);
foreach (var prop in props)
{
if (prop.Name == Constants.BaseInfoPropertyName) // Add columns from the "base" classes
{
var method = prop.PropertyType.GetMethod("GetProcessDefinition",
BindingFlags.Static | BindingFlags.Public);
var procDefinition = method.Invoke(null, BindingFlags.InvokeMethod, null, null, null);
var table = ((ProcessDefinition)procDefinition).TableList.Last().Name;
AddColumnsInternal(columns,prop.PropertyType, owner,
string.IsNullOrEmpty(prefix)
? Constants.BaseInfoPropertyName
: string.Format("{0}.{1}", prefix, Constants.BaseInfoPropertyName), table);
}
var display = (from d in prop.GetCustomAttributes(typeof(DisplayAttribute), false) select d).FirstOrDefault();
var crossRef = (CrossRefFieldAttribute) (from d in prop.GetCustomAttributes(typeof(CrossRefFieldAttribute), false) select d).FirstOrDefault();
if (display == null || string.IsNullOrEmpty(((DisplayAttribute)display).Name)) continue;
var column = ColumnFactory.CreateColumn(owner, columns, crossRef);
column.Header = ((DisplayAttribute) display).Name;
//ColumnName =
// (crossRef == null || string.IsNullOrWhiteSpace(crossRef.RefFieldName))
// ? prop.Name
// : crossRef.RefFieldName,
column.ReferenceTableName = (crossRef == null || string.IsNullOrWhiteSpace(crossRef.ReferenceTableName))
? string.Empty
: crossRef.ReferenceTableName;
//Width = getWidth(prop),
column.IsBase = !string.IsNullOrWhiteSpace(prefix);
column.ColumnName = prop.Name;
column.Property = prop;
column.Prefix = prefix;
column.TableName = tableName;
column.Width = prop.PropertyType == typeof (string) ? 200 : 50;
// this cycle is need only to display hyperlink column for field file.
// search for an item with the equals name, but only at the end + "Url",
// if found, write AdditionalDataPropertyName item name + "Url"
foreach (var prop1 in props)
{
if (prop1.Name.EndsWith("Url") && prop1.Name.Remove(prop1.Name.Length - 3, 3) == prop.Name)
{
column.AdditionalDataPropertyName = prop1.Name;
break;
}
}
columns.Add(column);
}
//RaisePropertyChanged(() => Columns);
}
开发者ID:mparsin,项目名称:Elements,代码行数:58,代码来源:SearchListExtensions.cs
示例6: TableBase
public TableBase()
{
Table = new NewTablix
{
Name = Name ?? "Table_" + Guid.NewGuid().ToString().Replace("-", ""),
Style = new Style { Border = new Border { Style = "Solid" }.Create() }
};
Columns = new ColumnCollection();
Rows = new CornerRowCollection();
}
开发者ID:carlosgilf,项目名称:prettyjs,代码行数:10,代码来源:TableBase.cs
示例7: List
public ColumnCollection List(IEnumerable<IFilter> filters)
{
var columns = new ColumnCollection();
var rows = Discover(filters);
foreach (var row in rows)
columns.AddOrIgnore(row.Name);
return columns;
}
开发者ID:zyh329,项目名称:nbi,代码行数:10,代码来源:ColumnDiscoveryCommand.cs
示例8: Type
public Type(string name)
{
if (name == null)
{
throw Error.SchemaRequirementViolation("Type", "Name");
}
this.name = name;
columns = new ColumnCollection();
associations = new AssociationCollection();
subTypes = new TypeCollection();
}
开发者ID:mattfrerichs,项目名称:Templates,代码行数:11,代码来源:Type.cs
示例9: GridPanel
internal GridPanel(C1FlexGrid grid, CellType cellType, int rowHeight, int colWidth)
{
Grid = grid;
CellType = cellType;
_cells = new CellRangeDictionary();
ViewRange = CellRange.Empty;
Rows = new RowCollection(this, rowHeight);
Columns = new ColumnCollection(this, colWidth);
HorizontalAlignment = HorizontalAlignment.Left;
VerticalAlignment = VerticalAlignment.Top;
}
开发者ID:mdjabirov,项目名称:C1Decompiled,代码行数:11,代码来源:GridPanel.cs
示例10: SetLayoutTest
public void SetLayoutTest()
{
#region Arrange
var layoutFieldViewModelFactory = new ExportFactory<LayoutFieldViewModel>(() => new Tuple<LayoutFieldViewModel, Action>(new LayoutFieldViewModel(), () => { }));
var field1Name = "BaseField1";
var field2Name = "BaseField2";
var field3Name = "Field1";
var field4Name = "Field2";
var field1Prefix = Constants.BaseInfoPropertyName;
var field2Prefix = string.Format("{0}.{0}.{0}", Constants.BaseInfoPropertyName);
string field3Prefix = null;
string field4Prefix = null;
var column1 = CreateColumnItem(field1Name, field1Prefix);
var column2 = CreateColumnItem(field2Name, field2Prefix);
var column3 = CreateColumnItem(field3Name, field3Prefix);
var column4 = CreateColumnItem(field4Name, field4Prefix);
var columns = new ColumnCollection() { column1, column2, column3, column4 };
var modelLayoutList = new List<string>()
{
GetFullyQualifiedName(field1Name, field1Prefix),
GetFullyQualifiedName(field2Name, field2Prefix),
GetFullyQualifiedName(field3Name, field3Prefix),
GetFullyQualifiedName(field4Name, field4Prefix)
};
var model = new SearchViewModel() { LayoutList = modelLayoutList, Columns = columns };
var vm = new LayoutViewModel() { Model = model, LayoutFieldViewModelFactory = layoutFieldViewModelFactory };
#endregion Arrange
//Act
SetupRadGridViewHelper(new RadGridView(), new[] { column2, column3 });
vm.SetLayout(new List<string>());
//Assert
Assert.AreEqual(vm.LayoutList.Count, 0);
//Assert.AreEqual(vm.LayoutList[0].ColumnSystemName, GetFullyQualifiedName(field2Name, field2Prefix));
//Assert.AreEqual(vm.LayoutList[1].ColumnSystemName, GetFullyQualifiedName(field3Name, field3Prefix));
////Act
//SetupRadGridViewHelper(new RadGridView(), new[] { column1, column4 });
//vm.SetLayout(new List<string>());
////Assert
//Assert.AreEqual(vm.LayoutList.Count, 2);
//Assert.AreEqual(vm.LayoutList[0].ColumnSystemName, GetFullyQualifiedName(field1Name, field1Prefix));
//Assert.AreEqual(vm.LayoutList[1].ColumnSystemName, GetFullyQualifiedName(field4Name, field4Prefix));
}
开发者ID:mparsin,项目名称:Elements,代码行数:52,代码来源:LayoutViewModelTests.cs
示例11: GetColumnsFromDefaultLayout
public void GetColumnsFromDefaultLayout(string processSystemName, Action<ColumnCollection> callback)
{
var filter = GetLayoutFilter(processSystemName);
TheDynamicTypeManager.BeginGetList<ILayoutList<ILayoutInfo>>(Constants.LayoutProcessName, (o, r) =>
{
if (r.Error != null)
{
return;
}
var defaultLayout = (ILayoutInfo)r.Object[0];
var layoutViewModel = new NewLayoutViewModel
{
Id = defaultLayout.Id,
AccountId = defaultLayout.AccountId,
LayoutString = defaultLayout.LayoutDefinition,
IsAdminLayout = defaultLayout.IsAdminLayout ?? false,
IsDefault = defaultLayout.IsDefault ?? false,
Name = defaultLayout.Name,
};
layoutViewModel.Parse(layoutViewModel.LayoutString);
var type = TheDynamicTypeManager.GetListType(processSystemName).BaseType.GetGenericArguments()[1];
var columnCollection = new ColumnCollection();
for (int i = 0; i < layoutViewModel.LayoutColumns.Count; i++)
{
var layoutColumn = layoutViewModel.LayoutColumns[i];
var property = type.GetProperty(layoutColumn.SystemName);
var column = new ColumnItem(null, null)
{
Header = layoutColumn.Header,
ColumnName = layoutColumn.SystemName,
Width = layoutColumn.Width.HasValue ? layoutColumn.Width.Value : 0,
Order = i,
Property = property
};
columnCollection.Add(column);
}
callback(columnCollection);
}, filterExpression: filter.ToJSON(), pageSize: 1);
}
开发者ID:mparsin,项目名称:Elements,代码行数:50,代码来源:SimpleLayoutBuilder.cs
示例12: Table
public Table()
{
//ExpandedColumnCount = 1;
//ExpandedRowCount = 1;
FullColumns = 1;
FullRows = 1;
DefaultColumnWidth = 54.0;
DefaultRowHeight = 13.5;
Rows = new RowCollection();
Columns = new ColumnCollection();
}
开发者ID:marinehero,项目名称:ThinkAway.net,代码行数:17,代码来源:Table.cs
示例13: AddColumns
/// <summary>
/// Adds the columns.
/// </summary>
/// <param name="columns">The columns.</param>
/// <param name="itemType">Type of the item.</param>
/// <param name="owner">The owner.</param>
/// <param name="prefix">The prefix.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="forFilter">if set to <c>true</c> [for filter].</param>
/// <param name="displayColumns">The display columns.</param>
/// <param name="columnOrder">The column order.</param>
public static void AddColumns(
this ColumnCollection columns,
Type itemType,
IRefreashable owner,
string prefix = null,
string tableName = null,
bool forFilter = false,
string[] displayColumns = null,
IList<string> columnOrder = null)
{
//aggregate own and parent's columns and return in default order
var columnsList = new ColumnCollection();
AddColumnsInternal(columnsList, itemType, owner, prefix, tableName, forFilter, displayColumns, columnOrder);
columns.AddRange(columnsList.OrderBy(c => c.DefaultOrder));
}
开发者ID:mparsin,项目名称:Elements,代码行数:28,代码来源:ColumnsExtensions.cs
示例14: SynchronizeColumnSort
protected void SynchronizeColumnSort(
SynchronizationContext synchronizationContext,
SortDescriptionCollection sortDescriptions,
ColumnCollection columns )
{
ColumnSortCommand.ThrowIfNull( synchronizationContext, "synchronizationContext" );
ColumnSortCommand.ThrowIfNull( sortDescriptions, "sortDescriptions" );
ColumnSortCommand.ThrowIfNull( columns, "columns" );
if( !synchronizationContext.Own || !columns.Any() )
return;
this.SetResortCallback( sortDescriptions, columns );
int count = sortDescriptions.Count;
Dictionary<string, ColumnSortInfo> sortOrder = new Dictionary<string, ColumnSortInfo>( count );
for( int i = 0; i < count; i++ )
{
var sortDescription = sortDescriptions[ i ];
string propertyName = sortDescription.PropertyName;
if( sortOrder.ContainsKey( propertyName ) )
continue;
sortOrder.Add( propertyName, new ColumnSortInfo( i, sortDescription.Direction ) );
}
foreach( var column in columns )
{
ColumnSortInfo entry;
if( sortOrder.TryGetValue( column.FieldName, out entry ) )
{
column.SetSortIndex( entry.Index );
column.SetSortDirection( entry.Direction );
}
else
{
column.SetSortIndex( -1 );
column.SetSortDirection( SortDirection.None );
}
}
}
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:44,代码来源:UpdateColumnSortCommand.cs
示例15: DataTableDpoClass
public DataTableDpoClass(DataTable table)
{
DatabaseName dname = new DatabaseName(ConnectionProviderManager.DefaultProvider, "MEM");
this.table = table;
this.tableName = new ClassTableName(new TableName(dname, TableName.dbo, table.TableName));
this._columns = new ColumnCollection(this);
foreach (DataColumn c in table.Columns)
{
this._columns.Add(new DtColumn(c));
}
this._identity = new IdentityKeys(this._columns);
this._computedColumns = new ComputedColumns(this._columns);
this._columns.UpdatePrimary(this.PrimaryKeys);
this._columns.UpdateForeign(this.ForeignKeys);
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:20,代码来源:DataTableDpoClass.cs
示例16: GetColumns
public ColumnCollection GetColumns()
{
ColumnCollection temp = new ColumnCollection();
DataTable dt = (DataTable)data_source.DataSource;
int i = 0;
foreach (DataColumn dc in dt.Columns)
{
IColumn col = ColumnTypeDelegator.getByType(dc.DataType);
col.HeadText = dc.ColumnName;
col.Width = 100;
col.DataSourceColumnIndex = i;
temp.Add(col);
i++;
}
return temp;
}
开发者ID:pyramida,项目名称:DunaGrid,代码行数:20,代码来源:BindingSourceDataReader.cs
示例17: DetailConfiguration
public DetailConfiguration()
{
var columns = new ColumnCollection( this.DataGridControl, this );
this.SetColumns( columns );
this.Columns.CollectionChanged += new NotifyCollectionChangedEventHandler( this.OnColumnsCollectionChanged );
VisibilityChangedEventManager.AddListener( this.Columns, this );
this.SetVisibleColumns( new ReadOnlyColumnCollection() );
m_columnsByVisiblePosition = new HashedLinkedList<ColumnBase>();
m_columnSynchronizationManager = new ColumnSynchronizationManager( this );
this.SetHeaders( new ObservableCollection<DataTemplate>() );
this.SetFooters( new ObservableCollection<DataTemplate>() );
this.SetGroupLevelDescriptions( new GroupLevelDescriptionCollection() );
this.SetDetailConfigurations( new DetailConfigurationCollection( this.DataGridControl, this ) );
CollectionChangedEventManager.AddListener( this.DetailConfigurations, this );
}
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:21,代码来源:DetailConfiguration.cs
示例18: GetUserViewSettings
public List<UserViewSettings> GetUserViewSettings(Guid userId, List<string> calendarIds)
{
var cc = new ColumnCollection();
var extCalId = cc.RegistryColumn("ext_calendar_id");
var usrId = cc.RegistryColumn("user_id");
var hideEvents = cc.RegistryColumn("hide_events");
var isAccepted = cc.RegistryColumn("is_accepted");
var textColor = cc.RegistryColumn("text_color");
var background = cc.RegistryColumn("background_color");
var alertType = cc.RegistryColumn("alert_type");
var calId = cc.RegistryColumn("calendar_id");
var calName = cc.RegistryColumn("name");
var timeZone = cc.RegistryColumn("time_zone");
var data = DbManager
.ExecuteList(
new SqlQuery("calendar_calendar_user").Select(cc.SelectQuery)
.Where((Exp.In(extCalId.Name, calendarIds) | Exp.In(calId.Name, calendarIds)) & Exp.Eq(usrId.Name, userId))
);
var options = new List<UserViewSettings>();
foreach (var r in data)
{
options.Add(new UserViewSettings()
{
CalendarId = Convert.ToInt32(r[calId.Ind]) == 0 ? Convert.ToString(r[extCalId.Ind]) : Convert.ToString(r[calId.Ind]),
UserId = usrId.Parse<Guid>(r),
IsHideEvents = hideEvents.Parse<bool>(r),
IsAccepted = isAccepted.Parse<bool>(r),
TextColor = textColor.Parse<string>(r),
BackgroundColor = background.Parse<string>(r),
EventAlertType = (EventAlertType)alertType.Parse<int>(r),
Name = calName.Parse<string>(r),
TimeZone = timeZone.Parse<TimeZoneInfo>(r)
});
}
return options;
}
开发者ID:vipwan,项目名称:CommunityServer,代码行数:40,代码来源:DataProvider.cs
示例19: parseStringTest
public void parseStringTest()
{
Condition_Accessor target = new Condition_Accessor(); // TODO: Initialize to an appropriate value
ColumnCollection grid_columns = new ColumnCollection();
grid_columns.Add(new TextColumn("Sloupec 1"));
grid_columns.Add(new TextColumn("Sloupec 2"));
grid_columns.Add(new NumberColumn("Sloupec 3"));
grid_columns.Add(new NumberColumn("cislo"));
grid_columns.Add(new TextColumn("Sloupec like"));
Check(target, "[Sloupec 1] = 100", grid_columns, grid_columns[0], "100", Operators.equal);
Check(target, "cislo > 56", grid_columns, grid_columns[3], "56", Operators.greater_than);
Check(target, "cislo >= '56'", grid_columns, grid_columns[3], "56", Operators.greater_than | Operators.equal);
Check(target, "[Sloupec 2] LIKE '160%'", grid_columns, grid_columns[1], "160%", Operators.like);
Check(target, "[Sloupec 2] like '160%'", grid_columns, grid_columns[1], "160%", Operators.like);
Check(target, "Sloupec 2 like '160%'", grid_columns, grid_columns[1], "160%", Operators.like);
Check(target, "Sloupec 2 like 'neco = pokus'", grid_columns, grid_columns[1], "neco = pokus", Operators.like);
Check(target, "Sloupec 1 REGeXp 'neco.*'", grid_columns, grid_columns[0], "neco.*", Operators.regexp);
Check(target, "[Sloupec like] like '160%'", grid_columns, grid_columns[4], "160%", Operators.like);
}
开发者ID:pyramida,项目名称:DunaGrid,代码行数:22,代码来源:ConditionTest.cs
示例20: GetColumns
/// <summary>
/// Creates and caches an instance of a <see cref="ColumnCollection"/> for a <see cref="View"/>.
/// </summary>
/// <param name="view">The <see cref="View"/> from which column information is retrieved.</param>
/// <returns>A new or cached copy of columns for the <see cref="View.QueryString"/>.</returns>
/// <exception cref="ArgumentNullException">The <paramref name="view"/> parameter value is null.</exception>
internal static ColumnCollection GetColumns(View view)
{
if (null == view)
{
throw new ArgumentNullException("view");
}
ColumnCollection columns;
if (views.ContainsKey(view.QueryString) && views[view.QueryString].IsAlive)
{
// Get an existing collection.
columns = (ColumnCollection)views[view.QueryString].Target;
}
else
{
// Add or set a new column collection;
columns = new ColumnCollection(view);
views[view.QueryString] = new WeakReference(columns);
}
return columns;
}
开发者ID:heaths,项目名称:psmsi,代码行数:28,代码来源:ViewManager.cs
注:本文中的ColumnCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论