/// <summary> /// Handles the Tick event of the FileDropTimer control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remarks>Documented by Dev08, 2009-02-27</remarks> void FileDropTimer_Tick(object sender, EventArgs e) { System.Windows.Forms.Timer timer = sender as System.Windows.Forms.Timer; timer.Stop(); if (timer.Tag != null && timer.Tag is FileDropData) { FileDropData data = (FileDropData)timer.Tag; if (MLifter.DAL.Helper.IsLearningModuleFileName(data.File)) { FolderTreeNode dstNode = treeViewLearnModules.GetNodeAt(data.Coordinates) as FolderTreeNode; if (dstNode == null) { OpenLearningModule(data.File); } else { ImportLearningModule(data.File, dstNode); } } else { OpenConfigFile(data.File); } } timer.Dispose(); }
/// <summary> /// Activates the file drop timer. /// </summary> /// <param name="data">The data.</param> /// <remarks>Documented by Dev03, 2009-03-11</remarks> private void ActivateFileDropTimer(FileDropData data) { //fix for [ML-642] TaskDialog window not visible / File dropping blocks explorer process System.Windows.Forms.Timer FileDropTimer = new System.Windows.Forms.Timer(); FileDropTimer.Interval = 50; FileDropTimer.Tick += new EventHandler(FileDropTimer_Tick); FileDropTimer.Tag = data; FileDropTimer.Start(); }
/// <summary> /// Handles the DragDrop event of the treeViewLearnModules control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.DragEventArgs"/> instance containing the event data.</param> /// <remarks>Documented by Dev03, 2009-03-10</remarks> private void treeViewLearnModules_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0]; FileDropData data = new FileDropData(file, treeViewLearnModules.PointToClient(new Point(e.X, e.Y))); ActivateFileDropTimer(data); } }