本文整理汇总了C#中BrightIdeasSoftware.OlvDropEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# OlvDropEventArgs类的具体用法?C# OlvDropEventArgs怎么用?C# OlvDropEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OlvDropEventArgs类属于BrightIdeasSoftware命名空间,在下文中一共展示了OlvDropEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: dropSink_Dropped
private void dropSink_Dropped(object sender, OlvDropEventArgs e)
{
OnDropped(e);
}
开发者ID:rxantos,项目名称:tesv-snip,代码行数:4,代码来源:ObjectListView.cs
示例2: tlvGroupedFiles_Dropped
private void tlvGroupedFiles_Dropped(object sender, OlvDropEventArgs e)
{
var target = (tlvBranch)e.DropTargetItem.RowObject;
var index = -1;
var toRefresh = new HashSet<tlvBranch>();
if (target.Data is SpectrumSource)
{
index = target.Parent.Children.IndexOf(target);
target = target.Parent;
}
if (e.DataObject.GetType().ToString() == "System.Windows.Forms.DataObject")
{
var sources = new List<tlvBranch>();
foreach (ListViewItem item in lvNonGroupedFiles.SelectedItems)
sources.Add((tlvBranch)item.Tag);
//var sources = from ListViewItem item in lvNonGroupedFiles.SelectedItems
// select (tlvBranch) item.Tag;
foreach (var source in sources)
{
if (index >= 0)
target.Children.Insert(index, source);
else
target.Children.Add(source);
source.Parent = target;
}
toRefresh.Add(target);
var usedItems = from ListViewItem item in lvNonGroupedFiles.SelectedItems
select item;
foreach (var item in usedItems)
lvNonGroupedFiles.Items.Remove(item);
}
else if (e.DataObject is OLVDataObject)
{
var dragging = e.DataObject as OLVDataObject;
var sources = from tlvBranch item in dragging.ModelObjects
where item.Data is SpectrumSource
select item;
var groups = from tlvBranch item in dragging.ModelObjects
where (item.Data is SpectrumSourceGroup
&& (item.Data as SpectrumSourceGroup).Name != "\\")
select item;
var sourcesToIgnore = new List<tlvBranch>();
foreach (var group in groups)
{
//find and ignore spectra in group
getListOfSprectrumSourcesRecursively(group, ref sourcesToIgnore);
group.Parent.Children.Remove(group);
toRefresh.Add(group.Parent);
group.Parent = target;
if (target.Children.Any())
target.Children.Insert(0, group);
else
target.Children.Add(group);
}
sources = from tlvBranch s in sources where !sourcesToIgnore.Contains(s) select s;
foreach (var source in sources)
{
source.Parent.Children.Remove(source);
toRefresh.Add(source.Parent);
source.Parent = target;
if (index >= 0)
target.Children.Insert(index, source);
else
target.Children.Add(source);
}
toRefresh.Add(target);
tlvGroupedFiles.Expand(target);
}
foreach (var item in toRefresh)
tlvGroupedFiles.RefreshObject(item);
OrganizeNode(target);
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:80,代码来源:GroupingControlForm.cs
示例3: dropSink_CanDrop
// Forward events from the drop sink to the control itself
private void dropSink_CanDrop(object sender, OlvDropEventArgs e)
{
OnCanDrop(e);
}
开发者ID:rxantos,项目名称:tesv-snip,代码行数:5,代码来源:ObjectListView.cs
示例4: olvCraftList_Dropped
/// <summary>
/// Handles when external files are dropped into the list view
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void olvCraftList_Dropped(object sender, OlvDropEventArgs e)
{
if (!e.DragEventArgs.Data.GetDataPresent(DataFormats.FileDrop, false)) return;
// File system list of paths of files dropped into the list view
var files = ((string[])e.DragEventArgs.Data.GetData(DataFormats.FileDrop)).ToList();
_craftFileHandler.CopyNewCraftToSave(files, cbDefaultSave.Text);
UpdateList();
}
开发者ID:WCapelle,项目名称:CKAN-plugins,代码行数:15,代码来源:PluginUI.cs
示例5: tlvGroupedFiles_CanDrop
private void tlvGroupedFiles_CanDrop(object sender, OlvDropEventArgs e)
{
if (e.DataObject.GetType().ToString() == "System.Windows.Forms.DataObject")
e.Effect = DragDropEffects.Move;
else if (e.DataObject is OLVDataObject && e.DropTargetItem != null
&& (e.DropTargetItem.RowObject is tlvBranch
&& ((e.DropTargetItem.RowObject as tlvBranch).Data is SpectrumSourceGroup
|| (e.DropTargetItem.RowObject as tlvBranch).Data is SpectrumSource)))
{
var target = e.DropTargetItem.RowObject as tlvBranch;
var dragging = (e.DataObject as OLVDataObject).ModelObjects;
var isValid = true;
foreach (var item in dragging)
{
if (checkIfDestGroupAChildNodeOfMe(target,item as tlvBranch))
{
isValid = false;
break;
}
}
if (isValid)
e.Effect = DragDropEffects.Move;
else
e.Effect = DragDropEffects.None;
}
else
e.Effect = DragDropEffects.None;
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:28,代码来源:GroupingControlForm.cs
示例6: OnCanDrop
/// <summary>
///
/// </summary>
/// <param name="args"></param>
protected virtual void OnCanDrop(OlvDropEventArgs args) {
if (this.CanDrop != null)
this.CanDrop(this, args);
}
开发者ID:heliwave,项目名称:QuranCode,代码行数:8,代码来源:Events.cs
示例7: dropSink_CanDrop
// Forward events from the drop sink to the control itself
void dropSink_CanDrop(object sender, OlvDropEventArgs e)
{
this.OnCanDrop(e);
}
开发者ID:ZlayaZhaba,项目名称:XervBackup,代码行数:5,代码来源:ObjectListView.cs
示例8: fdlvDetalle_Dropped
private void fdlvDetalle_Dropped(object sender, OlvDropEventArgs e)
{
e.Handled = true;
OLVDataObject o = e.DataObject as OLVDataObject;
if (o != null)
{
OLVListItem target = e.DropTargetItem;
bool targetModelo = false;
if (target != null)
{
DataRowView drv = (DataRowView)target.RowObject;
if (drv.Row["LIDO_ID"].ToString() == "N")
{
targetModelo = true;
}
}
foreach (var model in o.ModelObjects)
{
if (model is odts.PresupuestoVentaBloque)
{
bool permitir = true;
foreach (odts.PresupuestoVentaDetalle d in ((odts.PresupuestoVentaBloque)model).Detalle)
{
if (EsArticuloDuplicado(d.ArtiId1))
{
permitir = false;
break;
}
}
if (permitir)
{
// Copiar presupuesto
DataTable dt = (DataTable)this.fdlvDetalle.DataSource;
odts.PresupuestoVentaBloque bloque = (odts.PresupuestoVentaBloque)model;
foreach (odts.PresupuestoVentaDetalle d in ((odts.PresupuestoVentaBloque)model).Detalle)
{
DataRow dr = dt.NewRow();
dr["DOCU_ID"] = this.Documento;
dr["PEDID_ID"] = this.Numero;
dr["ESTDOC_ID"] = "N";
dr["LIDO_ID"] = d.TipoLinea;
dr["DOCU_ID_ORIGEN"] = bloque.DocuId;
dr["DOCU_NUMERO_ORIGEN"] = bloque.PresuvId;
dr["DOCU_LINEA_ORIGEN"] = d.Linea;
dr["DOCU_SUBLINEA_ORIGEN"] = d.Sublinea;
dr["PEDIDL_FLUJOC"] = "0";
dr["PEDIDL_FLUJOL"] = "0";
dr["PEDIDL_FECHAD_APLIC"] = string.Empty;
dr["PEDIDL_FECHAH_APLIC"] = string.Empty;
int linea = CalcularNuevaLinea();
dr["PEDIDL_LINEA"] = linea;
if (d.TipoLinea == "N")
dr["PEDIDL_SUBLINEA"] = 0;
else
dr["PEDIDL_SUBLINEA"] = d.Sublinea;
dr["PEDIDL_DESCRIPCION"] = d.DetalleDescripcion;
dr["PEDIDL_CANTIDAD"] = 1;
dr["UNID_ID"] = "UN";
dr["PEDIDL_PRECIO"] = d.Precio;
if (d.DescuentoId.HasValue)
dr["GRDE_ID"] = d.DescuentoId;
else
dr["GRDE_ID"] = DBNull.Value;
dr["COMP_ID"] = this._CompId;
dr["ARTI_ID1"] = d.ArtiId1;
dr["DEPA_ID"] = d.DepartamentoId;
dt.Rows.Add(dr);
if (d is odts.DetalleModelo)
{
foreach (odts.DetalleDeterminacion dd in (d as odts.DetalleModelo).Determinaciones)
{
DataRow drd = dt.NewRow();
drd["DOCU_ID"] = this.Documento;
drd["PEDID_ID"] = this.Numero;
drd["ESTDOC_ID"] = "N";
drd["DOCU_ID_ORIGEN"] = bloque.DocuId;
drd["DOCU_NUMERO_ORIGEN"] = bloque.PresuvId;
drd["DOCU_LINEA_ORIGEN"] = d.Linea;
drd["DOCU_SUBLINEA_ORIGEN"] = d.Sublinea;
drd["PEDIDL_FLUJOC"] = "0";
drd["PEDIDL_FLUJOL"] = "0";
drd["PEDIDL_FECHAD_APLIC"] = string.Empty;
drd["PEDIDL_FECHAH_APLIC"] = string.Empty;
drd["LIDO_ID"] = dd.TipoLinea;
drd["PEDIDL_LINEA"] = linea;
drd["PEDIDL_SUBLINEA"] = dd.Sublinea;
drd["PEDIDL_DESCRIPCION"] = dd.DetalleDescripcion;
drd["PEDIDL_CANTIDAD"] = 1;
drd["UNID_ID"] = "UN";
drd["PEDIDL_PRECIO"] = dd.Precio;
if (dd.DescuentoId.HasValue)
drd["GRDE_ID"] = dd.DescuentoId;
else
drd["GRDE_ID"] = DBNull.Value;
drd["COMP_ID"] = this._CompId;
drd["ARTI_ID1"] = dd.ArtiId1;
drd["DEPA_ID"] = dd.DepartamentoId;
//.........这里部分代码省略.........
开发者ID:jesusico83,项目名称:RepoQ2,代码行数:101,代码来源:PedidovDetalle.cs
示例9: OnCanDrop
protected override void OnCanDrop(OlvDropEventArgs args)
{
base.OnCanDrop(args);
_form.HostCanDrop(args);
}
开发者ID:kaduardo,项目名称:cyberduck,代码行数:5,代码来源:BrowserForm.cs
示例10: treeListView1_CanDrop
private void treeListView1_CanDrop(object sender, OlvDropEventArgs e)
{
BrightIdeasSoftware.OLVDataObject data = e.DataObject as BrightIdeasSoftware.OLVDataObject;
FTPDirectory da = (FTPDirectory)data.ModelObjects[0];
e.Effect = DragDropEffects.Move;
//MessageBox.Show(da.Name);
}
开发者ID:GavinKenna,项目名称:Muroidea,代码行数:9,代码来源:FolderControl.cs
示例11: treeListView1_Dropped
private void treeListView1_Dropped(object sender, OlvDropEventArgs e)
{
FTP par = (FTP)this.ParentForm;
FolderControl oppositeFolderControl;
if(this == par.folderControl1)
{
oppositeFolderControl = par.folderControl2;
}else{
oppositeFolderControl = par.folderControl1;
}
BrightIdeasSoftware.OLVDataObject data = e.DataObject as BrightIdeasSoftware.OLVDataObject;
FTPDirectory location = (FTPDirectory) e.DropTargetItem.RowObject;
string pathOfFile = null;
string pathToGo = null;
foreach (FTPDirectory ftp in (List<FTPDirectory>)data.ModelObjects.Cast<FTPDirectory>().ToList())
{
pathOfFile = ftp.Path;
pathToGo = (location).Path + "\\" + ftp.Name;
// MessageBox.Show(pathToGo);
if (IsRemote && !oppositeFolderControl.IsRemote) //Local Server to Remote Client
{
log.Text+=("\nStart transfer of " + ftp.Name+". From LOCAL to "+client.GetComputerName()+".");
pathToGo = pathToGo.Replace("\\", "\\\\");
if (Directory.Exists(pathOfFile))//if folder
{
//gotta check in this dir for other dirs
SendFolder(ftp, client, pathToGo, par);
}
else
{
Messaging.SendCommand("RemoteAcceptFTP(" + client.GetPort() + ",'" + pathToGo + "', " + new FileInfo(pathOfFile).Length + ");", client.GetClientSocket());
//Messaging.RemoteAcceptFTP(client.GetClientSocket(), pathToGo);
Messaging.FTPFile(pathOfFile, client.GetClientSocket());
log.Text += ("\nFile successfully sent.\n");
par.Refresh();
}
}
else if (IsRemote && oppositeFolderControl.IsRemote) //Client to client
{
if (ftp.IsFile)
{
log.Text += ("\nStart transfer of " + ftp.Name + ". From CLIENT to " + client.GetComputerName() + ".");
pathToGo = pathToGo.Replace("\\", "\\\\");
oppositeFolderControl.client.SendFileToOtherClient(pathOfFile, ftp.kbSize, pathToGo, client);
}
else
{
SendFolderToClient(ftp, pathOfFile, pathToGo, client, oppositeFolderControl);
log.Text += ftp.Name + " sent";
}
}
else //Client to Server
{
log.Text += ("\nStart transfer of " + ftp.Name + ". From " + client.GetComputerName() + " to LOCAL.");
//pathToGo = pathToGo.Replace("\\", "\\\\");
pathOfFile = pathOfFile.Replace("\\", "\\\\");
Messaging.SendCommand("RemoteSendFTP(" + client.GetPort() + ", '" + pathOfFile + "');", client.GetClientSocket());
//Messaging.RemoteSendFTP(client.GetClientSocket(), pathOfFile);
Messaging.LocalAcceptFTP(client.GetClientSocket(), pathToGo, ftp.kbSize);
log.Text += ("\nFile successfully sent.\n");
par.Refresh();
}
}
}
开发者ID:GavinKenna,项目名称:Muroidea,代码行数:68,代码来源:FolderControl.cs
示例12: objectListView1_Dropped
private void objectListView1_Dropped(object sender, OlvDropEventArgs e)
{
Console.WriteLine("dropped");
updateModelList();
refreshContestantListView();
}
开发者ID:Cubio,项目名称:Hauli,代码行数:7,代码来源:ContestantListForm.cs
示例13: olv_Dropped
private void olv_Dropped(object sender, OlvDropEventArgs e)
{
string pathAndFilename = DragDropFile(e.DataObject);
if (!string.IsNullOrWhiteSpace(pathAndFilename))
{
string extension = Path.GetExtension(pathAndFilename);
if (string.IsNullOrEmpty(extension))
{
UntypedFileDropped(pathAndFilename);
}
else
{
TypedFileDropped(pathAndFilename, extension);
}
}
}
开发者ID:hkhaug,项目名称:UbwTools,代码行数:16,代码来源:LaunchGuiForm.cs
示例14: olv_CanDrop
private void olv_CanDrop(object sender, OlvDropEventArgs e)
{
e.Effect = DragDropEffects.All;
}
开发者ID:hkhaug,项目名称:UbwTools,代码行数:4,代码来源:LaunchGuiForm.cs
示例15: CalculateDropTarget
/// <summary>
/// When the mouse is at the given point, what should the target of the drop be?
/// </summary>
/// <remarks>This method should update the DropTarget* members of the given arg block</remarks>
/// <param name="pt">The mouse point, in client co-ordinates</param>
protected virtual void CalculateDropTarget(OlvDropEventArgs args, Point pt)
{
const int SMALL_VALUE = 3;
DropTargetLocation location = DropTargetLocation.None;
int targetIndex = -1;
int targetSubIndex = 0;
if (this.CanDropOnBackground)
location = DropTargetLocation.Background;
// Which item is the mouse over?
// If it is not over any item, it's over the background.
ListViewHitTestInfo info = this.ListView.HitTest(pt.X, pt.Y);
if (info.Item != null && this.CanDropOnItem) {
location = DropTargetLocation.Item;
targetIndex = info.Item.Index;
if (info.SubItem != null && this.CanDropOnSubItem)
targetSubIndex = info.Item.SubItems.IndexOf(info.SubItem);
}
// Check to see if the mouse is "between" rows.
// ("between" is somewhat loosely defined)
if (this.CanDropBetween && this.ListView.GetItemCount() > 0) {
// If the mouse is over an item, check to see if it is near the top or bottom
if (location == DropTargetLocation.Item) {
if (pt.Y - SMALL_VALUE <= info.Item.Bounds.Top)
location = DropTargetLocation.AboveItem;
if (pt.Y + SMALL_VALUE >= info.Item.Bounds.Bottom)
location = DropTargetLocation.BelowItem;
} else {
// Is there an item a little below the mouse?
// If so, we say the drop point is above that row
info = this.ListView.HitTest(pt.X, pt.Y + SMALL_VALUE);
if (info.Item != null) {
targetIndex = info.Item.Index;
location = DropTargetLocation.AboveItem;
} else {
// Is there an item a little above the mouse?
info = this.ListView.HitTest(pt.X, pt.Y - SMALL_VALUE);
if (info.Item != null) {
targetIndex = info.Item.Index;
location = DropTargetLocation.BelowItem;
}
}
}
}
args.DropTargetLocation = location;
args.DropTargetIndex = targetIndex;
args.DropTargetSubItemIndex = targetSubIndex;
}
开发者ID:seriesrenamer,项目名称:seriesrenamer,代码行数:57,代码来源:DropSink.cs
示例16: OnDropped
protected override void OnDropped(OlvDropEventArgs args)
{
DropTargetHelper.Drop(args.DataObject as DataObject,
new Point(args.MouseLocation.X, args.MouseLocation.Y), DragDropEffects.None);
_form.HostDropped(args);
}
开发者ID:kaduardo,项目名称:cyberduck,代码行数:6,代码来源:BrowserForm.cs
示例17: UpdateAfterCanDropEvent
/// <summary>
/// Update the state of our sink to reflect the information that
/// may have been written into the drop event args.
/// </summary>
/// <param name="args"></param>
protected virtual void UpdateAfterCanDropEvent(OlvDropEventArgs args)
{
this.DropTargetIndex = args.DropTargetIndex;
this.DropTargetLocation = args.DropTargetLocation;
this.DropTargetSubItemIndex = args.DropTargetSubItemIndex;
if (this.Billboard != null) {
Point pt = args.MouseLocation;
pt.Offset(5, 5);
if (this.Billboard.Text != this.dropEventArgs.InfoMessage || this.Billboard.Location != pt) {
this.Billboard.Text = this.dropEventArgs.InfoMessage;
this.Billboard.Location = pt;
this.ListView.Invalidate();
}
}
}
开发者ID:seriesrenamer,项目名称:seriesrenamer,代码行数:21,代码来源:DropSink.cs
示例18: HandleCanDrop
private void HandleCanDrop(object sender, OlvDropEventArgs e)
{
// This will only be triggered if HandleModelCanDrop doesn't set Handled to true.
// In practice, this will only be called when the source of the drag is not an ObjectListView
IDataObject data = e.DataObject as IDataObject;
if (data == null || !data.GetDataPresent(DataFormats.UnicodeText))
return;
string str = data.GetData(DataFormats.UnicodeText) as string;
e.Effect = String.IsNullOrEmpty(str) ? DragDropEffects.None : DragDropEffects.Copy;
switch (e.DropTargetLocation)
{
case DropTargetLocation.AboveItem:
case DropTargetLocation.BelowItem:
e.InfoMessage = "Cannot drop between items -- because I haven't written the logic :)";
break;
case DropTargetLocation.Background:
e.InfoMessage = "Drop here to create a new root item called '" + str + "'";
break;
case DropTargetLocation.Item:
e.InfoMessage = "Drop here to create a new child item called '" + str + "'";
break;
default:
return;
}
}
开发者ID:sayedjalilhassan,项目名称:LearningPlatform,代码行数:28,代码来源:Form1.cs
示例19: OnDropped
/// <summary>
///
/// </summary>
/// <param name="args"></param>
protected virtual void OnDropped(OlvDropEventArgs args) {
if (this.Dropped != null)
this.Dropped(this, args);
}
开发者ID:heliwave,项目名称:QuranCode,代码行数:8,代码来源:Events.cs
示例20: HandleDropped
private void HandleDropped(object sender, OlvDropEventArgs e)
{
// This will only be triggered if HandleModelDropped doesn't set Handled to true.
// In practice, this will only be called when the source of the drag is not an ObjectListView
DataObject data = e.DataObject as DataObject;
if (data == null || String.IsNullOrEmpty(data.GetText()))
return;
TreeListView treeListView = e.ListView as TreeListView;
if (treeListView == null)
return;
ModelWithChildren newModel = new ModelWithChildren {
Label = data.GetText(),
DataForChildren = new ArrayList {"A", "B ", "C", "D", "E"}
};
switch (e.DropTargetLocation)
{
case DropTargetLocation.AboveItem:
break;
case DropTargetLocation.BelowItem:
break;
case DropTargetLocation.Background:
treeListView.AddObject(newModel);
break;
case DropTargetLocation.Item:
ModelWithChildren targetModel = e.DropTargetItem.RowObject as ModelWithChildren;
if (targetModel != null)
{
newModel.Parent = targetModel;
targetModel.Children.Add(newModel);
treeListView.RefreshObject(targetModel);
}
break;
default:
return;
}
}
开发者ID:sayedjalilhassan,项目名称:LearningPlatform,代码行数:40,代码来源:Form1.cs
注:本文中的BrightIdeasSoftware.OlvDropEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论