public override void PipelineTabChanged(object sender, EventArgs e) { GridView gridView = FormWrapper.GetPipeline(); if (gridView == null || gridView.ContextMenuStrip.Items.Count.Equals(0)) { return; } if (EncompassHelper.IsSuper) { ToolStripItem readOnly = (ToolStripItem)NewItem(nameof(VIP)); if (!gridView.ContextMenuStrip.Items.Contains(readOnly)) { gridView.ContextMenuStrip.Items.Insert(0, readOnly); } else { gridView.ContextMenuStrip.Items.Remove(readOnly); } } gridView.ContextMenuStrip.Opening += ContextMenuStrip_Opening; gridView.ItemDoubleClick += GridView_ItemDoubleClick; }
private void ContextMenuStrip_Opened(object sender, EventArgs e) { if (Pipeline == null) { Pipeline = FormWrapper.GetPipeline(); } if (Pipeline.SelectedItems.Count < 1) { return; } Tag = Pipeline.SelectedItems[0].Tag as PipelineInfo; if (!string.IsNullOrEmpty(Tag.LockInfo.LockedBy)) { if (!Pipeline.ContextMenuStrip.Items.Contains(DoorBellItem)) { Pipeline.ContextMenuStrip.Items.Insert(0, DoorBellItem); DoorBellItem.Click -= DoorBellItem_Click; DoorBellItem.Click += DoorBellItem_Click; } } else { if (Pipeline.ContextMenuStrip.Items.Contains(DoorBellItem)) { Pipeline.ContextMenuStrip.Items.Remove(DoorBellItem); } } }
public override void PipelineTabChanged(object sender, EventArgs e) { try { GridView pipeline = FormWrapper.GetPipeline(); pipeline.Items.Change += Items_Change; CheckRules(); } catch (Exception ex) { Logger.HandleError(ex, "OpenReadOnly"); } }
private void ContextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) { ContextMenuStrip menu = sender as ContextMenuStrip; ToolStripItem vip = menu.Items.Cast <ToolStripItem>().Where(x => x.Text.Contains(nameof(VIP))).FirstOrDefault(); if (vip != null) { VIPRoot cdo = VIPCDO.CDO; GVItem selected = FormWrapper.GetPipeline().SelectedItems.FirstOrDefault(); vip.Text = "Mark As VIP"; if (cdo.Loans.Contains((selected?.Tag as PipelineInfo).GUID)) { vip.Text = "Marked VIP"; } } }
private void Item_Click(object sender, EventArgs e) { GridView gridView = FormWrapper.GetPipeline(); VIPRoot cdo = VIPCDO.CDO; string guid = (gridView.SelectedItems.FirstOrDefault().Tag as PipelineInfo).GUID; if (cdo.Loans.Contains(guid)) { cdo.Loans.Remove(guid); } else { cdo.Loans.Add(guid); } VIPCDO.UpdateCDO(cdo); VIPCDO.UploadCDO(); }
private void Item_Click(object sender, EventArgs e) { GridView gridView = FormWrapper.GetPipeline(); VIPCDO cdo = CustomDataObject.Get <VIPCDO>(VIPCDO.Key); string guid = (gridView.SelectedItems.FirstOrDefault().Tag as PipelineInfo).GUID; if (cdo.Loans.Contains(guid)) { cdo.Loans.Remove(guid); } else { cdo.Loans.Add(guid); } CustomDataObject.Save <VIPCDO>(VIPCDO.Key, cdo); }
public override void PipelineTabChanged(object sender, EventArgs e) { Pipeline = FormWrapper.GetPipeline(); Pipeline.ContextMenuStrip.Opened += ContextMenuStrip_Opened; }