Example #1
0
        /// <summary>
        /// Processes the move copy command.
        /// </summary>
        /// <param name="args">The args.</param>
        void ProcessMoveCopyCommand(Dictionary <string, object> args)
        {
            if (args["cmd"] != null)
            {
                string command = args["cmd"].ToString();
                if (String.Compare(command, "move", true) == 0 || String.Compare(command, "copy", true) == 0)
                {
                    string folder = args["folder"] as string;
                    if (String.IsNullOrEmpty(folder))
                    {
                        return;
                    }

                    int targetFolderId = Int32.Parse(folder);

                    string[] items = MyListView.CurrentListView.GetCheckedCollection();

                    if (items != null)
                    {
                        for (int i = 0; i < items.Length; i++)
                        {
                            string[] keys = EcfListView.GetPrimaryKeyIdStringItems(items[i]);
                            if (keys != null)
                            {
                                int    id   = Int32.Parse(keys[0]);
                                string type = keys[1];

                                if (String.Compare(command, "move", true) == 0)
                                {
                                    if (type == "Node")
                                    {
                                        FolderElement.Move(id, targetFolderId);
                                    }
                                    else
                                    {
                                        Folder.Move(id, targetFolderId);
                                    }
                                }
                                else if (String.Compare(command, "copy", true) == 0)
                                {
                                    if (type == "Node")
                                    {
                                        FolderElement.Copy(id, targetFolderId);
                                    }
                                    else
                                    {
                                        Folder.CopyRecursive(id, targetFolderId);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }