本文整理汇总了C#中System.Windows.RoutedEventArgs.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# RoutedEventArgs.GetType方法的具体用法?C# RoutedEventArgs.GetType怎么用?C# RoutedEventArgs.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.RoutedEventArgs
的用法示例。
在下文中一共展示了RoutedEventArgs.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleSelect
//.........这里部分代码省略.........
unselectingRow.RowFocus = false;
}
}
// Items in selection range...
for (int selectRowIndex = startRow; selectRowIndex <= endRow; selectRowIndex++)
{
DataBoundRow selectingRow = this.mainView.View.Rows[selectRowIndex];
if (this.SelectedItems.Contains(selectingRow) == false)
{
this.SelectedItems.Add(selectingRow);
addedItems.Add(selectingRow);
selectingRow.RowSelected = true;
selectingRow.RowFocus = false;
}
this.SelectedItem = selectingRow;
}
// Items after selection range...
for (int afterRowIndex = endRow + 1; afterRowIndex < this.mainView.View.Rows.Count - 1; afterRowIndex++)
{
unselectingRow = this.mainView.View.Rows[afterRowIndex];
if (this.SelectedItems.Contains(unselectingRow) == true)
{
this.SelectedItems.Remove(unselectingRow);
removedItems.Add(unselectingRow);
unselectingRow.Select(false);
unselectingRow.RowSelected = false;
unselectingRow.RowFocus = false;
}
}
if (e.GetType() == typeof(System.Windows.Input.KeyEventArgs))
{
if (endRow + 2 == this.mainView.View.Rows.Count && ((KeyEventArgs)e).Key == Key.Up)
{
unselectingRow = this.mainView.View.Rows[endRow + 1];
if (this.SelectedItems.Contains(unselectingRow) == true)
{
this.SelectedItems.Remove(unselectingRow);
removedItems.Add(unselectingRow);
unselectingRow.Select(false);
unselectingRow.RowSelected = false;
unselectingRow.RowFocus = false;
}
}
}
else if (e.GetType() == typeof(System.Windows.Input.MouseButtonEventArgs))
{
if (endRow + 1 != this.mainView.View.Rows.Count)
{
unselectingRow = this.mainView.View.Rows[this.mainView.View.Rows.Count - 1];
if (this.SelectedItems.Contains(unselectingRow) == true)
{
this.SelectedItems.Remove(unselectingRow);
removedItems.Add(unselectingRow);
unselectingRow.Select(false);
unselectingRow.RowSelected = false;
unselectingRow.RowFocus = false;
}
}
}
}
else
{
示例2: btnExport_Click
// exports credit cards in txt fiile
private void btnExport_Click(object sender, RoutedEventArgs e)
{
try
{
XMLSerialization.Export(users, "exportInfo.txt");
}
catch (DirectoryNotFoundException ex)
{
MessageBox.Show(
string.Format("There was a problem exporting these files {0}", ex.Message),
string.Format("Error of type {0}", e.GetType()));
}
catch (PathTooLongException ex)
{
MessageBox.Show(
string.Format("There was a problem exporting these files {0}", ex.Message),
string.Format("Error of type {0}", e.GetType()));
}
catch (Exception ex)
{
MessageBox.Show(
string.Format("there was a problem exporting these files {0}", ex.Message),
string.Format("Error of type {0}", e.GetType()));
}
}