public override void PipelineTabChanged(object sender, EventArgs e) { cdo = CustomDataObject.Get <PipelineFilterCDO>(PipelineFilterCDO.Key); if (cdo == null) { return; } TabControl tab = sender as TabControl; TabPage tabPage = tab.TabPages[tab.SelectedIndex]; Folder = tabPage.Controls.Find("cboFolder", true)[0] as CheckedComboBox; View = tabPage.Controls.Find("cboView", true)[0] as ComboBox; View.SelectedIndexChanged += View_SelectedIndexChanged; Control c = tabPage.Controls.Find("gradientPanel1", true).FirstOrDefault(); if (c != null && c.Controls.Find("save", true).Count().Equals(0)) { Filter = new ComboBox(); Label label = new Label(); Button save = new Button(); Button delete = new Button(); c.Controls.Add(label); c.Controls.Add(Filter); c.Controls.Add(save); c.Controls.Add(delete); Point p = c.Controls.Find("btnManageViews", true).FirstOrDefault().Location; label.Location = new Point(p.X + 20, p.Y); label.Text = "Filters"; label.Size = new Size(label.Size.Width / 2, label.Size.Height); Filter.Location = new Point(label.Location.X + label.Width + 5, label.Location.Y); Filter.SelectedValueChanged += Filter_SelectedValueChanged; save.Location = new Point(Filter.Location.X + Filter.Width + 5, Filter.Location.Y); save.Click += Save_Click; save.Text = "Save"; delete.Location = new Point(save.Location.X + save.Width + 5, save.Location.Y); delete.Click += Delete_Click; delete.Text = "Delete"; LoadFilters(Filter); } }
private void Save_Click(object sender, EventArgs e) { PipelineScreen mainScreen = FormWrapper.EncompassForm.Controls.Find("pipelineScreen", true)[0] as PipelineScreen; FieldFilterList filter = mainScreen.GetCurrentFilter(); PipelineFilterCDORoot cdo = PipelineFilterCDO.CDO; cdo.Filters.Add(new PipelineFilter() { Name = Filter.Text, Filter = filter, Public = false, Owner = EncompassHelper.User.ID, Folder = GetSelectedFolderList(), PipelineView = View.Text }); PipelineFilterCDO.UpdateCDO(cdo); PipelineFilterCDO.UploadCDO(); LoadFilters(Filter); Filter.Text = string.Empty; }