Example #1
0
		private void menuContext_Popup(object sender, EventArgs e)
		{
			var bEnable = _DrawPanel.SelectedCount > 0;

			MenuDefaultCopy.Enabled = bEnable;
			MenuDefaultDelete.Enabled = bEnable;

			var al = new List<XmlNode>();

			var iData = Clipboard.GetDataObject();

			if (iData == null)
				bEnable = false;
			else if (iData.GetDataPresent(al.GetType()))
				bEnable = true;
			else if (iData.GetDataPresent(DataFormats.Text)) 
				bEnable = true;
			else if (iData.GetDataPresent(DataFormats.Bitmap)) 
				bEnable = true;
			else
				bEnable = false;

			MenuDefaultPaste.Enabled = bEnable;
			MenuChartPaste.Enabled = bEnable;
			MenuGridPaste.Enabled = bEnable;
			MenuMatrixPaste.Enabled = bEnable;
			MenuSubreportPaste.Enabled = bEnable;
			MenuTablePaste.Enabled = bEnable;
		}
Example #2
0
		private void menuContext_Popup(object sender, EventArgs e)
		{
			bool bEnable = _DrawPanel.SelectedCount <= 0? false: true;

			menuCopy.Enabled = bEnable;
			menuDelete.Enabled = bEnable;

			List<XmlNode> al=new List<XmlNode>();
			IDataObject iData = Clipboard.GetDataObject();
			if (iData == null)
				bEnable = false;
			else if (iData.GetDataPresent(al.GetType()))
				bEnable = true;
			else if (iData.GetDataPresent(DataFormats.Text)) 
				bEnable = true;
			else if (iData.GetDataPresent(DataFormats.Bitmap)) 
				bEnable = true;
			else
				bEnable = false;
			menuPaste.Enabled = bEnable;

			return;
		}