public PmlElement ValueToPml() { if (_value == null) { return(new PmlNull()); } switch (_type) { case CciResultType.Binary: return(new PmlBinary((byte[])_value)); case CciResultType.Message: case CciResultType.Object: case CciResultType.Value: case CciResultType.Error: return(new PmlString(_value.ToString())); case CciResultType.Success: return(new PmlInteger(1)); case CciResultType.List: { PmlCollection c = new PmlCollection(); foreach (Object i in (Array)_value) { c.Add(i.ToString()); } return(c); } case CciResultType.Pml: return((PmlElement)_value); default: return(new PmlString("Unknown type: " + _type.ToString())); } }
public PmlCollection ToPml(int offset) { PmlCollection c = new PmlCollection(); for (int i = _offset + offset; i < _command.Length; i++) { c.Add(_command[i]); } return(c); }