Sage.Integration.Northwind.Application.API.Token.SerializeTokenToString C# (CSharp) Метод

SerializeTokenToString() публичный статический Метод

Serializes an instance of type Token to a string.
The string representation is as followed: id + SequenceNo + InitRequest id: 29 chars SequenceNo: 10 chars InitRequest: 1 char (1=true; 0=false) Each part is right padded with ' '.
public static SerializeTokenToString ( Token token ) : string
token Token The object to be serialized.
Результат string
        public static string SerializeTokenToString(Token token)
        {
            string strId = token.Id.Id.PadRight(29, ' ');
            string strSequenceNo = token.SequenceNumber.ToString().PadRight(10, ' '); ;
            string strInitRequest = (token.InitRequest) ? "1" : "0";

            // concat and return.
            return strId + strSequenceNo + strInitRequest;
        }