public SFormSearch(FForm form) { InitializeComponent(); GridResult.Label.Visible = false; GridResult.SMenuComponent.Dock = DockStyle.None; GridResult.SMenuComponent.Visible = false; GridResult.STextBox.Dock = DockStyle.Top; GridResult.STextBox.Width = GridResult.Width; GridResult.ScreenSecondary = false; GridResult.IsDependecyUkey = false; ComboBox.Caption = "Lista de Pesquisa"; ComboBox.DisplayMember = "Display"; ComboBox.ValueMember = "QueryId"; //ComboBox.ObjetoApp = new SInvokeMethod(typeof(ReportApp), "SearchAll"); ComboBox.SComponent.DataSource = SReflection.GetListContext(typeof(ReportApp), "SearchAllReport", form.Name) as IList; ComboBox.Refresh(); ComboBox.SComponent.DropDownClosed += SComponentOnDropDownClosed; SReportses = form.SReportses; if (SReportses == null || !SReportses.Any()) { return; } foreach (var sReportse in SReportses) { var item = new RibbonButton { Label = sReportse.Nome, ToolTip = sReportse.LocalPath, Tag = sReportse.DataSet, Name = sReportse.DataSet.FirstOrDefault().Key }; item.Click += RibbonButtonOnClick; //if (sMenuSearch1.RibbonMenuButtonReports.Items.Cast<object>().All(item1 => ((RibbonButton)item1).Name != item.Name)) //{ // sMenuSearch1.RibbonMenuButtonReports.Items.Add(item); //} } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); _sMenu.ControlMenu(StateForm); if (SReportses == null || !SReportses.Any()) { return; } foreach (var sReportse in SReportses) { var item = new RibbonButton { Label = sReportse.Nome, ToolTip = sReportse.LocalPath, Tag = sReportse.DataSet, Name = sReportse.DataSet.FirstOrDefault().Key }; item.Click += _sMenu.ButtonBase_OnClick; if (_sMenu.RibbonButtonReports.Items.Cast <object>().All(item1 => ((RibbonButton)item1).Name != item.Name)) { _sMenu.RibbonButtonReports.Items.Add(item); } } }