I'm not sure that I can summarize the changes in a meaningful way. There were about 108 places in which I had to make changes. There were lots of updates to #if/#elseif statements using the compiler constant NETFX_CORE. Reflection in WinRT is a little different. Instead of having methods hanging off of the Type object to get carious pieces of information there is a method GetTypeInfo() that passes back an object that contains most of this information. So I ended up with the following in the XmlSerializer class (just as an example).
#if NETFX_CORE
var props = from p in ((Type)objType).GetRuntimeProperties()
let indexAttribute = p.GetAttribute<SerializeAsAttribute>()
where p.CanRead && p.CanWrite
orderby indexAttribute == null ? int.MaxValue : indexAttribute.Index
select p;
#else
var props = from p in objType.GetProperties()
let indexAttribute = p.GetAttribute<SerializeAsAttribute>()
where p.CanRead && p.CanWrite
orderby indexAttribute == null ? int.MaxValue : indexAttribute.Index
select p;
#endif
//More general code here
#if NETFX_CORE
if (propType.GetTypeInfo().IsPrimitive || propType.GetTypeInfo().IsValueType || propType == typeof(string))
#else
if (propType.IsPrimitive || propType.IsValueType || propType == typeof(string))
#endif
In general WinRT is most similar to Windows Phone (of all the platforms supported by RestSharp). So there were several #if !WINDOWS_PHONE that were updated to #if !WINDOWS_PHONE && !NETFX_CORE
That's pretty much it. If it tells you anything here are some other random blocks I changed.
#if NETFX_CORE
if (type.GetTypeInfo().IsGenericType)
{
var genericType = type.GetTypeInfo().GenericTypeArguments[0];
#else
if (type.IsGenericType)
{
var genericType = type.GetGenericArguments()[0];
#endif
//RestClient.cs
#if NETFX_CORE
var asmName = this.GetType().AssemblyQualifiedName;
var versionExpression = new System.Text.RegularExpressions.Regex("Version=(?<version>[0-9.]*)");
var m = versionExpression.Match(asmName);
string version = String.Empty;
if (m.Success)
{
version = m.Groups["version"].Value;
}
#else
var assembly = Assembly.GetExecutingAssembly();
AssemblyName assemblyName = new AssemblyName(assembly.FullName);
var version = assemblyName.Version;
#endif
//Http.Async.cs
#if !SILVERLIGHT && !NETFX_CORE
webRequest.AllowAutoRedirect = FollowRedirects;
#endif
//StringExtensions.cs
public static string UrlDecode(this string input)
{
#if NETFX_CORE
return Uri.EscapeUriString(input);
#else
return HttpUtility.UrlDecode(input);
#endif
}