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; } }
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); }
public Resource(Uri uri, string contentType, bool autoPlay) { _name = uri.OriginalString; _hashString = "M:" + uri.OriginalString; _addResourceCommand = new Commands.ResourceAddStream(uri, contentType, autoPlay); }
public Resource(float ease, TimeSpan duration) { _hashString = "A:" + ease.ToString() + ";" + duration.ToString(); _name = _hashString; _addResourceCommand = new Commands.ResourceAddAnimation(ease, duration); }
public Resource(string text, TextStyle style, Color color) { _hashString = "T:" + text + ";" + style.ToString() + ";" + GetColorString(color); _name = _hashString; _addResourceCommand = new Commands.ResourceAddText(text, style, color); }
public Resource(Color color) { _name = GetColorString(color); _hashString = "C:" + _name; _addResourceCommand = new Commands.ResourceAddColor(color); }
public Resource(TextStyle textStyle) { _name = textStyle.ToString(); _hashString = "F:" + _name; _addResourceCommand = new Commands.ResourceAddFont(textStyle); }
public Resource(Uri uri, string contentType, VideoStart state) { _name = uri.OriginalString; _hashString = "V:" + uri.OriginalString; _addResourceCommand = new Commands.ResourceAddStream(uri, contentType, state == VideoStart.AutoPlay); }