/// <summary>
        /// Populates the directory breadcrumb placeholder. See also methods linkButton_Click e lnkRoot_Click.
        /// </summary>
        private void PopulateBreadcrumb()
        {
            plhDirectory.Controls.Clear();
            // Get all directories by splitting the content of txtCurrentDirectory
            string[] dirs = CurrentDirectory.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);

            // Add a LinkButton and a "/" label for each directory
            string current = "/";

            for (int i = 0; i < dirs.Length; i++)
            {
                Anthem.LinkButton lnk = new Anthem.LinkButton();
                lnk.ID              = "lnkDir" + i.ToString();
                lnk.Text            = dirs[i];
                current            += dirs[i] + "/";
                lnk.CommandArgument = current;
                lnk.ToolTip         = current;
                lnk.Click          += new EventHandler(linkButton_Click);
                plhDirectory.Controls.Add(lnk);

                Anthem.Label lbl = new Anthem.Label();
                lbl.ID   = "lblDir" + i.ToString();
                lbl.Text = " / ";
                plhDirectory.Controls.Add(lbl);
            }
        }
        private void linkButton_Click(object sender, EventArgs e)
        {
            Anthem.LinkButton lnk = sender as Anthem.LinkButton;
            if (lnk != null)
            {
                CurrentDirectory = lnk.CommandArgument;

                DetectPermissions();
                SetupControlsForPermissions();

                rptItems.DataBind();
                PopulateBreadcrumb();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Populates the directory breadcrumb placeholder. See also methods linkButton_Click e lnkRoot_Click.
        /// </summary>
        private void PopulateBreadcrumb()
        {
            plhDirectory.Controls.Clear();
            // Get all directories by splitting the content of txtCurrentDirectory
            string[] dirs = CurrentDirectory.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);

            // Add a LinkButton and a "/" label for each directory
            string current = "/";
            for(int i = 0; i < dirs.Length; i++) {
                Anthem.LinkButton lnk = new Anthem.LinkButton();
                lnk.ID = "lnkDir" + i.ToString();
                lnk.Text = dirs[i];
                current += dirs[i] + "/";
                lnk.CommandArgument = current;
                lnk.ToolTip = current;
                lnk.Click += new EventHandler(linkButton_Click);
                plhDirectory.Controls.Add(lnk);

                Anthem.Label lbl = new Anthem.Label();
                lbl.ID = "lblDir" + i.ToString();
                lbl.Text = " / ";
                plhDirectory.Controls.Add(lbl);
            }
        }