Beispiel #1
0
        new void DragOver(HtmlMouseEvent e)
        {
            base.DragOver(e);
            if (e != null)
            {
                List parentList = itemsPane.Data?.FolderItems?.ParentFolder?.ParentList;
                if (parentList != null)
                {
                    if (parentList.BaseType == BaseType.DocumentLibrary)
                    {
                        ListItem listItem = HitItem as ListItem;
                        ShowFeedback(listItem != null && listItem.FileSystemObjectType == FileSystemObjectType.Folder
                            ? FeedbackMode.Over : FeedbackMode.After);
                        return;
                    }

                    if (parentList.EnableAttachments)
                    {
                        ListItem listItem = HitItem as ListItem;
                        ShowFeedback(listItem != null && listItem.FileSystemObjectType == FileSystemObjectType.File
                            ? FeedbackMode.Over : FeedbackMode.None);
                        return;
                    }
                }
            }

            HideFeedback();
        }
Beispiel #2
0
        IDragSource CreateDragSource(HtmlMouseEvent e)
        {
            GridBodyHit hit = Overview.Body.Hit(e);

            if (hit.Row < 0)
            {
                return(null);
            }

            ListItem[] listItems;

            if (Overview.RowsSelection.Contains(hit.Row))
            {
                listItems = new ListItem[Overview.RowsSelection.Count];
                int index = 0;
                Overview.RowsSelection.Enumerate(0, delegate(long row)
                {
                    listItems[index++] = (ListItem)Overview.DataSource[row];
                    return(true);
                });
            }
            else
            {
                listItems = new ListItem[] { (ListItem)Overview.DataSource[hit.Row] };
            }

            return(new ListItemsDragSource(listItems));
        }
Beispiel #3
0
        DropEffects IDropTarget.DragOver(HtmlMouseEvent e)
        {
            base.DragOver(e);
            if (Feedback == FeedbackMode.None)
            {
                return(DropEffects.None);
            }
            object node = HitNode;

            if (!Observable.Equals(this.node, node))
            {
                this.node   = node;
                dropEffects = DropEffects.None;
                if (listItems != null)
                {
                    ListNode list = node as ListNode;
                    if (list != null)
                    {
                        dropEffects = ListItemsDropUtility.DropEffects(listItems, list.RootFolder);
                    }
                    else
                    {
                        FolderNode folder = node as FolderNode;
                        if (folder != null)
                        {
                            dropEffects = ListItemsDropUtility.DropEffects(listItems, folder);
                        }
                    }
                }
            }

            return(dropEffects & DropEffects.Move);
        }
        DropEffects IDropTarget.DragOver(HtmlMouseEvent e)
        {
            hit     = treeView.Hit(e);
            clientY = e.ClientY;
            if (hit != null)
            {
                RootNode target = hit.Nodes.List[hit.Index] as RootNode;
                if (target == null)
                {
                    return(DropEffects.None);
                }
                if (target == webNode.RootNode)
                {
                    return(DropEffects.Copy);
                }
                if (2 * (clientY - hit.Rect.Top) < hit.Rect.Height)
                {
                    if (hit.Index > 0 && hit.Nodes.List[hit.Index - 1] == webNode)
                    {
                        return(DropEffects.Copy);
                    }
                }
                else if (hit.Index < hit.Nodes.List.Count - 1 && hit.Nodes.List[hit.Index + 1] == webNode)
                {
                    return(DropEffects.Copy);
                }
            }

            return(canMove ? DropEffects.Move | DropEffects.Copy : DropEffects.Copy);
        }
        DropEffects IDropTarget.DragOver(HtmlMouseEvent e)
        {
            base.DragOver(e);
            ListItem listItem = HitItem as ListItem;

            targetFolder = listItem != null ? listItem.Folder : null;
            return(targetFolder != null?ListItemsDropUtility.DropEffects(source, targetFolder) : dropEffects);
        }
 void IDropTarget.Drop(HtmlMouseEvent e, DropEffects dropEffect)
 {
     try
     {
         base.Drop(e);
         ListItemsDropUtility.Drop(source, targetFolder != null ? targetFolder : itemsPane.Data.FolderItems.ParentFolder);
     }
     catch (Exception ex)
     {
         LazyWindow.ShowError(ex);
     }
 }
Beispiel #7
0
        void IDropTarget.Drop(HtmlMouseEvent e, DropEffects dropEffect)
        {
            TreeViewHit hit = base.Drop(e);

            if (Feedback != FeedbackMode.None)
            {
                try
                {
                    object   node = hit.Nodes.List[hit.Index];
                    ListNode list = node as ListNode;
                    ListItemsDropUtility.Drop(listItems, list != null ? list.RootFolder : node as Folder);
                }
                catch (Exception ex)
                {
                    LazyWindow.ShowError(ex);
                }
            }
        }
        void IDropTarget.Drop(HtmlMouseEvent e, DropEffects dropEffect)
        {
            RootNodes rootNodes = (RootNodes)treeView.NodeSource;
            RootNode  rootNode  = webNode.RootNode;
            long      index     = hit != null ? hit.Index : -1;

            if (index >= 0 && 2 * (clientY - hit.Rect.Top) >= hit.Rect.Height)
            {
                index++;
            }

            if (dropEffect == DropEffects.Move)
            {
                int pos = 0;
                while (rootNodes[pos] != rootNode)
                {
                    pos++;
                }

                rootNodes.RemoveRootNode(pos);
                if (index > pos)
                {
                    index--;
                }
            }
            else
            {
                rootNode = new RootNode()
                {
                    Url = webNode.Url, Title = webNode.Title, IsSite = rootNode != null && rootNode.IsSite, RootNodes = rootNodes
                };
            }

            if (index >= 0)
            {
                rootNodes.InsertRootNode(index, rootNode);
            }
            else
            {
                rootNodes.Configuration.Roots.Add(rootNode);
            }
        }
 new void DragOver(HtmlMouseEvent e)
 {
     base.DragOver(e);
     ShowFeedback(Folder != null ? FeedbackMode.Over : FeedbackMode.None);
 }
 void DragOver(HtmlMouseEvent e)
 {
 }