Esempio n. 1
0
		//-------------------------------------------------------------------------------------
		private void btnAddCode_Click(object sender, EventArgs e)
		{
			try
			{
				CtrlCodeEditor box = new CtrlCodeEditor();
				box.Parent = PanelBack;
				box.Width = PanelBack.Width - 30;
				box.Height = PanelBack.Height - 30;
				box.DialogClosed += new DialogClosedEventHandler(CtrlCodeEditor_DialogClosed);

				List<Type> types = new List<Type>();
				Type curType = null;
				if(fdgvList.CurrentRow != null)
					curType = ((ValuesTrio<string, Type, string>)fdgvList.CurrentRow.GetData()).Value2;
				foreach(ValuesTrio<string, Type, string> i in (IPulsarBinder)fdgvList.DataSource)
				{
					if(i.Value2 == null)
						continue;
					types.Add(i.Value2);
					if(i.Value2 == curType)
						curType = i.Value2;
				}
				box.Show(types, curType);
			}
			catch(Exception Err)
			{
				ModalErrorBox.Show(Err, PanelBack);
			}
		}
Esempio n. 2
0
		//-------------------------------------------------------------------------------------
		private void fdgvStore_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
		{
			StoreItem si = (StoreItem)((IKeyedValue)fdgvStore.Rows[e.RowIndex].GetData()).Value;
			if(si.Object is PulsarCodeTransfer.CodeQuery)
			{
				CtrlCodeEditor box = new CtrlCodeEditor();
				box.Parent = PanelBack;
				box.Width = PanelBack.Width - 30;
				box.Height = PanelBack.Height - 30;
				box.DialogClosed += new DialogClosedEventHandler(CtrlCodeEditor_DialogClosed);

				List<Type> types = new List<Type>();
				Type curType = null;
				foreach(ValuesTrio<string, Type, string> i in (IPulsarBinder)fdgvList.DataSource)
				{
					if(i.Value2 == null)
						continue;
					types.Add(i.Value2);
					if(i.Value2 == curType || i.Value2.FullName == ((PulsarCodeTransfer.CodeQuery)si.Object).ObjectType)
						curType = i.Value2;
				}
				box.Tag = si.Name;
				box.Show(types, curType, ((PulsarCodeTransfer.CodeQuery)si.Object).CodeText);
			}
			else 
				FillAnswer(si.Object, si.Name);
		}