Exemple #1
0
        public virtual TabPage[] GetTabPages()
        {
            ArrayList alPages = new ArrayList();

            alPages.Add(TabPages.GetPropertyPage(TabPages.PROPERTIES, Model.SPObject));

            if (this.BrowserUrl.Length > 0)
            {
                alPages.Add(TabPages.GetBrowserPage("Browser", this.BrowserUrl));
            }


            if (Model.SPObject != null)
            {
                PropertyInfo propInfo = Model.SPObjectType.GetProperty("SchemaXml", typeof(string));
                if (propInfo != null)
                {
                    alPages.Add(TabPages.GetXmlPage("Schema Xml", propInfo.GetValue(Model.SPObject, null) as string));
                }
            }

            if (Model.SPObject is SPList)
            {
                var list = Model.SPObject as SPList;

                alPages.Add(TabPages.GetDataGridViewPage("GridView", list.Items.GetDataTable()));
            }

            return((TabPage[])alPages.ToArray(typeof(TabPage)));
        }
Exemple #2
0
        public void SplashScreenLoad(SplashScreen splashScreen)
        {
            Trace.WriteLine("SplashScreenLoad()");
            // The property "NeedsUpgradeIncludeChildren" of SPFarm is very slow to resolve. Therefore exclude it from the PropertyGrid
            PropertyGridTypeConverter.ExcludedProperties.Add("NeedsUpgradeIncludeChildren");
            //PropertyGridTypeConverter.ExcludedProperties.Add("Xml");
            //PropertyGridTypeConverter.ExcludedProperties.Add("XmlDataSchema");
            PropertyGridTypeConverter.AddTo(typeof(SPFarm));
            PropertyGridTypeConverter.AddTo(typeof(SPWebService));
//            PropertyGridTypeConverter.AddTo(typeof(SPListItemCollection));

            splashScreen.UpdateProgress("Loading SharePoint Model...");

            Explorer                       = IoCContainer.Resolve <TreeViewComponent>();
            this.Explorer.Dock             = System.Windows.Forms.DockStyle.Fill;
            this.Explorer.HideSelection    = false;
            this.Explorer.Location         = new System.Drawing.Point(0, 0);
            this.Explorer.Name             = "Explorer";
            this.Explorer.ShowNodeToolTips = true;
            this.Explorer.Size             = new System.Drawing.Size(408, 440);
            this.Explorer.TabIndex         = 0;
            this.Explorer.KeyUp           += new System.Windows.Forms.KeyEventHandler(this.Explorer_KeyUp);
            this.Explorer.NodeMouseClick  += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.Explorer_NodeMouseClick);
            this.Explorer.Click           += new System.EventHandler(this.Explorer_Click);
            this.Explorer.LocationChanged += Explorer_LocationChanged;
            this.Explorer.BeforeExpand    += Explorer_BeforeExpand;
            this.Explorer.AfterSelect     += Explorer_AfterSelect;
            this.Explorer.BeforeSelect    += Explorer_BeforeSelect;
            this.Explorer.MouseClick      += Explorer_MouseClick;

            splitContainer.Panel1.Controls.Add(Explorer);

            Explorer.Worker(() => Explorer.Build());
            //((SPTreeNode)Explorer.SelectedNode).Refresh();
            // Call default expand after Explorer.Build();

            TabPropertyPage propertyPage = TabPages.GetPropertyPage(TabPages.PROPERTIES, null);

            propertyPage.Grid.PropertyValueChanged += new PropertyValueChangedEventHandler(Grid_PropertyValueChanged);

            if (Properties.Settings.Default.ReadOnly)
            {
                toolStripSave.Visible    = false;
                toolStripSaveAll.Visible = false;
            }
        }
Exemple #3
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            //Initialize Culture
            if (SPMRegistry.GetValue(SPMLocalization.C_REGKEY_CULTURE, SPMLocalization.C_REGKEY_CULTUREID) == null)
            {
                SPMRegistry.SetValue(SPMLocalization.C_REGKEY_CULTURE, SPMLocalization.C_REGKEY_CULTUREID, SPMLocalization.C_CULTURE_EN);
            }
            else
            {
                /* NEW LANGUAGE INSTRUCTIONS
                 * - Add a new constant in Library-SPMLocalization.cs  (public const string C_CULTURE_XX = "XX";)
                 * - Add a new sub-menu ("Xxxxx") in the MainForm.cs under "Languages", and his Click Event
                 * - Add two rows code to the Event of the sub-menu:
                 *             SPMRegistry.SetValue(SPMLocalization.C_REGKEY_CULTURE, SPMLocalization.C_REGKEY_CULTUREID, SPMLocalization.C_CULTURE_XX);
                 *             this.MainWindow_Load(null, null);
                 * - Add a new case in the switch statement in the Load event of MainForm.cs (from row 57)
                 *                     case SPMLocalization.C_CULTURE_XX:
                 *                         xxxxxToolStripMenuItem.Checked = true;
                 *                         break;
                 * - Add a row in the function InitializeInterfaceStrings (MainForm.cs):
                 *                  xxxxxToolStripMenuItem.Text = SPMLocalization.GetString("Interface_xxxxxLanguage");
                 * - Add a row in each SPManagerLanguage.xx.resx file:
                 *                  Interface_xxxxxLanguage	    NameOfLanguageIn-resx-File	    MainForm
                 * - Add a new resources file to the project ("SPManagerLanguage.xx.resx")
                 * - Copy all from SPManagerLanguage.resx to the new SPManagerLanguage.xx.resx file
                 * - Change the "Value" of each string in the new file
                 */

                //Uncheck everything in the Language Menu
                foreach (ToolStripMenuItem myItem in languageToolStripMenuItem.DropDownItems)
                {
                    myItem.Checked = false;
                }

                //Select the correct one
                switch ((string)SPMRegistry.GetValue(SPMLocalization.C_REGKEY_CULTURE, SPMLocalization.C_REGKEY_CULTUREID))
                {
                case SPMLocalization.C_CULTURE_EN:
                    englishToolStripMenuItem.Checked = true;
                    break;

                case SPMLocalization.C_CULTURE_ES:
                    spanishToolStripMenuItem.Checked = true;
                    break;

                case SPMLocalization.C_CULTURE_NL:
                    dutchToolStripMenuItem.Checked = true;
                    break;

                case SPMLocalization.C_CULTURE_SV:
                    swedishToolStripMenuItem.Checked = true;
                    break;
                }
            }
            InitializeInterfaceStrings();

            Explorer.Build();

            // Call default expand after Explorer.Build();
            ExplorerClick(Explorer.SelectedNode as ExplorerNodeBase);
            TabPropertyPage propertyPage = TabPages.GetPropertyPage(TabPages.PROPERTIES, null);

            propertyPage.Grid.PropertyValueChanged += new PropertyValueChangedEventHandler(Grid_PropertyValueChanged);
        }