Пример #1
0
    /// <summary>
    /// Handles actions related to the folders.
    /// </summary>
    /// <param name="argument">Argument related to the folder action</param>
    /// <param name="isNewFolder">Indicates if is new folder</param>
    /// <param name="callSelection">Indicates if selection should be called</param>
    private void HandleFolderAction(string argument, bool forceReload, bool callSelection)
    {
        NodeID = ValidationHelper.GetString(argument, string.Empty);

        // Reload content tree if neccessary
        if (forceReload)
        {
            InitializeFileSystemTree();

            // Fill with new info
            treeFileSystem.DefaultPath       = NodeID;
            treeFileSystem.ExpandDefaultPath = true;

            treeFileSystem.ReloadData();
            pnlUpdateTree.Update();

            ScriptManager.RegisterStartupScript(Page, typeof(Page), "EnsureTopWindow", "if (self.focus) { self.focus(); }", true);
        }

        ColorizeLastSelectedRow();

        // Get parent node ID info
        string parentId = string.Empty;

        if (FullStartingPath.ToLower() != NodeID.ToLower())
        {
            try
            {
                parentId = (DirectoryInfo.New(NodeID)).Parent.FullName;
            }
            // Access denied to parent
            catch (SecurityException)
            {
            }
        }

        fileSystemView.ShowParentButton = !String.IsNullOrEmpty(parentId);
        fileSystemView.NodeParentID     = parentId;
        fileSystemView.Config           = Config;

        // Load new data
        if ((Config.ShowFolders) && (NodeID.LastIndexOf('\\') != -1))
        {
            fileSystemView.StartingPath = NodeID.Substring(0, argument.LastIndexOf('\\') + 1);
        }

        fileSystemView.StartingPath = NodeID;

        // Reload view control's content
        fileSystemView.Reload();
        pnlUpdateView.Update();

        InitializeMenuElem();
        menuElem.UpdateActionsMenu();
        pnlUpdateMenu.Update();

        ClearActionElems();
    }
Пример #2
0
        protected bool IsPageChanged()
        {
            bool   ispc        = false;
            string urlreferrer = Request.UrlReferrer.ToString().ToLower();
            string scriptname  = Request.ServerVariables["SCRIPT_NAME"].ToLower();

            if (urlreferrer.IndexOf("nodeid") == -1)       //没有节点参数的,只比较页面
            {
                if (urlreferrer.IndexOf(scriptname) != -1) //页面一样
                {
                    ispc = true;
                }
            }
            else
            {
                if (urlreferrer.IndexOf(scriptname) != -1 && urlreferrer.IndexOf("nodeid=" + NodeID.ToLower()) != -1)  //页面一样,且节点一样
                {
                    ispc = true;
                }
            }
            return(ispc);
        }