Mono.Addins.RuntimeAddin.GetResource C# (CSharp) Méthode

GetResource() public méthode

Gets the content of a resource
The add-in engine will look for resources in the main add-in assembly and in all included add-in assemblies.
public GetResource ( string resourceName ) : Stream
resourceName string /// Name of the resource ///
Résultat Stream
        public Stream GetResource(string resourceName)
        {
            return GetResource (resourceName, false);
        }

Same methods

RuntimeAddin::GetResource ( string resourceName, bool throwIfNotFound ) : Stream

Usage Example

Exemple #1
0
		static string InternalGetStockIdFromResource (RuntimeAddin addin, string id, Gtk.IconSize size)
		{
			if (!id.StartsWith ("res:", StringComparison.Ordinal))
				return id;

			id = id.Substring (4);
			int addinId = GetAddinId (addin);
			Dictionary<string, string> hash = addinIcons[addinId];
			string stockId = "__asm" + addinId + "__" + id + "__" + size;
			if (!hash.ContainsKey (stockId)) {
				System.IO.Stream stream = addin.GetResource (id);
				if (stream != null) {
					Gdk.Pixbuf pix1, pix2 = null;
					using (stream) {
						pix1 = new Gdk.Pixbuf (stream);
					}
					stream = addin.GetResource2x (id);
					if (stream != null) {
						using (stream) {
							pix2 = new Gdk.Pixbuf (stream);
						}
					}
					AddToIconFactory (stockId, pix1, pix2, size);
				}
				hash[stockId] = stockId;
			}
			return stockId;
		}
All Usage Examples Of Mono.Addins.RuntimeAddin::GetResource