本文整理汇总了C#中ListSortDirection类的典型用法代码示例。如果您正苦于以下问题:C# ListSortDirection类的具体用法?C# ListSortDirection怎么用?C# ListSortDirection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListSortDirection类属于命名空间,在下文中一共展示了ListSortDirection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SortInfo
//Deserialization constructor.
public SortInfo(SerializationInfo info, StreamingContext ctxt)
{
//Get the values from info and assign them to the appropriate properties
_columnIndex = (int)info.GetValue("ColumnIndex", typeof(int));
_propertyName = (String)info.GetValue("PropertyName", typeof(string));
_direction = (ListSortDirection)info.GetValue("Direction", typeof(ListSortDirection));
}
示例2: VarietiesViewModel
public VarietiesViewModel(IProjectService projectService, IDialogService dialogService, IAnalysisService analysisService, VarietiesVarietyViewModel.Factory varietyFactory)
: base("Varieties")
{
_projectService = projectService;
_dialogService = dialogService;
_analysisService = analysisService;
_varietyFactory = varietyFactory;
_projectService.ProjectOpened += _projectService_ProjectOpened;
_sortPropertyName = "Meaning.Gloss";
_sortDirection = ListSortDirection.Ascending;
Messenger.Default.Register<SwitchViewMessage>(this, HandleSwitchView);
_findCommand = new RelayCommand(Find);
TaskAreas.Add(new TaskAreaItemsViewModel("Common tasks",
new TaskAreaCommandViewModel("Add a new variety", new RelayCommand(AddNewVariety)),
new TaskAreaCommandViewModel("Rename variety", new RelayCommand(RenameSelectedVariety, CanRenameSelectedVariety)),
new TaskAreaCommandViewModel("Remove variety", new RelayCommand(RemoveSelectedVariety, CanRemoveSelectedVariety)),
new TaskAreaCommandViewModel("Find words", _findCommand),
new TaskAreaItemsViewModel("Sort words by", new TaskAreaCommandGroupViewModel(
new TaskAreaCommandViewModel("Gloss", new RelayCommand(() => SortWordsBy("Meaning.Gloss", ListSortDirection.Ascending))),
new TaskAreaCommandViewModel("Form", new RelayCommand(() => SortWordsBy("StrRep", ListSortDirection.Ascending)))))));
TaskAreas.Add(new TaskAreaItemsViewModel("Other tasks",
new TaskAreaCommandViewModel("Remove affixes from words", new RelayCommand(RunStemmer, CanRunStemmer))));
}
示例3: CaseListSort
public CaseListSort(ListSortDirection direction, DataGridColumn column)
{
int dir = (direction == ListSortDirection.Ascending) ? 1: -1;
string path = BindingOperations.GetBindingExpression(column, DataGridColumn.HeaderProperty).ParentBinding.Path.Path;
switch (path)
{
case "CaseId":
myComparer = (a, b) => { return a.CaseId.CompareTo(b.CaseId) * dir; };
break;
case "AnalystComment":
myComparer = (a, b) => { return a.AnalystComment.CompareTo(b.AnalystComment) * dir;};
break;
case "ObjectId":
myComparer = (a, b) => { return a.ObjectId.CompareTo(b.ObjectId) * dir;};
break;
case "FlightNumber":
myComparer = (a, b) => { return a.FlightNumber.CompareTo(b.FlightNumber) * dir; };
break;
case "Analyst":
myComparer = (a, b) => { return a.Analyst.CompareTo(b.Analyst) * dir; };
break;
case "CaseDirectory":
myComparer = (a, b) => { return a.CaseDirectory.CompareTo(b.CaseDirectory) * dir; };
break;
case "ReferenceImage":
myComparer = (a, b) => { return a.ReferenceImage.CompareTo(b.ReferenceImage) * dir; };
break;
case "Result":
myComparer = (a, b) => { return a.Result.CompareTo(b.Result) * dir; };
break;
case "UpdateTime":
myComparer = (a, b) => { return a.UpdateTime.CompareTo(b.UpdateTime) * dir; };
break;
case "CreateTime":
myComparer = (a, b) => { return a.CreateTime.CompareTo(b.CreateTime) * dir; };
break;
case "Archived":
myComparer = (a, b) => { return a.Archived.CompareTo(b.Archived) * dir; };
break;
case "AnalysisTime":
myComparer = (a, b) => { return a.AnalysisTime.CompareTo(b.AnalysisTime) * dir; };
break;
default:
myComparer = (a, b) => { return 0; };
break;
}
}
示例4: _SetSortOrder
private void _SetSortOrder( IEnumerable itemsSource, string propertyName, ListSortDirection direction )
{
var view = CollectionViewSource.GetDefaultView( itemsSource );
view.SortDescriptions.Clear( );
view.SortDescriptions.Add( new SortDescription( propertyName, direction ) );
view.Refresh( );
}
示例5: GroupColumn
public GroupColumn(string columnName,int groupLevel, ListSortDirection sortDirection):base(columnName,sortDirection)
{
this.groupLevel = groupLevel;
if (groupLevel < 0) {
throw new GroupLevelException();
}
}
示例6: dataGrid1_Sorting
private void dataGrid1_Sorting(object sender, DataGridSortingEventArgs e)
{
sortMemberPath = e.Column.SortMemberPath;
sortDirection = e.Column.SortDirection != ListSortDirection.Ascending ?
ListSortDirection.Ascending : ListSortDirection.Descending;
}
示例7: Sort
private void Sort(string sortBy, ListSortDirection direction)
{
try
{
ICollectionView dataView = CollectionViewSource.GetDefaultView(listView_log.DataContext);
dataView.SortDescriptions.Clear();
SortDescription sd = new SortDescription(sortBy, direction);
dataView.SortDescriptions.Add(sd);
if (_lastHeaderClicked2 != null)
{
if (String.Compare(sortBy, _lastHeaderClicked2) != 0)
{
SortDescription sd2 = new SortDescription(_lastHeaderClicked2, _lastDirection2);
dataView.SortDescriptions.Add(sd2);
}
}
dataView.Refresh();
Settings.Instance.ResColumnHead = sortBy;
Settings.Instance.ResSortDirection = direction;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
示例8: SortGlyphAdorner
/// <summary>
/// Initializes a new instance of the <see cref="SortGlyphAdorner"/> class.
/// </summary>
/// <param name="columnHeader">The column header</param>
/// <param name="direction">The direction</param>
/// <param name="sortGlyph">The image glyph</param>
public SortGlyphAdorner(GridViewColumnHeader columnHeader, ListSortDirection direction, ImageSource sortGlyph)
: base(columnHeader)
{
this.columnHeader = columnHeader;
this.direction = direction;
this.sortGlyph = sortGlyph;
}
示例9: Key
internal Key(DataTable table,DataColumn[] columns,ListSortDirection[] sort, DataViewRowState rowState, IExpression filter)
{
_table = table;
_filter = filter;
if (_filter != null)
_tmpRow = _table.NewNotInitializedRow();
_columns = columns;
if (sort != null && sort.Length == columns.Length) {
_sortDirection = sort;
}
else {
_sortDirection = new ListSortDirection[columns.Length];
for(int i=0; i < _sortDirection.Length; i++) {
_sortDirection[i] = ListSortDirection.Ascending;
}
}
if (rowState != DataViewRowState.None) {
_rowStateFilter = rowState;
}
else {
// FIXME : what is the correct value ?
_rowStateFilter = DataViewRowState.CurrentRows;
}
}
示例10: ColumnOrderSet
public ColumnOrderSet(ColumnDefinition column, ListSortDirection order)
: this()
{
column.ThrowIfNull("column");
this.Column = column;
this.Direction = order;
}
示例11: ExtendedSortDescription
public ExtendedSortDescription(string property, ListSortDirection? sortDirection, bool clearPreviousSorting)
: this()
{
this.Property = property;
this.SortDirection = sortDirection;
this.ClearPreviousSorting = clearPreviousSorting;
}
示例12: refreshOutgoing
public void refreshOutgoing()
{
this.BeginInvoke((ThreadStart)delegate
{
int scrollPosition = dg_outgoing.FirstDisplayedScrollingRowIndex;
DataGridViewColumn sortedColumn = dg_outgoing.SortedColumn;
ListSortDirection sorder = new ListSortDirection();
bool doSort = true;
if (dg_outgoing.SortOrder == SortOrder.Ascending) sorder = ListSortDirection.Ascending;
else if (dg_outgoing.SortOrder == SortOrder.Descending) sorder = ListSortDirection.Descending;
else doSort = false;
Point pp = Point.Empty;
if (dg_outgoing.SelectedCells.Count > 0)
pp = dg_outgoing.CurrentCellAddress;
dg_outgoing.Rows.Clear();
foreach (DictionaryEntry de in mtOut.getMessages())
{
canMessage cm = (canMessage)de.Key;
dg_outgoing.Rows.Add(cm.getDataGridViewRow(dg_outgoing,mtOut));
}
if (doSort) dg_outgoing.Sort(sortedColumn,(ListSortDirection) sorder);
if (scrollPosition > 0) dg_outgoing.FirstDisplayedScrollingRowIndex = scrollPosition;
if (dg_outgoing.Rows.Count > 0 && pp.Y < dg_outgoing.Rows.Count)
dg_outgoing.CurrentCell = dg_outgoing.Rows[pp.Y].Cells[pp.X];
});
}
示例13: SortExpression
public SortExpression(string propertyName)
{
PropertyName = propertyName;
SortDirection = ListSortDirection.Ascending;
PropertyDescriptor = null;
_propertyValueCache = new Hashtable();
}
示例14: SortAdorner
public SortAdorner(UIElement element, ListSortDirection sortDirection)
: base(element)
{
this.SortDirection = sortDirection;
this.PaintBrush = ((element as GridViewColumnHeader).Column as DsxColumn).DataGrid.SortAdornerIndicatorBrush;
}
示例15: SortDescriptionInfo
public SortDescriptionInfo(
DataGridItemPropertyBase property,
ListSortDirection direction )
{
m_property = property;
m_direction = direction;
}