title: Boolean int conversion issue
body: <p>I am working on a trading API (activex from interactive brokers)which has a method called:</p>
  
  <pre><code>void reqMktDataEx(int tickerId, IContract contract, string generalDetails, int snapshot)
  </code></pre>
  
  <p>The issue is around the last parameter "int snapshot" which obviously requires an int input which actually indicates that whether trader wanna snapshot market data or not. So I guess that if I set it to non-zero, then the implicit conversion would convert this non-zero to be <code>bool</code> value "true".</p>
  
  <p>However, I am using c# to connect to this api. Everything was fine until this one. I tried this:</p>
  
  <p>A. <code>void reqMktDataEx(1, AUDUSD, "100", 0)</code>
  Please ignore the first three parameters "1, AUDUSD, "100"", the only matter is the last one 0 as int. I got paused during debugging and the information is :
  "Specified cast is not valid. Invalidcastexception is unhandled" and "when casting from a number, the number must not be infinity".</p>
  
  <p>After this I learned that here is a difficulty for c# to treat 1 as bool true and 0 as bool false IMPLICITLY according this 
  web <a href="http://www.dotnetperls.com/convert-bool-int" rel="noreferrer">http://www.dotnetperls.com/convert-bool-int</a></p>
  
  <p>B. I tried this 
  <code>void reqMktDataEx(1, AUDUSD, "100", Convert.ToInt16(false))</code> I got similar error again.</p>
  
  <p>C. I tried again this one:</p>
  
  <pre><code>void reqMktDataEx(1, AUDUSD, "100", int.Parse("false"))
  </code></pre>
  
  <p>the complaint is input string was not in a correct format. Make sure that you method arguments are in the right format.</p>
  
  <p>MY GUESS:
  Here is a inside configuration of C# which does not treat 0 as false and 1 as true. Is there any way to solve?</p>
  
  <p><strong>First Edit</strong></p>
  
  <p>As suspected by one professional programmer below, I post the contract class and audusd definition here for him. thanks in advance</p>
  
  <pre><code>namespace InteractiveBrokersTradingSystem
  {
      class Contract:TWSLib.IContract
      {
          public int conId { get; set; }
          public string symbol { get; set; }
          public string secType { get; set; }
          public string expiry { get; set; }
          public double strike { get; set; }
          public string right { get; set; }
          public string multiplier { get; set; }
          public string exchange { get; set; }
          public string primaryExchange { get; set; }
          public string currency { get; set; }
          public string localSymbol { get; set; }
          public int includeExpired { get; set; }
          public object comboLegs { get; set; }
          public object underComp { get; set; }
          public string comboLegsDescrip { get; set; }
          public string secIdType { get; set; }
          public string secId { get; set; }
      }
  }
  
  namespace InteractiveBrokersTradingSystem
  {
      class Forex:Contract
      {
          public Forex(string preCurrency,string baseCurrency)
          {
              //conId = 14433401;
              symbol = preCurrency;
              secType = "CASH";
              exchange = "IDEALPRO";
              currency = baseCurrency;
              strike = 0;
              includeExpired = 0;
              primaryExchange = "IDEALPRO";       
          }
      }
  }
  </code></pre>
  
  <p>The method I use to call the reqMktDataEx:
  implementation first, simple inheritance:</p>
  
  <pre><code>public void MyReqMarketData(int tickId, IContract contract, string tickTypes, int snapshot)
  {
      reqMktDataEx(tickId, contract, tickTypes, snapshot);
  }
  
  
   private void AudButtonItemItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
   {
       Forex audusd = new Forex("AUD", "USD");
  
        _myTwsClass.MyReqMarketData(1,audusd, "100", 0);
    }
  </code></pre>
  
  <p><strong>Second Edit</strong>:</p>
  
  <pre><code>  System.InvalidCastException was unhandled
    Message=Unable to cast object of type 'InteractiveBrokersTradingSystem.Forex' to type 'TWSLib.IContract'.
    Source=InteractiveBrokersTradingSystem
  </code></pre>
  
  <p>It seems that here is some casting problem between the forex class I defined and the Icontract com thing. Here is my new definition:</p>
  
  <pre><code>namespace InteractiveBrokersTradingSystem
  {
      class Forex
      {
          public int conId { get; set; }
          public string symbol { get; set; }
          public string secType { get; set; }
          public string expiry { get; set; }
          public double strike { get; set; }
          public string right { get; set; }
          public string multiplier { get; set; }
          public string exchange { get; set; }
          public string primaryExchange { get; set; }
          public string currency { get; set; }
          public string localSymbol { get; set; }
          public int includeExpired { get; set; }
          public object comboLegs { get; set; }
          public object underComp { get; set; }
          public string comboLegsDescrip { get;set; }
          public string secIdType { get; set; }
          public string secId { get; set; }
  
          public Forex(string preCurrency,string baseCurrency)
          {
              //conId = 0;
              //symbol = preCurrency;
              //secType = "CASH";
              //expiry = null;
              //strike = double.Parse("0");
              //right = null;
              //multiplier = null;
              //exchange = "IDEALPRO";
              //primaryExchange = "IDEALPRO";
              //currency = baseCurrency;
              //localSymbol = null;
              //includeExpired = 0;
              //comboLegs = null;
              //underComp = null;
              //comboLegsDescrip = null;
              //secType = null;
              //secId = null;
          }
      }
  }
  </code></pre>
  
  <p>As you can see that the Forex class inherits from the TWS.IContract. how it could not be cast to Icontract successively?</p>