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


C# DragEventHandler类代码示例

本文整理汇总了C#中DragEventHandler的典型用法代码示例。如果您正苦于以下问题:C# DragEventHandler类的具体用法?C# DragEventHandler怎么用?C# DragEventHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: EditorHelper

        private string[] snippets = { }; //{ "diag_log \"\";", "for \"_i\" from 1 to 10 do { debugLog _i; };", "call compile preprocessFileLine Numbers \"\";" };

        #endregion Fields

        #region Constructors

        public EditorHelper(
            EventHandler<TextChangedEventArgs> textAreaTextChanged,
            EventHandler<TextChangedEventArgs> textAreaTextChangedDelayed,
            KeyEventHandler textAreaKeyUp,
            EventHandler textAreaSelectionChangedDelayed,
            DragEventHandler textAreaDragDrop,
            DragEventHandler textAreaDragEnter,
            TabControl mainTabControl,
            AutocompleteMenu armaSense,
            DashGlobal dashGlobal)
        {
            TextAreaTextChanged = textAreaTextChanged;
            TextAreaTextChangedDelayed = textAreaTextChangedDelayed;
            TextAreaKeyUp = textAreaKeyUp;
            TextAreaSelectionChangedDelayed = textAreaSelectionChangedDelayed;
            TextAreaDragDrop = textAreaDragDrop;
            TextAreaDragEnter = textAreaDragEnter;
            MainTabControl = mainTabControl;
            ArmaSense = armaSense;

            DashGlobal = dashGlobal;

            ArmaListItemsCount = 0;
            ArmaSenseKeywords = new List<AutocompleteItem>();

            foreach (var item in keywordList)
            {
                ArmaSenseKeywords.Add(new AutocompleteItem(item) { ImageIndex = 0, ToolTipTitle = "Arma Script Command", ToolTipText = item });
            }
        }
开发者ID:alandoherty,项目名称:dash-core,代码行数:36,代码来源:EditorHelper.cs

示例2: InitializeEvents

        /// <summary>
        /// Initialize class events.
        /// </summary>
        private void InitializeEvents()
        {
            TextChanged += new EventHandler(HandleTextChanged);
            UpdateUI += new EventHandler<UpdateUIEventArgs>(HandleUpdateUI);

            // enable drag & drop
            AllowDrop = true;
            DragOver += new DragEventHandler(HandleDragOver);
            DragDrop += new DragEventHandler(HandleDragDrop);

            // search & replace
            KeyUp += new KeyEventHandler(HandleKeyUp);
            KeyDown += new KeyEventHandler(HandleKeyDown);
            InsertCheck += new EventHandler<InsertCheckEventArgs>(HandleInsertCheck);
            CharAdded += new EventHandler<CharAddedEventArgs>(HandleCharAdded);
            
            MouseWheel += new MouseEventHandler(HandleMouseWheel);
            Painted += new EventHandler<EventArgs>(HandlePainted);

            // create default pens
            grayPen = new Pen(Brushes.Gray);
            dashedPen = new Pen(Brushes.LightGray);
            dashedPen.DashPattern = new[] { 3f, 6f };

            // measure default line size
            lineSize = TextRenderer.MeasureText(new string('/', NewLineHelper), Font);
        }
开发者ID:h3tch,项目名称:ProtoFX,代码行数:30,代码来源:CodeEditor.Events.cs

示例3: AttachmentView

 public AttachmentView()
 {
     // columns
     ColumnHeader FileName = new ColumnHeader();
     FileName.Text = WbLocale.FileName;
     FileName.Width = 100;
     ColumnHeader Size = new ColumnHeader();
     Size.Text = WbLocale.Size;
     Size.Width = 40;
     Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { FileName, Size});
     // details view
     View = View.Details;
     // drag n drop
     AllowDrop = true;
     DragEnter += new DragEventHandler(AttachmentView_DragEnter);
     DragDrop += new DragEventHandler(AttachmentView_DragDrop);
     ItemDrag += new ItemDragEventHandler(AttachmentView_ItemDrag);
     // item activate
     Activation = ItemActivation.Standard;
     ItemActivate += new EventHandler(AttachmentView_ItemActivate);
     // context menu
     MenuItem ins = new MenuItem(WbLocale.Insert);
     ins.Click += new EventHandler(insert_Click);
     deleteMenuItem = new MenuItem(WbLocale.Delete);
     deleteMenuItem.Click += new EventHandler(delete_Click);
     ContextMenu = new ContextMenu(new MenuItem[] { ins, deleteMenuItem });
     ContextMenu.Popup += new EventHandler(ContextMenu_Popup);
 }
开发者ID:djpnewton,项目名称:ddraw,代码行数:28,代码来源:Attachments.cs

示例4: MLifterTextBox

        /// <summary>
        /// Initializes a new instance of the <see cref="MLifterTextBox"/> class.
        /// </summary>
        /// <remarks>Documented by Dev05, 2007-09-19</remarks>
        public MLifterTextBox()
        {
            AllowAnswerSubmit = true;
            BorderStyle = BorderStyle.None;
            Font = new System.Drawing.Font("MS Sans Serif", 14, System.Drawing.FontStyle.Bold);
            SelectionAlignment = HorizontalAlignment.Center;

            //ScrollBars = RichTextBoxScrollBars.ForcedVertical;

            AllowDrop = true;
            DragEnter += new DragEventHandler(MLifterTextBox_DragEnter);
            DragDrop += new DragEventHandler(MLifterTextBox_DragDrop);
            MouseDown += new MouseEventHandler(MLifterTextBox_MouseDown);
            Leave += new EventHandler(MLifterTextBox_Leave);
            ContentsResized += new ContentsResizedEventHandler(MLifterTextBox_ContentsResized);

            caseSensitive = false;
            correctOnTheFly = false;

            StripChars.Add("\n\r");
            StripChars.Add("\r\n");
            StripChars.Add("\n");
            //StripChars.Add(",");

            allowedControlChars.Clear();
            allowedControlChars.Add((char)Keys.Enter);
            allowedControlChars.Add((char)Keys.Back);
            allowedControlChars.Add((char)Keys.Space);
            allowedControlChars.Add((char)Keys.LineFeed);

            IgnoreChars = ".!?;,";
        }
开发者ID:Stoner19,项目名称:Memory-Lifter,代码行数:36,代码来源:MLifterTextBox.cs

示例5: ApplyDragDropMethod

 /// <seealso cref="ApplyDefaultDragDrop(TextBox)"/>
 /// <example>
 /// <code><pre>
 /// this.ApplyDragDropMethod(
 ///   (sender,e)=>{
 ///     if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy;
 ///   },
 ///   (sender,e)=>{
 ///     if (e.Data.GetDataPresent(DataFormats.FileDrop))
 ///     {
 ///       var strFiles = (string[])e.Data.GetData(DataFormats.FileDrop);
 ///       var file = new FileInfo(strFiles[0]);
 ///       strFiles = null;
 ///       Gogo(file);
 ///     }
 ///   });</pre></code>
 /// </example>
 public static void ApplyDragDropMethod(this Control tInput, DragEventHandler TInputDragEnter, DragEventHandler TInputDragDrop)
 {
     // dragdrop
     tInput.AllowDrop = true;
     tInput.DragEnter += TInputDragEnter;
     tInput.DragDrop += TInputDragDrop;
 }
开发者ID:tfwio,项目名称:sd-ext,代码行数:24,代码来源:DragDropFormsExtension.cs

示例6: DashGlobal

        public DashGlobal(
            EventHandler<TextChangedEventArgs> textAreaTextChanged,
            EventHandler<TextChangedEventArgs> textAreaTextChangedDelayed,
            KeyEventHandler textAreaKeyUp,
            EventHandler textAreaSelectionChangedDelayed,
            DragEventHandler textAreaDragDrop,
            DragEventHandler textAreaDragEnter,
            TabControl mainTabControl,
            AutocompleteMenu armaSense,
            Main mainWindow)
        {
            EditorHelper = new EditorHelper(
                textAreaTextChanged,
                textAreaTextChangedDelayed,
                textAreaKeyUp,
                textAreaSelectionChangedDelayed,
                textAreaDragDrop,
                textAreaDragEnter,
                mainTabControl,
                armaSense,
                this);

            TabsHelper = new TabsHelper(
                textAreaTextChanged,
                textAreaSelectionChangedDelayed,
                mainTabControl,
                this);

            FilesHelper = new FilesHelper(this);
            SettingsHelper = new SettingsHelper();

            MainWindow = mainWindow;
        }
开发者ID:alandoherty,项目名称:dash-core,代码行数:33,代码来源:DashGlobal.cs

示例7: Form1

        public Form1()
        {
            InitializeComponent();

            AllowDrop = true;
            DragEnter += new DragEventHandler(Form1_DragEnter);
            DragDrop += new DragEventHandler(Form1_DragDrop);
        }
开发者ID:ming-hai,项目名称:libatc,代码行数:8,代码来源:Form1.cs

示例8: DocumentTreeView

        public DocumentTreeView()
        {
            try
            {
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DocumentTreeView));
                // get image for tree
                ImageList = new ImageList();
                System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(GetType());
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("CLSDFOLD"))); // 0
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("OPENFOLD"))); // 1
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("COMPONENT"))); // 2
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("DOC"))); // 3
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("DXF"))); // 4
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("PDF"))); // 5
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("STARTPAGE"))); // 6
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("DOWNLOAD"))); // 7
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("AI"))); // 8
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("IMAGE"))); // 9
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("MSWORD"))); // 10
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("MSEXCEL"))); // 11
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("MSPPT"))); // 12
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("WRITER"))); // 13
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("CALC"))); // 14
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("ARD"))); // 15
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("ROOT"))); // 16
                ImageList.Images.Add((System.Drawing.Image)(resources.GetObject("PICADOR3D"))); // 17

                // events
                AfterExpand += new TreeViewEventHandler(DocumentTreeView_AfterExpand);
                AfterSelect += new TreeViewEventHandler(DocumentTreeView_AfterSelect);

                MouseDown += new MouseEventHandler(DocumentTreeView_MouseDown);

                this.AllowDrop = true;
                ItemDrag += new ItemDragEventHandler(DocumentTreeView_ItemDrag);
                DragEnter += new DragEventHandler(DocumentTreeView_DragEnter);
                DragOver += new DragEventHandler(DocumentTreeView_DragOver);
                DragDrop += new DragEventHandler(DocumentTreeView_DragDrop);
                NodeDropped += new NodeDroppedHandler(DocumentTreeView_NodeDropped);

                // show tool tips
                ShowNodeToolTips = true;
                // allow drag and drop
                AllowDrop = true;
            }
            catch (Pic.DAL.SQLite.ExceptionDAL ex)
            {
                Debug.Fail(ex.ToString());
                _log.Debug(ex.ToString());
            }
            catch (Exception ex)
            {
                Debug.Fail(ex.ToString());
                _log.Debug(ex.ToString());
            }
        }
开发者ID:minrogi,项目名称:PLMPackLib,代码行数:56,代码来源:DocumentTreeView.cs

示例9: PuzzleControl

 public PuzzleControl()
 {
     InitializeComponent();
     IsMain = false;
     rctTarget.Visibility = Visibility.Hidden;
     DataContextChanged += new DependencyPropertyChangedEventHandler(PuzzleControl_DataContextChanged);
     PreviewDragOver += new DragEventHandler(PuzzleControl_PreviewDragOver);
     PreviewDragLeave += new DragEventHandler(PuzzleControl_PreviewDragLeave);
     PreviewDrop += new DragEventHandler(PuzzleControl_PreviewDrop);
 }
开发者ID:FreddyFlares,项目名称:SlidingBlock,代码行数:10,代码来源:PuzzleControl.xaml.cs

示例10: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            // inform the app that we're ready to load files pass in command line
            App._manualResetEvent.Set();

            // handle file drops
            Drop += new DragEventHandler( FileDrop );
        }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:10,代码来源:MainWindow.xaml.cs

示例11: SETextBox

 public SETextBox()
 {
     AllowDrop = true;
     DragEnter += new DragEventHandler(SETextBox_DragEnter);
     //   DragOver += new DragEventHandler(SETextBox_DragOver); could draw some gfx where drop position is...
     DragDrop += new DragEventHandler(SETextBox_DragDrop);
     MouseDown += new MouseEventHandler(SETextBox_MouseDown);
     MouseUp += new MouseEventHandler(SETextBox_MouseUp);
     KeyDown += SETextBox_KeyDown;
 }
开发者ID:radinamatic,项目名称:subtitleedit,代码行数:10,代码来源:SETextBox.cs

示例12: ListViewDragAndDrop

 public ListViewDragAndDrop()
 {
     DragAndDropEnabled = true;
       IsUpdating = false;
       DoubleBuffered = true;
       OwnerDraw = true;
       DragOver += new DragEventHandler(ListViewDragAndDrop_DragOver);
       _tmrLvScroll = new Timer();
       _tmrLvScroll.Tick += new EventHandler(tmrLVScroll_Tick);
 }
开发者ID:smejko80,项目名称:samschanneledit,代码行数:10,代码来源:ListViewDragAndDrop.cs

示例13: MakeDragEventHandler

		/// <summary>
		/// Create a drag'n'drop event handler.
		/// Windows Forms swallows unhandled exceptions during drag'n'drop, so we report them here.
		/// </summary>
		static DragEventHandler MakeDragEventHandler(DragEventHandler h)
		{
			return (sender, e) => {
				try {
					h(sender, e);
				} catch (Exception ex) {
					OnDragDropException(ex);
				}
			};
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:14,代码来源:TextAreaDragDropHandler.cs

示例14: PathBrowser

        public PathBrowser()
        {
            InitializeComponent();
            Load += new EventHandler(PathBrowser_Load);
            GotFocus += new EventHandler(PathBrowser_GotFocus);
            bBrowse.GotFocus += new EventHandler(bBrowse_GotFocus);
            Paint += new PaintEventHandler(PathBrowser_Paint);
			DragDrop += new DragEventHandler(PathBrowser_DragDrop);
			tPath.DragDrop += new DragEventHandler(tPath_DragDrop);
			tPath.DragEnter += new DragEventHandler(tPath_DragEnter);
        }
开发者ID:mind0n,项目名称:hive,代码行数:11,代码来源:PathBrowser.cs

示例15: FilterTable

 public FilterTable(bool dualMode, bool globalMode)
 {
     this.dualMode = dualMode;
     this.globalMode = globalMode;
     InitializeComponent();
     SetupTable();
     KeyDown += new KeyEventHandler(table_KeyDown);
     DragDrop += new DragEventHandler(OnDragDrop);
     DragEnter += new DragEventHandler(OnDragEnter);
     MouseDoubleClick += new MouseEventHandler(table_MouseDoubleClick);
     CellPropertyChanged += new XPTable.Events.CellEventHandler(table_CellPropertyChanged);
 }
开发者ID:binaryage,项目名称:xrefresh,代码行数:12,代码来源:FilterTable.cs


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