示例#1
0
        private void HelpCommandExecute()
        {
            var window = new HelpTextWindow();

            window.Show();
        }
        private void CustomInitializeComponent()
        {
            this.SuspendLayout();
            this.artifactTreeView.Sorted = true;

            //Load the bitmap
            Bitmap bitmap = TypeBrowserDialog.ResMgr.GetObject("IDB_SORTUP") as Bitmap;
            this.bitmapSortUp = bitmap.GetHbitmap();

            bitmap = TypeBrowserDialog.ResMgr.GetObject("IDB_SORTDOWN") as Bitmap;
            this.bitmapSortDown = bitmap.GetHbitmap();

            //Create imagelist for tree and list
            this.artifactImages = new ImageList();
            this.artifactImages.TransparentColor = Color.FromArgb(0, 255, 0);
            this.artifactImages.Images.AddStrip((Image)TypeBrowserDialog.ResMgr.GetObject("IDB_ARTIFACTIMAGES"));

            //DO NOT CHANGE THE CREATION SEQUENCE OF FOLLOWING CONTROLS

            //Set the listview style
            this.artifactListView.Dock = DockStyle.Fill;
            this.artifactListView.FullRowSelect = true;
            this.artifactListView.HideSelection = false;
            this.artifactListView.MultiSelect = false;
            this.artifactListView.SmallImageList = this.artifactImages;
            this.artifactListView.MouseDown += new MouseEventHandler(OnListViewMouseDown);

            //Set the treeview styles
            this.artifactTreeView.HideSelection = false;
            this.artifactTreeView.ImageList = this.artifactImages;
            //DO NOT CHANGE THE CREATION SEQUENCE OF ABOVE CONTROLS

            //Change the HelpText holder to a Rich Edit Control
            this.helpTextHolder.Visible = false;
            this.helpTextWindow = new HelpTextWindow();
            this.helpTextWindow.Parent = this;
            this.helpTextWindow.Location = new Point(this.helpTextHolder.Location.X + 3, this.helpTextHolder.Location.Y + 3);
            this.helpTextWindow.Size = new Size(this.helpTextHolder.Size.Width - 6, this.helpTextHolder.Size.Height - 6);

            //Set the text based on the browsed type
            if (this.typeFilterProvider != null)
                this.artifactLabel.Text = this.typeFilterProvider.FilterDescription;

            //Set dialog fonts
            IUIService uisvc = (IUIService)this.serviceProvider.GetService(typeof(IUIService));
            if (uisvc != null)
                this.Font = (Font)uisvc.Styles["DialogFont"];

            //Set the font for the artifact label
            this.artifactLabel.Font = new Font(this.Font.Name, this.Font.SizeInPoints, FontStyle.Bold);

            this.genericParametersPropertyGrid.SelectedObject = this.genericParameters;
            this.genericParametersPropertyGrid.Site = this;
            this.genericParametersPropertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(GenericParameterChanged);
            this.ResumeLayout(false);
        }
 private void CustomInitializeComponent()
 {
     base.SuspendLayout();
     this.artifactTreeView.Sorted = true;
     this.bitmapSortUp = (ResMgr.GetObject("IDB_SORTUP") as Bitmap).GetHbitmap();
     this.bitmapSortDown = (ResMgr.GetObject("IDB_SORTDOWN") as Bitmap).GetHbitmap();
     this.artifactImages = new ImageList();
     this.artifactImages.TransparentColor = Color.FromArgb(0, 0xff, 0);
     this.artifactImages.Images.AddStrip((Image) ResMgr.GetObject("IDB_ARTIFACTIMAGES"));
     this.artifactListView.Dock = DockStyle.Fill;
     this.artifactListView.FullRowSelect = true;
     this.artifactListView.HideSelection = false;
     this.artifactListView.MultiSelect = false;
     this.artifactListView.SmallImageList = this.artifactImages;
     this.artifactListView.MouseDown += new MouseEventHandler(this.OnListViewMouseDown);
     this.artifactTreeView.HideSelection = false;
     this.artifactTreeView.ImageList = this.artifactImages;
     this.helpTextHolder.Visible = false;
     this.helpTextWindow = new HelpTextWindow();
     this.helpTextWindow.Parent = this;
     this.helpTextWindow.Location = new Point(this.helpTextHolder.Location.X + 3, this.helpTextHolder.Location.Y + 3);
     this.helpTextWindow.Size = new Size(this.helpTextHolder.Size.Width - 6, this.helpTextHolder.Size.Height - 6);
     if (this.typeFilterProvider != null)
     {
         this.artifactLabel.Text = this.typeFilterProvider.FilterDescription;
     }
     IUIService service = (IUIService) this.serviceProvider.GetService(typeof(IUIService));
     if (service != null)
     {
         this.Font = (Font) service.Styles["DialogFont"];
     }
     this.artifactLabel.Font = new Font(this.Font.Name, this.Font.SizeInPoints, FontStyle.Bold);
     this.genericParametersPropertyGrid.SelectedObject = this.genericParameters;
     this.genericParametersPropertyGrid.Site = this;
     this.genericParametersPropertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(this.GenericParameterChanged);
     base.ResumeLayout(false);
 }