Example #1
0
        public static SerializableDictionary <K, V> ProcessGetSerializableDictionary <K, V>(DtoGetSerializableDictionary dto)
        {
            string result = SendAndReceive(dto);

            try {
                return(XmlConverter.Deserialize <SerializableDictionary <K, V> >(result));
            }
            catch {
                DtoException exception = (DtoException)DataTransferObject.Deserialize(result);
                throw ThrowExceptionForDto(exception);
            }
        }
Example #2
0
        ///<summary></summary>
        public static T ProcessGetObject <T>(DtoGetObject dto)
        {
            string result = SendAndReceive(dto);          //this might throw an exception if server unavailable

            try {
                return(XmlConverter.Deserialize <T>(result));

                /*
                 * XmlSerializer serializer=new XmlSerializer(typeof(T));
                 *      //Type.GetType("OpenDentBusiness."+dto.ObjectType));
                 * StringReader strReader=new StringReader(result);
                 * XmlReader xmlReader=XmlReader.Create(strReader);
                 * object obj=serializer.Deserialize(xmlReader);
                 * strReader.Close();
                 * xmlReader.Close();
                 * return (T)obj;*/
            }
            catch {
                DtoException exception = (DtoException)DataTransferObject.Deserialize(result);
                throw new Exception(exception.Message);
            }
        }