Exemplo n.º 1
0
    /// <summary>
    /// Handles actions occurring when tree refresh is requested.
    /// </summary>
    /// <param name="argument">Argument holding information on requested item</param>
    private void HandleTreeRefreshAction(string argument)
    {
        InitializeFileSystemTree();

        // Fill with new info
        NodeID = argument;

        treeFileSystem.DefaultPath       = NodeID;
        treeFileSystem.ExpandDefaultPath = true;

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

        // Reload the file system view
        fileSystemView.Reload();
        pnlUpdateView.Update();

        InitializeMenuElem();
        menuElem.EnableDeleteFolder = !FullStartingPath.Equals(NodeID, StringComparison.InvariantCultureIgnoreCase);
        menuElem.UpdateActionsMenu();

        // Forget recent action
        ClearActionElems();
    }
Exemplo n.º 2
0
    /// <summary>
    /// Pre render.
    /// </summary>
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        // High-light item being edited
        if (ItemToColorize != String.Empty)
        {
            ColorizeRow(ItemToColorize);
        }

        // Display info on listing more content
        if (IsDisplayMore && !Config.ShowFolders) //curently selected more object && (TreeNodeObj != null))
        {
            string closeLink   = String.Format("<span class=\"ListingClose\" style=\"cursor: pointer;\" onclick=\"SetAction('closelisting', ''); RaiseHiddenPostBack(); return false;\">{0}</span>", GetString("general.close"));
            string currentPath = "<span class=\"ListingPath\">";

            // Display relative paths with tilda
            if (Config.StartingPath.StartsWith("~"))
            {
                string serverPath = Server.MapPath(Config.StartingPath).TrimEnd('\\');
                currentPath += NodeID.Replace(serverPath.Substring(0, serverPath.LastIndexOf('\\') + 1), string.Empty);
            }
            else
            {
                currentPath += NodeID.Replace(NodeID.Substring(0, Config.StartingPath.TrimEnd('\\').LastIndexOf('\\') + 1), string.Empty);
            }
            currentPath += "</span>";

            string listingMsg = string.Format(GetString("dialogs.filesystem.listinginfo"), currentPath, closeLink);
            fileSystemView.DisplayListingInfo(listingMsg);
        }

        menuElem.EnableDeleteFolder = !FullStartingPath.Equals(NodeID, StringComparison.InvariantCultureIgnoreCase);
    }