Exemplo n.º 1
0
        private void Init()
        {
            //
            // RestoreMenuItem
            //
            this.BackupMenuItem      = new ToolStripMenuItem();
            this.BackupMenuItem.Name = "BackupMenuItem";
            //this.RestoreMenuItem.Size = new System.Drawing.Size(125, 22);
            this.BackupMenuItem.Text   = SPMLocalization.GetString("BackupSite_Text");
            this.BackupMenuItem.Click += new EventHandler(BackupMenuItem_Click);
            //
            // Tasks MenuStrip
            //
            TasksMenuItem = SPMMenu.Items.CreateTasks();
            TasksMenuItem.DropDownItems.AddRange(
                new ToolStripItem[] {
                this.BackupMenuItem,
            });

            //this.TasksMenuItem,
            //SPMMenu.Items.CreateSeparator(),
            //
            // SiteCollectionMenuStrip
            //
            this.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.TasksMenuItem,
                SPMMenu.Items.CreateRefresh()
            });
            this.Name = "SiteMenuStrip";
            this.Size = new System.Drawing.Size(126, 52);
        }
        protected void RefreshWss2Objects()
        {
            ArrayList list = SaveStucture(this);

            if (list.Count > 0)
            {
                ExplorerNodeBase appNode = GetWebApp(this);
                Program.Window.Explorer.SelectedNode = null;
                if (appNode != null && appNode.Tag is SPWebApplication)
                {
                    Program.Window.Explorer.DisposeObjectModelNodes(appNode);
                    ((SPPersistedObject)appNode.Tag).Uncache();

                    Reload(appNode, list);

                    if (this.IsExpanded)
                    {
                        this.HasChildrenLoaded = false;
                        //Program.Window.Explorer.ExpandNode(CurrentNode);
                        this.Expand();
                    }
                }
            }
            else
            {
                throw new ApplicationException(SPMLocalization.GetString("ExplorerBase_Error"));
            }
        }
 public TabDataGridViewPage() : base()
 {
     this.Controls.Add(GridView);
     this.Name = "GridView";
     this.Text = SPMLocalization.GetString("GridView_Text");
     this.UseVisualStyleBackColor = true;
 }
        public override void Setup()
        {
            this.Text = SPMLocalization.GetString("WebParts_Text");

            this.ToolTipText = SPMLocalization.GetString("WebParts_ToolTip");
            this.Name        = "WebParts";
        }
Exemplo n.º 5
0
        public void Build(StuctureItemCollection list)
        {
            this.ImageList = Program.Window.SPMimageList;
            // Dispose all objects
            ClearNodes(this.Nodes);

            //var rules = CompositionProvider.GetOrderedExports<IRule<ISPNode>>();
            var rules = IoCContainer.Resolve <IEnumerable <IRule <ISPNode> > >().Ordered();

            SPProvider           = new SPNodeProvider(SPFarm.Local, rules, IoCContainer);
            SPProvider.ViewLevel = ViewLevel;
            SPProvider.GetLocalizedTextFunction = p => SPMLocalization.GetString(p);
            Trace.WriteLine("ViewLevel: " + SPProvider.ViewLevel);
            var treeViewProvider = new TreeViewNodeProvider(SPProvider, IoCContainer);

            FarmNode = treeViewProvider.LoadFarmNode();

            this.Nodes.Add(FarmNode);

            if (list != null)
            {
                FarmNode.Reload(FarmNode, list);
            }
            else
            {
                ExpandToDefault(FarmNode, DefaultExpandTypes);
            }
        }
Exemplo n.º 6
0
        private void saveallToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!Properties.Settings.Default.ReadOnly)
            {
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    ExplorerNodeBase selectedNode = Explorer.SelectedNode as ExplorerNodeBase;
                    if (selectedNode == null)
                    {
                        return;
                    }

                    this.toolStripStatusLabel.Text = SPMLocalization.GetString("Saving_All_Changes");
                    foreach (ExplorerNodeBase node in ChangedNodes.Keys)
                    {
                        node.Update();
                        node.Setup();
                    }
                    ChangedNodes.Clear();

                    UpdateMenu(selectedNode);

                    this.toolStripStatusLabel.Text = SPMLocalization.GetString("Changes_Saved");
                }
                finally
                {
                    Cursor.Current = Cursors.Default;
                }
            }
        }
Exemplo n.º 7
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!Properties.Settings.Default.ReadOnly)
            {
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    ExplorerNodeBase node = Explorer.SelectedNode as ExplorerNodeBase;
                    if (node == null)
                    {
                        return;
                    }

                    this.toolStripStatusLabel.Text = SPMLocalization.GetString("Saving_Changes");

                    if (ChangedNodes.ContainsKey(node))
                    {
                        node.Update();
                        node.Setup();
                        ChangedNodes.Remove(node);
                    }
                    UpdateMenu(node);
                    this.toolStripStatusLabel.Text = SPMLocalization.GetString("Changes_Saved");
                }
                finally
                {
                    Cursor.Current = Cursors.Default;
                }
            }
        }
Exemplo n.º 8
0
        public override void Setup()
        {
            this.Text = SPMLocalization.GetString("QuotaTemplatesCollection_Text");

            this.ToolTipText = SPMLocalization.GetString("QuotaTemplatesCollection_ToolTip");
            this.Name        = "QuotaTemplates";
        }
Exemplo n.º 9
0
 public TabTextPage() : base()
 {
     this.Controls.Clear();
     this.Controls.Add(RichTextBox);
     this.Name = "Text";
     this.Text = SPMLocalization.GetString("Text_Text");
     this.UseVisualStyleBackColor = true;
 }
Exemplo n.º 10
0
 public FeatureCollectionNode(SPWebApplication webApp) : this()
 {
     this.Text        = SPMLocalization.GetString("SiteFeatures_Text");
     this.ToolTipText = SPMLocalization.GetString("SiteFeatures_ToolTip");
     this.Name        = "SiteFeatures";
     this.Tag         = webApp.Features;
     this.SPParent    = webApp;
 }
Exemplo n.º 11
0
 public FeatureCollectionNode(SPSite site) : this()
 {
     this.Text        = SPMLocalization.GetString("SiteFeatures_Text");
     this.ToolTipText = SPMLocalization.GetString("SiteFeatures_ToolTip");
     this.Name        = "SiteFeatures";
     this.Tag         = site.Features;
     this.SPParent    = site;
 }
Exemplo n.º 12
0
 public FeatureCollectionNode(SPWeb web) : this()
 {
     this.Text        = SPMLocalization.GetString("WebFeatures_Text");
     this.ToolTipText = SPMLocalization.GetString("WebFeatures_ToolTip");
     this.Name        = "WebFeatures";
     this.Tag         = web.Features;
     this.SPParent    = web;
 }
Exemplo n.º 13
0
 public TabBrowserPage() : base()
 {
     this.Controls.Clear();
     this.Controls.Add(Browser);
     this.Name = "Browser";
     this.Text = SPMLocalization.GetString("Browser_Text");
     this.UseVisualStyleBackColor = true;
 }
Exemplo n.º 14
0
        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            Cursor.Current = Cursors.Default;
#if DEBUG
            MessageBox.Show(e.Exception.Message + " : " + e.Exception.StackTrace, SPMLocalization.GetString("Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
#else
            MessageBox.Show(e.Exception.Message, SPMLocalization.GetString("Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
#endif
        }
Exemplo n.º 15
0
 public UserSolutionCollectionNode(SPSite site)
     : this()
 {
     this.Text        = SPMLocalization.GetString("UserSolutionCollection_Text");
     this.ToolTipText = SPMLocalization.GetString("UserSolutionCollection_ToolTip");
     this.Name        = "UserSolutionCollection";
     this.Tag         = site.Solutions;
     this.SPParent    = site;
 }
Exemplo n.º 16
0
        public override TabPage[] GetTabPages()
        {
            ArrayList alPages = new ArrayList();

            alPages.AddRange(base.GetTabPages());
            alPages.Add(TabPages.GetDataGridViewPage(SPMLocalization.GetString("GridView_List"), List.Items.GetDataTable()));

            return((TabPage[])alPages.ToArray(typeof(TabPage)));
        }
Exemplo n.º 17
0
 public SiteSubscriptionCollectionNode(SPFarm farm)
     : this()
 {
     this.Text        = SPMLocalization.GetString("SiteSubscriptionCollection_Text");
     this.ToolTipText = SPMLocalization.GetString("SiteSubscriptionCollection_ToolTip");
     this.Name        = "SiteSubscriptionCollection";
     this.Tag         = farm.SiteSubscriptions;
     this.SPParent    = farm;
 }
Exemplo n.º 18
0
        public void Delete_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show(String.Format(SPMLocalization.GetString("Message_DeleteWarning"), CurrentNode.Text), SPMLocalization.GetString("Delete_Text"), MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                CurrentNode.Delete(); // Delete the SP object
                CurrentNode.Remove(); // Remove the TreeNode object
            }
        }
Exemplo n.º 19
0
        public SolutionCollectionNode(SPFarm farm)
        {
            this.CurrentFarm = farm;

            this.Text        = SPMLocalization.GetString("Solutions_Text");
            this.ToolTipText = SPMLocalization.GetString("Solutions_ToolTip");
            this.Name        = "Solutions";
            this.Tag         = farm.Solutions;
            this.SPParent    = CurrentFarm;
            this.Nodes.Add("Dummy");
        }
        public override void Setup()
        {
            this.Text        = SPMLocalization.GetString("VersionHistory_File_Text");
            this.ToolTipText = SPMLocalization.GetString("VersionHistory_File_ToolTip");
            this.Name        = "Version History";

            int index = Program.Window.Explorer.AddImage(this.ImageUrl());

            this.ImageIndex         = index;
            this.SelectedImageIndex = index;
        }
Exemplo n.º 21
0
        public override void Setup()
        {
            this.Text        = Site.Url;
            this.ToolTipText = SPMLocalization.GetString("SiteCollection_Site_ToolTip");
            this.Name        = Site.ID.ToString();

            int index = Program.Window.Explorer.AddImage(this.ImageUrl());

            this.ImageIndex         = index;
            this.SelectedImageIndex = index;
        }
Exemplo n.º 22
0
        public ToolStripMenuItem CreateDelete()
        {
            ToolStripMenuItem delete = new ToolStripMenuItem();

            delete.Text   = SPMLocalization.GetString("Delete_Text");
            delete.Name   = "Delete";
            delete.Size   = new System.Drawing.Size(125, 22);
            delete.Image  = global::Keutmann.SharePointManager.Properties.Resources.delete;
            delete.Click += new EventHandler(Delete_Click);
            return(delete);
        }
Exemplo n.º 23
0
 public override void Setup()
 {
     this.Text = View.Title;
     if (View.DefaultView)
     {
         this.Text += " " + SPMLocalization.GetString("ViewNode_Message01");
     }
     this.ToolTipText = SPMLocalization.GetString("View_ToolTip");
     this.Name        = View.Url;
     this.BrowserUrl  = SPUrlUtility.CombineUrl(View.ParentList.ParentWeb.Url, View.Url);
 }
Exemplo n.º 24
0
        public ToolStripMenuItem CreateRefresh()
        {
            ToolStripMenuItem refresh = new ToolStripMenuItem();

            refresh.Text   = SPMLocalization.GetString("Refresh_Text");
            refresh.Name   = "Refresh";
            refresh.Size   = new System.Drawing.Size(125, 22);
            refresh.Image  = global::Keutmann.SharePointManager.Properties.Resources.refresh3;
            refresh.Click += new EventHandler(Refresh_Click);
            return(refresh);
        }
Exemplo n.º 25
0
        public IisSettingsCollectionNode(SPWebApplication app)
        {
            this.Text               = SPMLocalization.GetString("IisSettings_Text");
            this.ToolTipText        = SPMLocalization.GetString("IisSettings_ToolTip");
            this.Name               = "Iis settings";
            this.Tag                = app.IisSettings;
            this.WebApplication     = app;
            this.ImageIndex         = 2;
            this.SelectedImageIndex = 2;

            this.Nodes.Add(new ExplorerNodeBase("Dummy"));
        }
Exemplo n.º 26
0
        public override void Setup()
        {
            this.Text        = SPMLocalization.GetString("WorkflowAssociations_Text");
            this.ToolTipText = SPMLocalization.GetString("WorkflowAssociations_ToolTip");
            this.Name        = "WorkflowAssociations";
            //this.BrowserUrl = this.List.ParentWebUrl + "_layouts/viewlsts.aspx";

            int index = Program.Window.Explorer.AddImage(this.ImageUrl());

            this.ImageIndex         = index;
            this.SelectedImageIndex = index;
        }
Exemplo n.º 27
0
        public ToolStripMenuItem CreatePaste()
        {
            ToolStripMenuItem item = new ToolStripMenuItem();

            item.Text    = SPMLocalization.GetString("Paste_Text");
            item.Name    = "Paste";
            item.Image   = global::Keutmann.SharePointManager.Properties.Resources.paste;
            item.Enabled = false;
            item.Click  += new EventHandler(Paste_Click);

            return(item);
        }
Exemplo n.º 28
0
        private void cancelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            CancelActive   = true;
            ExplorerNodeBase selectedNode = Explorer.SelectedNode as ExplorerNodeBase;

            this.toolStripStatusLabel.Text = SPMLocalization.GetString("Cancel_All_Modifications");

            foreach (ExplorerNodeBase node in ChangedNodes.Keys)
            {
                Hashtable propertyItem = ChangedPropertyItems[node];

                foreach (PropertyValueChangedEventArgs pvEventArgs in propertyItem.Values)
                {
                    PropertyDescriptor pd = pvEventArgs.ChangedItem.PropertyDescriptor;

                    Type      nodeType = node.Tag.GetType();
                    FieldInfo myField  = nodeType.GetField(pd.Name, BindingFlags.Instance | BindingFlags.Public);
                    if (myField != null)
                    {
                        myField.SetValue(node.Tag, pvEventArgs.OldValue);
                    }
                    else
                    {
                        PropertyInfo myProperty = nodeType.GetProperty(pd.Name, BindingFlags.Instance | BindingFlags.Public);
                        if (myProperty != null)
                        {
                            myProperty.SetValue(node.Tag, pvEventArgs.OldValue, null);
                        }
                    }
                }

                ChangedPropertyItems.Remove(node);
            }


            foreach (TabPage page in tabControl.TabPages)
            {
                if (page is TabPropertyPage)
                {
                    ((TabPropertyPage)page).Grid.Refresh();
                }
            }

            ChangedNodes.Clear();

            UpdateMenu(selectedNode);

            //this.toolStripStatusLabel.Text = "All modifications has been canceled";
            CancelActive   = false;
            Cursor.Current = Cursors.Default;
        }
Exemplo n.º 29
0
        public ApplicationPoolCollectionNode(Object parent, SPApplicationPoolCollection collection)
        {
            this.Text        = SPMLocalization.GetString("ApplicationPools_Text");
            this.ToolTipText = SPMLocalization.GetString("ApplicationPools_ToolTip");
            this.Name        = "ApplicationPools";
            this.Tag         = collection;
            this.SPParent    = parent;

            this.ImageIndex         = 7;
            this.SelectedImageIndex = 7;

            this.Nodes.Add(new ExplorerNodeBase("Dummy"));
        }
        public JobDefinitionCollectionNode(Object parent, SPJobDefinitionCollection collection)
        {
            this.Text        = SPMLocalization.GetString("JobDefinitions_Text");
            this.ToolTipText = SPMLocalization.GetString("JobDefinitions_ToolTip");
            this.Name        = "Job Definitions";
            this.Tag         = collection;
            this.SPParent    = parent;

            this.ImageIndex         = 9;
            this.SelectedImageIndex = 9;

            this.Nodes.Add(new ExplorerNodeBase("Dummy"));
        }