bool allowReplace() { if (!criteriaEnabled) { return(false); } Criteria c = FromCriteria; if (c.ResourceType == null && c.ResourceGroup == null && c.Instance == null) { return(false); } c = ToCriteria; if (c.ResourceType == null && c.ResourceGroup == null && c.Instance == null) { return(false); } AResourceKey from = new RK(FromCriteria.ResourceKey); AResourceKey to = new RK(ToCriteria.GetValueOrDefault(from)); bool res = to.Equals(from); return(!res); }
private void rtgiCopyRK_Click(object sender, EventArgs e) { ToolStripDropDownItem tsmi = sender as ToolStripDropDownItem; if (tsmi == null || tsmi.Owner as ContextMenuStrip == null) { return; } if ((tsmi.Owner as ContextMenuStrip).SourceControl == tlpFromTGIValues) { Clipboard.SetText(FromCriteria.ResourceKey + ""); } else { Clipboard.SetText(ToCriteria.GetValueOrDefault(FromCriteria.ResourceKey) + ""); } }