Beispiel #1
0
        void CreateEmptyAppXamlFile()
        {
            if (!hasXamlClasses || !(appTypeProjFile is null))
            {
                return;
            }
            if ((Options.Module.Characteristics & Characteristics.Dll) != 0)
            {
                return;
            }

            var file = Files.OfType <TypeProjectFile>().Where(a => DotNetUtils.IsSystemWindowsApplication(a.Type)).FirstOrDefault();

            Debug.Assert(!(file is null));
            if (file is null)
            {
                return;
            }
            Debug.Assert(file.DependentUpon is null);
            if (!(file.DependentUpon is null))
            {
                return;
            }

            Files.Remove(file);

            var filename = file.Filename;
            var name     = Path.GetFileNameWithoutExtension(file.Filename);

            filename = Path.Combine(Path.GetDirectoryName(filename), name + ".xaml");

            var newFile = new XamlTypeProjectFile(file.Type, filename + Options.Decompiler.FileExtension, Options.DecompilationContext, Options.Decompiler, createDecompilerOutput);

            Files.Add(newFile);
            var bamlFile = new AppBamlResourceProjectFile(filename, file.Type, Options.Decompiler);

            newFile.DependentUpon = bamlFile;
            Files.Add(bamlFile);
        }
Beispiel #2
0
		void CreateEmptyAppXamlFile() {
			if (!hasXamlClasses || appTypeProjFile != null)
				return;
			if ((Options.Module.Characteristics & Characteristics.Dll) != 0)
				return;

			var file = Files.OfType<TypeProjectFile>().Where(a => DotNetUtils.IsSystemWindowsApplication(a.Type)).FirstOrDefault();
			Debug.Assert(file != null);
			if (file == null)
				return;
			Debug.Assert(file.DependentUpon == null);
			if (file.DependentUpon != null)
				return;

			Files.Remove(file);

			var filename = file.Filename;
			var name = Path.GetFileNameWithoutExtension(file.Filename);
			filename = Path.Combine(Path.GetDirectoryName(filename), name + ".xaml");

			var newFile = new XamlTypeProjectFile(file.Type, filename + Options.Decompiler.FileExtension, Options.DecompilationContext, Options.Decompiler, createDecompilerOutput);
			Files.Add(newFile);
			var bamlFile = new AppBamlResourceProjectFile(filename, file.Type, Options.Decompiler);
			newFile.DependentUpon = bamlFile;
			Files.Add(bamlFile);
		}