예제 #1
0
		private void bDetails_Click( object sender, System.EventArgs e )
		{
			PacketItem pi = clbPackets.SelectedItem as PacketItem;
			if ( pi != null )
			{
				PacketProp[] props = Packet.PropsTable[pi.Cmd];

				string[] names = new string[props.Length];
				string[] typeNames = new String[props.Length];
				string[] formats = new string[props.Length];
				for ( int i = 0; i < props.Length; i++ )
				{
					names[i] = props[i].PropInfo.Name;
					typeNames[i] = props[i].PropInfo.PropertyType.Name;
					formats[i] = props[i].Attribute.Format;
				}

				PropsFilter pFilter = new PropsFilter( names, typeNames, pi.Props, pi.PropsHave, formats );
				pFilter.TopMost = TopMost;
				if ( pFilter.ShowDialog() == DialogResult.OK )
				{
					pi.Props = pFilter.GetPropValues();
					pi.PropsHave = pFilter.GetPropHaveValues();

					clbPackets.SetItemCheckState( clbPackets.SelectedIndex, GetCheckState( pi ) );
				}
			}
		}
예제 #2
0
		private void bDetails_Click( object sender, System.EventArgs e )
		{
			PacketItem pi = clbPackets.SelectedItem as PacketItem;
			if ( pi != null )
			{
				PacketProp[] props = Packet.PropsTable[pi.Cmd];

				string[] names = new string[props.Length];
				string[] typeNames = new String[props.Length];
				string[] formats = new string[props.Length];
				for ( int i = 0; i < props.Length; i++ )
				{
					names[i] = props[i].PropInfo.Name;
					typeNames[i] = props[i].PropInfo.PropertyType.Name;
					formats[i] = props[i].Attribute.Format;
				}

				PropsFilter pFilter = new PropsFilter( names, typeNames, pi.Props, pi.PropsHave, formats );
				pFilter.TopMost = TopMost;
				if ( pFilter.ShowDialog() == DialogResult.OK )
				{
					pi.Props = pFilter.GetPropValues();
					pi.PropsHave = pFilter.GetPropHaveValues();

					clbPackets.SetItemCheckState( clbPackets.SelectedIndex, GetCheckState( pi ) );
				}
			}
		}