コード例 #1
0
 private string GetPreferredImageMime(BaseDeviceInfo device, IDictionary capabilities)
 {
     var mimeTypes = device.GetPropertyValueStringIndexes(CcppAccept);
     // Look at the database and return the 1st one that matches in order
     // of preference.
     if (Contains(mimeTypes, ImagePng))
         return "image/png";
     if (Contains(mimeTypes, ImageJpeg))
         return "image/jpeg";
     if (Contains(mimeTypes, ImageGif))
         return "image/gif";
     return null;
 }
コード例 #2
0
 /// <summary>
 /// Returns true if the device supports callbacks from the browser.
 /// </summary>
 /// <param name="device">The device to be checked.</param>
 /// <returns>True if callback is supported.</returns>
 private string GetSupportsCallback(BaseDeviceInfo device)
 {
     var values = device.GetPropertyValueStringIndexes(AjaxRequestType);
     if (values != null && values.Contains(AjaxRequestTypeNotSupported))
         return bool.FalseString.ToLowerInvariant();
     return bool.TrueString.ToLowerInvariant();
 }