public static HttpResource CreateBinary(HttpResourceType type, string base64data)
 {
     return new HttpResource()
     {
         Type = type,
         Data = Convert.FromBase64String(base64data)
     };
 }
 public static HttpResource CreateText(HttpResourceType type, string data)
 {
     return new HttpResource()
     {
         Type = type,
         Data = Encoding.UTF8.GetBytes(data)
     };
 }
 public static HttpResource CreateBinary(HttpResourceType type, byte[] data)
 {
     return new HttpResource()
     {
         Type = type,
         Data = data
     };
 }
Beispiel #4
0
		public static HttpResource CreateText(HttpResourceType type, string data)
		{
			return new HttpResource()
			{
				Type = type,
				Data = Encoding.UTF8.GetBytes(data)
			};
		}
Beispiel #5
0
		public static HttpResource CreateBinary(HttpResourceType type, string base64data)
		{
			return new HttpResource()
			{
				Type = type,
				Data = Convert.FromBase64String(base64data)
			};
		}
Beispiel #6
0
		public static HttpResource CreateBinary(HttpResourceType type, byte[] data)
		{
			return new HttpResource()
			{
				Type = type,
				Data = data
			};
		}
Beispiel #7
0
		private HttpResource RegisterEmbeddedResource(string resourceName, HttpResourceType type, string urlName = null)
		{
			urlName = urlName ?? resourceName;

			byte[] data = GetResourceData(resourceName);

			HttpResource r = HttpResource.CreateBinary(type, data);
			RegisterResource("/" + urlName, r);
			RegisterResource(urlName, r);
			return r;
		}
        private HttpResource RegisterEmbeddedResource(string resourceName, HttpResourceType type, string urlName = null)
        {
            urlName = urlName ?? resourceName;

            byte[] data = GetResourceData(resourceName);

            HttpResource r = HttpResource.CreateBinary(type, data);

            RegisterResource("/" + urlName, r);
            RegisterResource(urlName, r);
            return(r);
        }