예제 #1
0
        public Resource(string resourceName, ResourceType resourceType)
        {
            _name       = resourceName;
            _hashString = "N:" + resourceName + "RT:" + resourceType.ToString();
            switch (resourceType)
            {
            case ResourceType.Image:
                _addResourceCommand = new Commands.ResourceAddImage(resourceName);
                break;

            case ResourceType.Sound:
                _addResourceCommand = new Commands.ResourceAddSound(resourceName);
                break;

            case ResourceType.TrueTypeFont:
                _addResourceCommand = new Commands.ResourceAddTrueTypeFont(resourceName);
                break;

            default:
                _addResourceCommand = null;
                break;
            }
        }
예제 #2
0
        public Resource(string resourceName, Uri uri, ImageFormat imageFormat)
        {
            _name       = resourceName;
            _hashString = "N:" + resourceName + "RT:" + ResourceType.Image;
            string contentType = string.Empty;

            if (imageFormat == ImageFormat.Bmp)
            {
                contentType = "image/bmp";
            }
            else if (imageFormat == ImageFormat.Gif)
            {
                contentType = "image/gif";
            }
            else if (imageFormat == ImageFormat.Jpeg)
            {
                contentType = "image/jpeg";
            }
            else if (imageFormat == ImageFormat.Png)
            {
                contentType = "image/png";
            }
            _addResourceCommand = new Commands.ResourceAddStream(uri, contentType, false);
        }
예제 #3
0
 public Resource(Uri uri, string contentType, bool autoPlay)
 {
     _name               = uri.OriginalString;
     _hashString         = "M:" + uri.OriginalString;
     _addResourceCommand = new Commands.ResourceAddStream(uri, contentType, autoPlay);
 }
예제 #4
0
 public Resource(float ease, TimeSpan duration)
 {
     _hashString         = "A:" + ease.ToString() + ";" + duration.ToString();
     _name               = _hashString;
     _addResourceCommand = new Commands.ResourceAddAnimation(ease, duration);
 }
예제 #5
0
 public Resource(string text, TextStyle style, Color color)
 {
     _hashString         = "T:" + text + ";" + style.ToString() + ";" + GetColorString(color);
     _name               = _hashString;
     _addResourceCommand = new Commands.ResourceAddText(text, style, color);
 }
예제 #6
0
 public Resource(Color color)
 {
     _name               = GetColorString(color);
     _hashString         = "C:" + _name;
     _addResourceCommand = new Commands.ResourceAddColor(color);
 }
예제 #7
0
 public Resource(TextStyle textStyle)
 {
     _name               = textStyle.ToString();
     _hashString         = "F:" + _name;
     _addResourceCommand = new Commands.ResourceAddFont(textStyle);
 }
예제 #8
0
 public Resource(Uri uri, string contentType, VideoStart state)
 {
     _name               = uri.OriginalString;
     _hashString         = "V:" + uri.OriginalString;
     _addResourceCommand = new Commands.ResourceAddStream(uri, contentType, state == VideoStart.AutoPlay);
 }