Esempio n. 1
0
        private void renameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormGetName formGetName = new FormGetName("Rename item");

            formGetName.Name = this.lvItems.SelectedItems[0].Text;
            if (formGetName.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            try
            {
                this.rs.MoveItem(this.lvItems.SelectedItems[0].ToolTipText, FormSSRSExplorer.GetItemPath(this.lvItems.SelectedItems[0].ToolTipText, false) + "/" + formGetName.Name, (ReportItemTypes)this.lvItems.SelectedItems[0].Tag);
                this.toolStripStatusLabel.Text = string.Format("Renamed item '{0}' to '{1}'", (object)this.lvItems.SelectedItems[0].Text, (object)(FormSSRSExplorer.GetItemPath(this.lvItems.SelectedItems[0].ToolTipText, false) + "/" + formGetName.Name));
                if ((ReportItemTypes)this.lvItems.SelectedItems[0].Tag == ReportItemTypes.Folder)
                {
                    this.rs.PopulateTreeView(FormSSRSExplorer.SelectedServer.Alias);
                }
                this.rs.PopulateItems(this.tvReportServer.SelectedNode.ToolTipText);
            }
            catch (Exception ex)
            {
                int num = (int)MessageBox.Show(string.Format("An error has occured: {0}", (object)ex.Message));
                LogHandler.WriteLogEntry(ex);
            }
        }
Esempio n. 2
0
        private void newFolderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.tvReportServer.SelectedNode == null)
            {
                return;
            }
            FormGetName formGetName = new FormGetName("Create new folder");

            if (formGetName.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    if (formGetName.Name.Trim() == "")
                    {
                        throw new Exception("Name cannot be blank");
                    }
                    this.rs.CreateFolder(formGetName.Name, this.tvReportServer.SelectedNode);
                    this.toolStripStatusLabel.Text = string.Format("Created folder '{0}'", (object)formGetName.Name);
                }
                catch (Exception ex)
                {
                    int num = (int)MessageBox.Show(string.Format("An error occured: {0}", (object)ex.Message));
                    LogHandler.WriteLogEntry(ex);
                }
            }
            try
            {
                this.rs.PopulateItems(this.tvReportServer.SelectedNode.ToolTipText);
            }
            catch (Exception ex)
            {
                LogHandler.WriteLogEntry(ex);
            }
        }