CK.Core.CKBinaryWriter.WriteNullableString C# (CSharp) Method

WriteNullableString() public method

Writes a potentially null string.
public WriteNullableString ( string s ) : void
s string String to write.
return void
        public void WriteNullableString( string s )
        {
            if( s != null )
            {
                Write( true );
                Write( s );
            }
            else Write( false );
        }
    }

Usage Example

Example #1
0
        void WriteWithoutVersion(CKBinaryWriter w)
        {
            if (w == null)
            {
                throw new ArgumentNullException("w");
            }
            w.Write(_message);
            w.Write(_exceptionTypeName);
            w.Write(_exceptionTypeAQName);
            w.WriteNullableString(_stackTrace);
            w.WriteNullableString(_fileName);
            w.WriteNullableString(_detailedInfo);

            if (_aggregatedExceptions != null)
            {
                w.WriteSmallInt32(_aggregatedExceptions.Length);
                foreach (var agg in _aggregatedExceptions)
                {
                    agg.WriteWithoutVersion(w);
                }
            }
            else
            {
                if (_innerException != null)
                {
                    w.WriteSmallInt32(0);
                    _innerException.WriteWithoutVersion(w);
                }
                else
                {
                    w.WriteSmallInt32(-1);
                }
            }

            if (_loaderExceptions != null)
            {
                w.WriteNonNegativeSmallInt32(_loaderExceptions.Length);
                foreach (var ld in _loaderExceptions)
                {
                    ld.WriteWithoutVersion(w);
                }
            }
            else
            {
                w.WriteNonNegativeSmallInt32(0);
            }
        }
All Usage Examples Of CK.Core.CKBinaryWriter::WriteNullableString