Esempio n. 1
0
        void DecompilePartial(DecompilePartialType info)
        {
            var builder = CreateAstBuilder(info.Context, CreateDecompilerSettings(langSettings.Settings, info.UseUsingDeclarations), currentType: info.Type);

            builder.AddType(info.Type);
            RunTransformsAndGenerateCode(builder, info.Output, info.Context, new DecompilePartialTransform(info.Type, info.Definitions, info.ShowDefinitions, info.AddPartialKeyword, info.InterfacesToRemove));
        }
Esempio n. 2
0
		protected override void Decompile(DecompileContext ctx, IDecompilerOutput output) {
			var opts = new DecompilePartialType(output, decompilationContext, Type);
			foreach (var d in GetDefsToRemove())
				opts.Definitions.Add(d);
			opts.InterfacesToRemove.Add(new TypeRefUser(Type.Module, "System.Windows.Markup", "IComponentConnector", new AssemblyNameInfo("WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35").ToAssemblyRef()));
			opts.InterfacesToRemove.Add(new TypeRefUser(Type.Module, "System.Windows.Markup", "IComponentConnector", new AssemblyNameInfo("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089").ToAssemblyRef()));
			decompiler.Decompile(DecompilationType.PartialType, opts);
		}
        protected override void Decompile(DecompileContext ctx, IDecompilerOutput output)
        {
            var opts = new DecompilePartialType(output, decompilationContext, Type);

            foreach (var d in GetDefsToRemove())
            {
                opts.Definitions.Add(d);
            }
            decompiler.Decompile(DecompilationType.PartialType, opts);
        }
Esempio n. 4
0
		protected override void Decompile(DecompileContext ctx, IDecompilerOutput output) {
			if (!decompiler.CanDecompile(DecompilationType.PartialType))
				base.Decompile(ctx, output);
			else {
				var opts = new DecompilePartialType(output, decompilationContext, Type);
				foreach (var d in GetDefsToRemove())
					opts.Definitions.Add(d);
				decompiler.Decompile(DecompilationType.PartialType, opts);
			}
		}
Esempio n. 5
0
        void DecompilePartial(DecompilePartialType info)
        {
            var state = CreateAstBuilder(info.Context, CSharpDecompiler.CreateDecompilerSettings(langSettings.Settings, info.UseUsingDeclarations), currentType: info.Type);

            try {
                state.AstBuilder.AddType(info.Type);
                RunTransformsAndGenerateCode(ref state, info.Output, info.Context, new DecompilePartialTransform(info.Type, info.Definitions, info.ShowDefinitions, info.AddPartialKeyword, info.InterfacesToRemove));
            }
            finally {
                state.Dispose();
            }
        }
Esempio n. 6
0
        protected override void Decompile(DecompileContext ctx, IDecompilerOutput output)
        {
            var opts = new DecompilePartialType(output, decompilationContext, Type);

            foreach (var d in GetDefsToRemove())
            {
                opts.Definitions.Add(d);
            }
            opts.InterfacesToRemove.Add(new TypeRefUser(Type.Module, "System.Windows.Markup", "IComponentConnector", new AssemblyNameInfo("WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35").ToAssemblyRef()));
            opts.InterfacesToRemove.Add(new TypeRefUser(Type.Module, "System.Windows.Markup", "IComponentConnector", new AssemblyNameInfo("System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089").ToAssemblyRef()));
            decompiler.Decompile(DecompilationType.PartialType, opts);
        }
Esempio n. 7
0
 protected override void Decompile(DecompileContext ctx, IDecompilerOutput output)
 {
     if (!language.CanDecompile(DecompilationType.PartialType))
     {
         base.Decompile(ctx, output);
     }
     else
     {
         var opts = new DecompilePartialType(output, decompilationContext, Type);
         foreach (var d in GetDefsToRemove())
         {
             opts.Definitions.Add(d);
         }
         language.Decompile(DecompilationType.PartialType, opts);
     }
 }
 public override void Create(DecompileContext ctx)
 {
     using (var writer = new StreamWriter(Filename, false, Encoding.UTF8)) {
         if (typeFile.Decompiler.CanDecompile(DecompilationType.PartialType))
         {
             var output = createDecompilerOutput(writer);
             var opts   = new DecompilePartialType(output, typeFile.DecompilationContext, typeFile.Type);
             foreach (var d in typeFile.GetDefsToRemove())
             {
                 opts.Definitions.Add(d);
             }
             opts.ShowDefinitions = true;
             typeFile.Decompiler.Decompile(DecompilationType.PartialType, opts);
         }
     }
 }
Esempio n. 9
0
 public override void Create(DecompileContext ctx)
 {
     using (var writer = new StreamWriter(Filename, false, Encoding.UTF8)) {
         if (winFormsFile.Language.CanDecompile(DecompilationType.PartialType))
         {
             var output = new PlainTextOutput(writer);
             var opts   = new DecompilePartialType(winFormsFile.Type, output, winFormsFile.DecompilationContext);
             foreach (var d in winFormsFile.GetDefsToRemove())
             {
                 opts.Definitions.Add(d);
             }
             opts.ShowDefinitions      = true;
             opts.UseUsingDeclarations = false;
             winFormsFile.Language.Decompile(DecompilationType.PartialType, opts);
         }
     }
 }
Esempio n. 10
0
		public override void Create(DecompileContext ctx) {
			using (var writer = new StreamWriter(Filename, false, Encoding.UTF8)) {
				if (winFormsFile.Decompiler.CanDecompile(DecompilationType.PartialType)) {
					var output = createDecompilerOutput(writer);
					var opts = new DecompilePartialType(output, winFormsFile.DecompilationContext, winFormsFile.Type);
					foreach (var d in winFormsFile.GetDefsToRemove())
						opts.Definitions.Add(d);
					opts.ShowDefinitions = true;
					opts.UseUsingDeclarations = false;
					winFormsFile.Decompiler.Decompile(DecompilationType.PartialType, opts);
				}
			}
		}
Esempio n. 11
0
		void DecompilePartial(DecompilePartialType info) {
			var state = CreateAstBuilder(info.Context, CreateDecompilerSettings(langSettings.Settings, info.UseUsingDeclarations), currentType: info.Type);
			try {
				state.AstBuilder.AddType(info.Type);
				RunTransformsAndGenerateCode(ref state, info.Output, info.Context, new DecompilePartialTransform(info.Type, info.Definitions, info.ShowDefinitions, info.AddPartialKeyword, info.InterfacesToRemove));
			}
			finally {
				state.Dispose();
			}
		}