Inheritance: System.Windows.Forms.ListViewItem
Ejemplo n.º 1
0
        private void chbUseContractSymbol_CheckedChanged(object sender, EventArgs e)
        {
            if (this.instruments.Count == 0)
            {
                return;
            }
            bool IsChecked = this.chbUseContractSymbol.Checked;

            this.InvokeAction((Action)(() =>
            {
                this.ltvInstruments.BeginUpdate();
                this.ltvInstruments.Items.Clear();
                foreach (Instrument instrument in this.instruments)
                {
                    InstrumentViewItem instrumentViewItem1 = new InstrumentViewItem(instrument);
                    if (IsChecked && instrument.Maturity != DateTime.MinValue)
                    {
                        if (instrument.Type == InstrumentType.Option || instrument.Type == InstrumentType.FutureOption)
                        {
                            InstrumentViewItem instrumentViewItem2 = instrumentViewItem1;
                            string str = instrumentViewItem2.Text + (object)" " + instrument.Maturity.ToString("yyMMdd") + (string)(instrument.PutCall == PutCall.Call ? (object)"C" : (object)"P") + (string)(object)instrument.Strike;
                            instrumentViewItem2.Text = str;
                        }
                        else
                        {
                            InstrumentViewItem instrumentViewItem2 = instrumentViewItem1;
                            string str = instrumentViewItem2.Text + " " + this.ExpToString(instrument.Maturity);
                            instrumentViewItem2.Text = str;
                        }
                    }
                    this.ltvInstruments.Items.Add((ListViewItem)instrumentViewItem1);
                }
                this.ltvInstruments.EndUpdate();
            }));
        }
Ejemplo n.º 2
0
 private void chbUseContractSymbol_CheckedChanged(object sender, EventArgs e)
 {
   if (this.instruments.Count == 0)
     return;
   bool IsChecked = this.chbUseContractSymbol.Checked;
   this.InvokeAction((Action) (() =>
   {
     this.ltvInstruments.BeginUpdate();
     this.ltvInstruments.Items.Clear();
     foreach (Instrument instrument in this.instruments)
     {
       InstrumentViewItem instrumentViewItem1 = new InstrumentViewItem(instrument);
       if (IsChecked && instrument.Maturity != DateTime.MinValue)
       {
         if (instrument.Type == InstrumentType.Option || instrument.Type == InstrumentType.FutureOption)
         {
           InstrumentViewItem instrumentViewItem2 = instrumentViewItem1;
           string str = instrumentViewItem2.Text + (object) " " + instrument.Maturity.ToString("yyMMdd") + (string) (instrument.PutCall == PutCall.Call ? (object) "C" : (object) "P") + (string) (object) instrument.Strike;
           instrumentViewItem2.Text = str;
         }
         else
         {
           InstrumentViewItem instrumentViewItem2 = instrumentViewItem1;
           string str = instrumentViewItem2.Text + " " + this.ExpToString(instrument.Maturity);
           instrumentViewItem2.Text = str;
         }
       }
       this.ltvInstruments.Items.Add((ListViewItem) instrumentViewItem1);
     }
     this.ltvInstruments.EndUpdate();
   }));
 }