private void InitializeToolStrip()
 {
     ToolStripBuilder.Clear(_toolStrip.Items);
     if (_component.ToolbarModel != null)
     {
         ToolStripBuilder.BuildToolbar(_toolStrip.Items, _component.ToolbarModel.ChildNodes);
     }
 }
        public StudyFilterComponentPanel(StudyFilterComponent component) : this()
        {
            _component = component;
            _component.FilterPredicatesChanged += new EventHandler(_component_FilterPredicatesChanged);

            ActionModelRoot toolbarActions = ActionModelRoot.CreateModel("ClearCanvas.ImageViewer.Utilities.StudyFilters.View.WinForms", StudyFilterTool.DefaultToolbarActionSite, _component.ExportedActions);

            ToolStripBuilder.ToolStripBuilderStyle defaultStyle = new ToolStripBuilder.ToolStripBuilderStyle();
            ToolStripBuilder.ToolStripBuilderStyle myStyle      = new ToolStripBuilder.ToolStripBuilderStyle(ToolStripItemDisplayStyle.ImageAndText, defaultStyle.ToolStripAlignment, defaultStyle.TextImageRelation);
            ToolStripBuilder.BuildToolbar(_toolbar.Items, toolbarActions.ChildNodes, myStyle);

            _tableView.Table       = component.Table;
            _tableView.MultiSelect = true;
            _tableView.ColumnFilterMenuStripClosed    += new EventHandler(_tableView_ColumnFilterMenuStripClosed);
            _tableView.ContextActionModelDelegate      = this.GetContextMenuModel;
            _tableView.ColumnFilterActionModelDelegate = this.GetColumnFilterMenuModel;
            _tableView.ReadOnly = true;
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public BiographyOrderReportsComponentControl(BiographyOrderReportsComponent component)
            : base(component)
        {
            _component = component;
            InitializeComponent();

            Control reportPreview = (Control)_component.ReportPreviewComponentHost.ComponentView.GuiElement;

            reportPreview.Dock = DockStyle.Fill;
            _reportPreviewPanel.Controls.Add(reportPreview);

            _reports.DataSource = _component.Reports;
            _reports.DataBindings.Add("Value", _component, "SelectedReport", true, DataSourceUpdateMode.OnPropertyChanged);
            _reports.Format += delegate(object sender, ListControlConvertEventArgs e) { e.Value = _component.FormatReportListItem(e.ListItem); };

            _toolbarActionModel = _component.ActionModel;
            ToolStripBuilder.BuildToolbar(_toolstrip.Items, _toolbarActionModel.ChildNodes);

            _component.AllPropertiesChanged += AllPropertiesChangedEventHandler;
        }
Esempio n. 4
0
        /// <summary>
        /// Constructor
        /// </summary>
        public FoldersComponentControl(FoldersComponent component)
        {
            InitializeComponent();

            _component = component;

            ToolStripBuilder.BuildToolbar(_toolbar.Items, _component.ToolbarModel.ChildNodes, ToolStripItemDisplayStyle.ImageAndText);

            foreach (IFolder folder in _component.Folders)
            {
                TreeNode node = new TreeNode(folder.DisplayName);
                node.Tag = folder;

                _folderTree.Nodes.Add(node);
            }

            _component.SelectedFolderChanged += new EventHandler(_component_SelectedFolderChanged);

            // TODO add .NET databindings to _component
        }