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


C# RoutedEventArgs.GetType方法代码示例

本文整理汇总了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
            {
开发者ID:rbirkby,项目名称:mscui,代码行数:67,代码来源:WrapDataGrid.xaml.cs

示例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()));
     }
 }
开发者ID:arr13,项目名称:Multithreaded-TCP-server,代码行数:26,代码来源:Server.xaml.cs


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