Exemple #1
0
 /// <summary>
 /// Writes the latest error state and error message to the debug XML
 /// stream.
 /// </summary>
 /// <param name="errorState">The component's latest error state</param>
 /// <param name="errorMessage">The associated error message</param>
 /// <remarks>
 /// There is no need to call this from derived classes as it is called
 /// by the SetStatus method.
 /// </remarks>
 private void WriteDebugXmlErrorState(ErrorState errorState,
                                      string errorMessage)
 {
     if (_xmlDebugging)
     {
         WriteDebugXmlElement("ErrorState", errorState.ToString());
         WriteDebugXmlElement("ErrorMessage", errorMessage);
     }
 }
        /// <summary>
        /// Convert this exception to a string
        /// </summary>
        public override string ToString()
        {
            StringBuilder exceptionString = new StringBuilder(this.Message);

            exceptionString.AppendFormat("\r\nAt State {0}\r\n", ErrorState.ToString());
            exceptionString.Append("--- DATA SEGMENT ---\r\n");

            if (DataSegment != null)
            {
                foreach (KeyValuePair <string, object> kv in DataSegment)
                {
                    exceptionString.AppendFormat("{0} = {1}", kv.Key, kv.Value.ToString());
                }
            }

            return(exceptionString.ToString());
        }
Exemple #3
0
        public void ToStringTest()
        {
            ReportStart();

            Assert.AreEqual(_sub1State.ToString(),
                            _component.SubComponent1.ToString());
            Assert.AreEqual(_sub2State.ToString(),
                            _component.SubComponents[0].ToString());
            Assert.AreEqual(_sub3State.ToString(),
                            _component.SubComponents[1].ToString());

            ErrorState expected = _componentState
                                  | _sub1State
                                  | _sub2State
                                  | _sub3State;

            Assert.AreEqual(expected.ToString(), _component.ToString());

            ReportEnd();
        }
 /// <summary>
 /// Gets a string representation of the GifComponentStatus's ErrorState
 /// property.
 /// </summary>
 /// <returns>
 /// A string representation of the ErrorState property.
 /// </returns>
 public override string ToString()
 {
     return(ErrorState.ToString());
 }
 public override string ToString()
 {
     return($"{ExchangeName} ({(ErrorState == null ? "NoOrderbook" : ErrorState.ToString())}, {HedgingPreference:P2})");
 }
 /// <summary>
 /// Writes the latest error state and error message to the debug XML
 /// stream.
 /// </summary>
 /// <param name="errorState">The component's latest error state</param>
 /// <param name="errorMessage">The associated error message</param>
 /// <remarks>
 /// There is no need to call this from derived classes as it is called
 /// by the SetStatus method.
 /// </remarks>
 private void WriteDebugXmlErrorState( ErrorState errorState, 
     string errorMessage)
 {
     if( _xmlDebugging )
     {
         WriteDebugXmlElement( "ErrorState", errorState.ToString() );
         WriteDebugXmlElement( "ErrorMessage", errorMessage );
     }
 }
 internal ErrorWindow(ErrorState state) : this()
 {
     StatePresenter.SetResourceReference(ContentPresenter.ContentTemplateProperty, state.ToString());
 }