Exemplo n.º 1
0
        public void Initialize()
        {
            PropertyGridTypeConverter.AddEditor(typeof(string), typeof(StringEditor));

            System.Windows.Forms.Integration.WindowsFormsHost.EnableWindowsFormsInterop();
            ComponentDispatcher.ThreadIdle -= ComponentDispatcher_ThreadIdle; // ensure we don't register twice
            ComponentDispatcher.ThreadIdle += ComponentDispatcher_ThreadIdle;

            CompositionProvider.LoadAssemblies();
        }
Exemplo n.º 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;
            }
        }