本文整理汇总了C#中MatterHackers.Agg.UI.FileDropEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# FileDropEventArgs类的具体用法?C# FileDropEventArgs怎么用?C# FileDropEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileDropEventArgs类属于MatterHackers.Agg.UI命名空间,在下文中一共展示了FileDropEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDragDrop
public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
{
libraryDataView.CurrentLibraryProvider.AddFilesToLibrary(fileDropEventArgs.DroppedFiles);
base.OnDragDrop(fileDropEventArgs);
}
示例2: OnDragOver
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);
}
示例3: OnDragDrop
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);
}
示例4: OnDragOver
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);
}
示例5: OnDragOver
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);
}
示例6: OnDragDrop
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);
}
示例7: OnDragOver
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);
}
示例8: OnDragOver
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;
}
}
}
}
}
示例9: OnDragDrop
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);
}
示例10: OnDragDrop
public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
{
DoAddFiles(fileDropEventArgs.DroppedFiles);
base.OnDragDrop(fileDropEventArgs);
}
示例11: OnDragDrop
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);
}
示例12: OnDragDrop
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);
}
示例13: OnDragDrop
public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
{
LibraryData.Instance.LoadFilesIntoLibrary(fileDropEventArgs.DroppedFiles);
base.OnDragDrop(fileDropEventArgs);
}
示例14: OnDragDrop
public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
{
if (libraryDataView != null
&& libraryDataView.CurrentLibraryProvider != null
&& !libraryDataView.CurrentLibraryProvider.IsProtected())
{
libraryDataView.CurrentLibraryProvider.AddFilesToLibrary(fileDropEventArgs.DroppedFiles);
}
base.OnDragDrop(fileDropEventArgs);
}
示例15: OnDragDrop
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);
}