Пример #1
0
		public static ApplicationManifest TryCreate(Win32Resources resources, FilenameCreator filenameCreator) {
			if (resources == null)
				return null;

			var dir = resources.Find(new ResourceName(RT_MANIFEST));
			if (dir == null || dir.Directories.Count == 0)
				return null;
			dir = dir.Directories[0];
			if (dir.Data.Count == 0)
				return null;

			var data = dir.Data[0].Data.ReadAllBytes();
			return new ApplicationManifest(filenameCreator.CreateName("app.manifest"), data);
		}
Пример #2
0
		public static ApplicationIcon TryCreate(Win32Resources resources, string filenameNoExt, FilenameCreator filenameCreator) {
			if (resources == null)
				return null;

			var dir = resources.Find(new ResourceName(RT_GROUP_ICON));
			if (dir == null || dir.Directories.Count == 0)
				return null;
			dir = dir.Directories[0];
			if (dir.Data.Count == 0)
				return null;

			var iconDir = resources.Find(new ResourceName(RT_ICON));
			if (iconDir == null)
				return null;

			var iconData = TryCreateIcon(dir.Data[0].Data, iconDir);
			if (iconData == null)
				return null;

			return new ApplicationIcon(filenameCreator.CreateName(filenameNoExt + ".ico"), iconData);
		}
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="win32Resources">Win32 resources</param>
		public Win32ResourcesChunk(Win32Resources win32Resources) {
			this.win32Resources = win32Resources;
		}