示例#1
0
        protected override void OnDragEnter(DragEventArgs dragevent)
        {
            List <string> droppedFiles = GetDroppedFiles(dragevent);

            Point             appWidgetPos      = GetPosForAppWidget(dragevent);
            FileDropEventArgs fileDropEventArgs = new FileDropEventArgs(droppedFiles, appWidgetPos.X, appWidgetPos.Y);

            aggAppWidget.OnDragEnter(fileDropEventArgs);
            if (fileDropEventArgs.AcceptDrop)
            {
                dragevent.Effect = DragDropEffects.Copy;
            }

            base.OnDragEnter(dragevent);
        }
		public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
		{
			if (libraryDataView != null
				&& libraryDataView.CurrentLibraryProvider != null
				&& !libraryDataView.CurrentLibraryProvider.IsProtected())
			{
				libraryDataView.CurrentLibraryProvider.AddFilesToLibrary(fileDropEventArgs.DroppedFiles);
			}

			base.OnDragDrop(fileDropEventArgs);
		}
		public override void OnDragOver(FileDropEventArgs fileDropEventArgs)
		{
			if (libraryDataView != null
				&& libraryDataView.CurrentLibraryProvider != null
				&& !libraryDataView.CurrentLibraryProvider.IsProtected())
			{
				foreach (string file in fileDropEventArgs.DroppedFiles)
				{
					string extension = Path.GetExtension(file).ToUpper();
					if ((extension != "" && MeshFileIo.ValidFileExtensions().Contains(extension))
						|| extension == ".GCODE"
						|| extension == ".ZIP")
					{
						fileDropEventArgs.AcceptDrop = true;
						break;
					}
				}
			}
			base.OnDragOver(fileDropEventArgs);
		}
		public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
		{
			libraryDataView.CurrentLibraryProvider.AddFilesToLibrary(fileDropEventArgs.DroppedFiles);

			base.OnDragDrop(fileDropEventArgs);
		}
        public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
            {
                string extension = Path.GetExtension(droppedFileName).ToUpper();
                if (extension == ".STL" || extension == ".GCODE")
                {
                    QueueData.Instance.AddItem(new PrintItemWrapper(new PrintItem(Path.GetFileNameWithoutExtension(droppedFileName), Path.GetFullPath(droppedFileName))));
                }
                else if (extension == ".ZIP")
                {
                    ProjectFileHandler project = new ProjectFileHandler(null);
                    List<PrintItem> partFiles = project.ImportFromProjectArchive(droppedFileName);
                    if (partFiles != null)
                    {
                        foreach (PrintItem part in partFiles)
                        {
                            QueueData.Instance.AddItem(new PrintItemWrapper(new PrintItem(part.Name, part.FileLocation)));
                        }
                    }
                }
            }

            base.OnDragDrop(fileDropEventArgs);
        }
示例#6
0
		public override void OnDragOver(FileDropEventArgs fileDropEventArgs)
		{
			if (AllowDragDrop())
			{
				foreach (string file in fileDropEventArgs.DroppedFiles)
				{
					string extension = Path.GetExtension(file).ToLower();
					if (extension != "" && ApplicationSettings.OpenDesignFileParams.Contains(extension))
					{
						fileDropEventArgs.AcceptDrop = true;
					}
				}
			}
			base.OnDragOver(fileDropEventArgs);
		}
        public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
            {
                string extension = Path.GetExtension(droppedFileName).ToUpper();
                if (extension == ".STL" || extension == ".GCODE")
                {
                    PrintItem printItem = new PrintItem();
                    printItem.Name = System.IO.Path.GetFileNameWithoutExtension(droppedFileName);
                    printItem.FileLocation = System.IO.Path.GetFullPath(droppedFileName);
                    printItem.PrintItemCollectionID = PrintLibraryListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    PrintLibraryListItem queueItem = new PrintLibraryListItem(new PrintItemWrapper(printItem));
                    PrintLibraryListControl.Instance.AddChild(queueItem);
                }
                PrintLibraryListControl.Instance.Invalidate();
            }
            PrintLibraryListControl.Instance.SaveLibraryItems();

            base.OnDragDrop(fileDropEventArgs);
        }
示例#8
0
		public virtual void OnDragDrop(FileDropEventArgs fileDropEventArgs)
		{
			// to do this we would need to implement OnDragOver (and debug it, it was a mess when I started it and don't care right now). // LBB 2013 04 30
			if (PositionWithinLocalBounds(fileDropEventArgs.X, fileDropEventArgs.Y))
			{
				for (int i = Children.Count - 1; i >= 0; i--)
				{
					GuiWidget child = Children[i];
					if (child.Visible)
					{
						double childX = fileDropEventArgs.X;
						double childY = fileDropEventArgs.Y;
						child.ParentToChildTransform.inverse_transform(ref childX, ref childY);

						FileDropEventArgs childDropEvent = new FileDropEventArgs(fileDropEventArgs.DroppedFiles, childX, childY);
						child.OnDragDrop(childDropEvent);
					}
				}
			}
		}
示例#9
0
		protected override void OnDragDrop(DragEventArgs dragevent)
		{
			List<string> droppedFiles = GetDroppedFiles(dragevent);

			Point appWidgetPos = GetPosForAppWidget(dragevent);
			FileDropEventArgs fileDropEventArgs = new FileDropEventArgs(droppedFiles, appWidgetPos.X, appWidgetPos.Y);
			aggAppWidget.OnDragDrop(fileDropEventArgs);

			base.OnDragDrop(dragevent);
		}
示例#10
0
		protected override void OnDragOver(DragEventArgs dragevent)
		{
			List<string> droppedFiles = GetDroppedFiles(dragevent);

			Point appWidgetPos = GetPosForAppWidget(dragevent);
			FileDropEventArgs fileDropEventArgs = new FileDropEventArgs(droppedFiles, appWidgetPos.X, appWidgetPos.Y);
			aggAppWidget.OnDragOver(fileDropEventArgs);
			if (fileDropEventArgs.AcceptDrop)
			{
				dragevent.Effect = DragDropEffects.Copy;
			}
			else
			{
				dragevent.Effect = DragDropEffects.None;
			}

			base.OnDragOver(dragevent);
		}
示例#11
0
		public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            DoAddFiles(fileDropEventArgs.DroppedFiles);

            base.OnDragDrop(fileDropEventArgs);
        }
		public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
		{
			foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
			{
				string extension = Path.GetExtension(droppedFileName).ToUpper();
				if ((extension != "" && MeshFileIo.ValidFileExtensions().Contains(extension)))
				{
					meshViewerWidget.LoadMesh(droppedFileName, MeshViewerWidget.CenterPartAfterLoad.DO);
					break;
				}
			}

			base.OnDragDrop(fileDropEventArgs);
		}
        public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
            {
                string extension = Path.GetExtension(droppedFileName).ToUpper();
                if (extension == ".STL" || extension == ".GCODE")
                {
                    PrintItem printItem = new PrintItem();
                    printItem.Name = Path.GetFileNameWithoutExtension(droppedFileName);
                    printItem.FileLocation = Path.GetFullPath(droppedFileName);
                    printItem.PrintItemCollectionID = LibraryData.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    LibraryData.Instance.AddItem(new PrintItemWrapper(printItem));
                }
            }

            base.OnDragDrop(fileDropEventArgs);
        }
        public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            pendingPartsToLoad.Clear();
            foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
            {
                string extension = Path.GetExtension(droppedFileName).ToUpper();
                if (extension == ".STL")
                {
                    pendingPartsToLoad.Add(droppedFileName);
                }
            }

            bool enterEditModeBeforeAddingParts = enterEditButtonsContainer.Visible == true;
            if (enterEditModeBeforeAddingParts)
            {
                EnterEditAndSplitIntoMeshes();
            }
            else
            {
                LoadAndAddPartsToPlate(pendingPartsToLoad.ToArray());
            }

            base.OnDragDrop(fileDropEventArgs);
        }
示例#15
0
		public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
		{
			LibraryData.Instance.LoadFilesIntoLibrary(fileDropEventArgs.DroppedFiles);

			base.OnDragDrop(fileDropEventArgs);
		}
        public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
            {
                string extension = Path.GetExtension(droppedFileName).ToUpper();
                if (extension == ".STL" || extension == ".GCODE")
                {
                    PrintQueueItem queueItem = new PrintQueueItem(System.IO.Path.GetFileNameWithoutExtension(droppedFileName), System.IO.Path.GetFullPath(droppedFileName));
                    PrintQueueControl.Instance.AddChild(queueItem);
                }
                PrintQueueControl.Instance.EnsureSelection();
                PrintQueueControl.Instance.Invalidate();
            }
            PrintQueueControl.Instance.SaveDefaultQueue();

            base.OnDragDrop(fileDropEventArgs);
        }
示例#17
0
		public virtual void OnDragOver(FileDropEventArgs fileDropEventArgs)
		{
			if (PositionWithinLocalBounds(fileDropEventArgs.X, fileDropEventArgs.Y))
			{
				for (int i = Children.Count - 1; i >= 0; i--)
				{
					GuiWidget child = Children[i];
					if (child.Visible)
					{
						double childX = fileDropEventArgs.X;
						double childY = fileDropEventArgs.Y;
						child.ParentToChildTransform.inverse_transform(ref childX, ref childY);

						FileDropEventArgs childDropEvent = new FileDropEventArgs(fileDropEventArgs.DroppedFiles, childX, childY);
						child.OnDragOver(childDropEvent);
						if (childDropEvent.AcceptDrop)
						{
							fileDropEventArgs.AcceptDrop = true;
						}
					}
				}
			}
		}
		public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
		{
			int preAddCount = QueueData.Instance.Count;

			foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
			{
				string extension = Path.GetExtension(droppedFileName).ToUpper();
				if (MeshFileIo.ValidFileExtensions().Contains(extension)
					|| extension == ".GCODE")
				{
					QueueData.Instance.AddItem(new PrintItemWrapper(new PrintItem(Path.GetFileNameWithoutExtension(droppedFileName), Path.GetFullPath(droppedFileName))));
				}
				else if (extension == ".ZIP")
				{
					ProjectFileHandler project = new ProjectFileHandler(null);
					List<PrintItem> partFiles = project.ImportFromProjectArchive(droppedFileName);
					if (partFiles != null)
					{
						foreach (PrintItem part in partFiles)
						{
							QueueData.Instance.AddItem(new PrintItemWrapper(new PrintItem(part.Name, part.FileLocation)));
						}
					}
				}
			}

			if (QueueData.Instance.Count != preAddCount)
			{
				QueueData.Instance.SelectedIndex = QueueData.Instance.Count - 1;
			}

			base.OnDragDrop(fileDropEventArgs);
		}
 public override void OnDragOver(FileDropEventArgs fileDropEventArgs)
 {
     foreach (string file in fileDropEventArgs.DroppedFiles)
     {
         string extension = Path.GetExtension(file).ToUpper();
         if (extension == ".STL" || extension == ".GCODE")
         {
             fileDropEventArgs.AcceptDrop = true;
         }
     }
     base.OnDragOver(fileDropEventArgs);
 }
        public override void OnDragOver(FileDropEventArgs fileDropEventArgs)
        {
            base.OnDragOver(fileDropEventArgs);

            if (!fileDropEventArgs.AcceptDrop)
            {
                // no child has accepted the drop
                foreach (string file in fileDropEventArgs.DroppedFiles)
                {
                    string extension = Path.GetExtension(file).ToUpper();
                    if ((extension != "" && MeshFileIo.ValidFileExtensions().Contains(extension))
                        || extension == ".GCODE"
                        || extension == ".ZIP")
                    {
                        fileDropEventArgs.AcceptDrop = true;
                    }
                }
                dropWasOnChild = false;
            }
            else
            {
                dropWasOnChild = true;
            }
        }
示例#21
0
		public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
		{
			if (AllowDragDrop())
			{
				pendingPartsToLoad.Clear();
				foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
				{
					string extension = Path.GetExtension(droppedFileName).ToLower();
					if (extension != "" && ApplicationSettings.OpenDesignFileParams.Contains(extension))
					{
						pendingPartsToLoad.Add(droppedFileName);
					}
				}

				if (pendingPartsToLoad.Count > 0)
				{
					bool enterEditModeBeforeAddingParts = enterEditButtonsContainer.Visible == true;
					if (enterEditModeBeforeAddingParts)
					{
						EnterEditAndCreateSelectionData();
					}
					else
					{
						LoadAndAddPartsToPlate(pendingPartsToLoad.ToArray());
					}
				}
			}

			base.OnDragDrop(fileDropEventArgs);
		}
        public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            base.OnDragDrop(fileDropEventArgs);

            if (!dropWasOnChild)
            {
                QueueDataWidget.DoAddFiles(fileDropEventArgs.DroppedFiles);
            }
        }
		public override void OnDragOver(FileDropEventArgs fileDropEventArgs)
		{
			foreach (string file in fileDropEventArgs.DroppedFiles)
			{
				string extension = Path.GetExtension(file).ToUpper();
				if ((extension != "" && MeshFileIo.ValidFileExtensions().Contains(extension))
					|| extension == ".GCODE"
					|| extension == ".ZIP")
				{
					fileDropEventArgs.AcceptDrop = true;
					break;
				}
			}
			base.OnDragOver(fileDropEventArgs);
		}
		public override void OnDragEnter(FileDropEventArgs fileDropEventArgs)
		{
			foreach (string file in fileDropEventArgs.DroppedFiles)
			{
				string extension = Path.GetExtension(file).ToUpper();
				if (MeshFileIo.ValidFileExtensions().Contains(extension))
				{
					fileDropEventArgs.AcceptDrop = true;
				}
			}
			base.OnDragEnter(fileDropEventArgs);
		}