Joshi.Utils.Imap.Imap.ParseParameters C# (CSharp) Method

ParseParameters() private method

Parse the parameter in body structure
private ParseParameters ( string &sBodyStruct, ArrayList asParams ) : bool
sBodyStruct string Body structure
asParams System.Collections.ArrayList parameter
return bool
        bool ParseParameters(ref string sBodyStruct,
            ArrayList asParams)
        {
            // remove any spaces at the beginning and the end
            sBodyStruct = sBodyStruct.Trim();

            // check if this is NIL
            if (IsNilString(ref sBodyStruct))
                return true;

            // remove the opening paranthesis
            if (!FindAndRemove(ref sBodyStruct, '('))
                return false;

            string sName = "";
            string sValue = "";
            while (sBodyStruct[0] != ')')
            {

                // Name
                if (!ParseQuotedString( ref sBodyStruct, ref sName ))
                {
                    Log(LogTypeEnum.ERROR, "Invalid Body Parameter Name.");
                    return false;
                }

                // Value
                if (!ParseQuotedString(ref  sBodyStruct, ref sValue ))
                {
                    Log ( LogTypeEnum.ERROR, "Invalid Body Parameter Value.");
                    return false;
                }
                asParams.Add(sName);
                asParams.Add(sValue);
            }

            // remove the closing paranthesis
            return FindAndRemove(ref sBodyStruct, ')');
        }