protected virtual string Serialize(MvxViewModelRequest toSerialise) { var stringDictionaryWriter = new MvxStringDictionaryWriter(); var dictionary = new Dictionary<string, string>(); dictionary["Type"] = SerializeViewModelName(toSerialise.ViewModelType); dictionary["Params"] = stringDictionaryWriter.Write(toSerialise.ParameterValues); dictionary["Pres"] = stringDictionaryWriter.Write(toSerialise.PresentationValues); return stringDictionaryWriter.Write(dictionary); }
protected virtual string Serialize(MvxViewModelRequest toSerialise) { var stringDictionaryWriter = new MvxStringDictionaryWriter(); var dictionary = new Dictionary <string, string>(); dictionary["Type"] = this.SerializeViewModelName(toSerialise.ViewModelType); var requestedBy = toSerialise.RequestedBy ?? new MvxRequestedBy(); dictionary["By"] = ((int)requestedBy.Type).ToString(); dictionary["Info"] = requestedBy.AdditionalInfo; dictionary["Params"] = stringDictionaryWriter.Write(toSerialise.ParameterValues); dictionary["Pres"] = stringDictionaryWriter.Write(toSerialise.PresentationValues); return(stringDictionaryWriter.Write(dictionary)); }
protected virtual string Serialize(MvxViewModelRequest toSerialise) { if (toSerialise == null) { throw new ArgumentNullException(nameof(toSerialise)); } var stringDictionaryWriter = new MvxStringDictionaryWriter(); var dictionary = new Dictionary <string, string>(); dictionary["Type"] = SerializeViewModelName(toSerialise.ViewModelType); dictionary["Params"] = stringDictionaryWriter.Write(toSerialise.ParameterValues); dictionary["Pres"] = stringDictionaryWriter.Write(toSerialise.PresentationValues); return(stringDictionaryWriter.Write(dictionary)); }
protected virtual string Serialize(IDictionary <string, string> toSerialise) { var stringDictionaryWriter = new MvxStringDictionaryWriter(); return(stringDictionaryWriter.Write(toSerialise)); }