当前位置: 首页>>代码示例>>C#>>正文


C# IAssembly类代码示例

本文整理汇总了C#中IAssembly的典型用法代码示例。如果您正苦于以下问题:C# IAssembly类的具体用法?C# IAssembly怎么用?C# IAssembly使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IAssembly类属于命名空间,在下文中一共展示了IAssembly类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SimpleCompilation

		public SimpleCompilation(ISolutionSnapshot solutionSnapshot, IUnresolvedAssembly mainAssembly, IEnumerable<IAssemblyReference> assemblyReferences)
		{
			if (solutionSnapshot == null)
				throw new ArgumentNullException("solutionSnapshot");
			if (mainAssembly == null)
				throw new ArgumentNullException("mainAssembly");
			if (assemblyReferences == null)
				throw new ArgumentNullException("assemblyReferences");
			this.solutionSnapshot = solutionSnapshot;
			this.context = new SimpleTypeResolveContext(this);
			this.mainAssembly = mainAssembly.Resolve(context);
			List<IAssembly> assemblies = new List<IAssembly>();
			assemblies.Add(this.mainAssembly);
			List<IAssembly> referencedAssemblies = new List<IAssembly>();
			foreach (var asmRef in assemblyReferences) {
				IAssembly asm;
				try {
					asm = asmRef.Resolve(context);
				} catch (InvalidOperationException) {
					throw new InvalidOperationException("Tried to initialize compilation with an invalid assembly reference. (Forgot to load the assembly reference ? - see CecilLoader)");
				}
				if (asm != null && !assemblies.Contains(asm))
					assemblies.Add(asm);
				if (asm != null && !referencedAssemblies.Contains(asm))
					referencedAssemblies.Add(asm);
			}
			this.assemblies = assemblies.AsReadOnly();
			this.referencedAssemblies = referencedAssemblies.AsReadOnly();
			this.knownTypeCache = new KnownTypeCache(this);
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:30,代码来源:SimpleCompilation.cs

示例2: GetProjectInfo

		public NSObjectProjectInfo GetProjectInfo (DotNetProject project, IAssembly lookinAssembly = null)
		{
			var dom = TypeSystemService.GetProjectContentWrapper (project);
			project.ReferenceAddedToProject += HandleDomReferencesUpdated;
			project.ReferenceRemovedFromProject += HandleDomReferencesUpdated;
			return GetProjectInfo (dom, lookinAssembly);
		}
开发者ID:sparek,项目名称:monodevelop,代码行数:7,代码来源:NSObjectInfoService.cs

示例3: DerivedTypeInformation

    /// <summary>
    /// Initializes a new instance of the <see cref="DerivedTypeInformation"/> class.
    /// </summary>
    /// <param name="assemblyManager">The assembly manager.</param>
    /// <param name="visibility">The visibility.</param>
    public DerivedTypeInformation(IAssemblyManager assemblyManager, IVisibilityConfiguration visibility)
    {
      this.table = new Dictionary<ITypeReference, List<ITypeDeclaration>>();

      IAssembly[] assemblies = new IAssembly[assemblyManager.Assemblies.Count];
      assemblyManager.Assemblies.CopyTo(assemblies, 0);

      FastTypeEnumerator enumerator = new FastTypeEnumerator(assemblies);
      foreach (ITypeDeclaration typeDeclaration in enumerator.Types)
      {
        if (ReflectorHelper.IsVisible(typeDeclaration, visibility))
        {
          ITypeReference baseType = typeDeclaration.BaseType;
          if (baseType != null)
          {
            if (baseType.GenericType != null)
            {
              this.AddToTable(baseType.GenericType, typeDeclaration);
            }
            else
            {
              this.AddToTable(baseType, typeDeclaration);
            }
          }

          foreach (ITypeReference interfaceType in typeDeclaration.Interfaces)
          {
            this.AddToTable(interfaceType, typeDeclaration);
          }
        }
      }
    }
开发者ID:WrongDog,项目名称:Sequence,代码行数:37,代码来源:DerivedTypeInformation.cs

示例4: SimpleTypeResolveContext

		private SimpleTypeResolveContext(ICompilation compilation, IAssembly currentAssembly, ITypeDefinition currentTypeDefinition, IMember currentMember)
		{
			this.compilation = compilation;
			this.currentAssembly = currentAssembly;
			this.currentTypeDefinition = currentTypeDefinition;
			this.currentMember = currentMember;
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:7,代码来源:SimpleTypeResolveContext.cs

示例5: ApplyTo

		public override void ApplyTo(IAssembly assembly, IAttributeStore attributeStore, IErrorReporter errorReporter) {
			foreach (var t in assembly.GetAllTypeDefinitions()) {
				if (!attributeStore.AttributesFor(t).HasAttribute<DefaultMemberReflectabilityAttribute>()) {
					ApplyTo(t, attributeStore, errorReporter);
				}
			}
		}
开发者ID:ShuntaoChen,项目名称:SaltarelleCompiler,代码行数:7,代码来源:DefaultMemberReflectabilityAttribute.cs

示例6: BlobReader

		public BlobReader(byte[] buffer, IAssembly currentResolvedAssembly)
		{
			if (buffer == null)
				throw new ArgumentNullException("buffer");
			this.buffer = buffer;
			this.currentResolvedAssembly = currentResolvedAssembly;
		}
开发者ID:sphynx79,项目名称:dotfiles,代码行数:7,代码来源:BlobReader.cs

示例7: GetTestClasses

 public override List<ITestClass> GetTestClasses(IAssembly assembly, TestClassInstanceDictionary instances)
 {
     return new List<ITestClass>
     {
         _test
     };
 }
开发者ID:garyjohnson,项目名称:wpnest,代码行数:7,代码来源:RetryTestRunFilter.cs

示例8: ResolveNormal

		DnSpyFile ResolveNormal(IAssembly assembly, ModuleDef sourceModule, bool delayLoad) {
			var existingFile = fileList.FindAssembly(assembly);
			if (existingFile != null)
				return existingFile;

			var file = LookupFromSearchPaths(assembly, sourceModule, true);
			if (file != null)
				return fileList.AddFile(file, fileList.AssemblyLoadEnabled, delayLoad);

			if (fileList.UseGAC) {
				var gacFile = GacInterop.FindAssemblyInNetGac(assembly);
				if (gacFile != null)
					return fileList.GetOrCreate(gacFile, fileList.AssemblyLoadEnabled, true, delayLoad);
				foreach (var path in GacInfo.OtherGacPaths) {
					file = TryLoadFromDir(assembly, true, path);
					if (file != null)
						return fileList.AddFile(file, fileList.AssemblyLoadEnabled, delayLoad);
				}
			}

			file = LookupFromSearchPaths(assembly, sourceModule, false);
			if (file != null)
				return fileList.AddFile(file, fileList.AssemblyLoadEnabled, delayLoad);

			return null;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:26,代码来源:AssemblyResolver.cs

示例9: AssemblyManager

 /// <summary>
 /// Create a new assembly manager, takes in the harness, provider 
 /// reference and actual IAssembly object.
 /// </summary>
 /// <param name="runFilter">The test run filter object.</param>
 /// <param name="testHarness">Harness object.</param>
 /// <param name="provider">The unit test metadata provider.</param>
 /// <param name="testAssembly">The test assembly metadata object.</param>
 public AssemblyManager(TestRunFilter runFilter, UnitTestHarness testHarness, IUnitTestProvider provider, IAssembly testAssembly) : base(testHarness, provider)
 {
     _filter = runFilter;
     _assembly = testAssembly;
     _testClasses = new CompositeWorkItem();
     ClassInstances = new TestClassInstanceDictionary();
 }
开发者ID:modulexcite,项目名称:SilverlightToolkit,代码行数:15,代码来源:AssemblyManager.cs

示例10: GetReferences

        private AsmReference GetReferences(IAssembly currentAssembly, AsmReference referenceDictionary, uint currentRecursionLimit = uint.MaxValue)
        {
            Contract.Requires<ArgumentNullException>(currentAssembly != null);
            Contract.Requires<ArgumentNullException>(referenceDictionary != null);

            if (referenceDictionary.ContainsKey(currentAssembly))
            {
                return referenceDictionary;
            }

            if (currentRecursionLimit == 0)
            {
                return referenceDictionary;
            }

            referenceDictionary.Add(currentAssembly, currentAssembly.References);
            currentRecursionLimit--;
            foreach (var referencedAssembly in currentAssembly.References)
            {
                var assemblyReferences = GetReferences(referencedAssembly, referenceDictionary, currentRecursionLimit);
                referenceDictionary.Add(assemblyReferences);
            }

            return referenceDictionary;
        }
开发者ID:artur02,项目名称:Dependency,代码行数:25,代码来源:AsmReferenceWalker.cs

示例11: WindowsService

        private WindowsService(bool interactive, IServiceWrapper wrapper, ILogger logger,
            ICommandLineParser parser, IConsoleHarness console, IAssembly assembly, 
            ServiceAttributeReader reader, WindowsServiceManager manager, HostFactory hostFactory)
        {
            Logger = logger;
            _metadata = reader.GetMetadata(this);

            _interactive = interactive;
            _assembly = assembly;
            Console = console;
            _manager = manager;
            _manager.SetMetadata(_metadata);
            _hostFactory = hostFactory;

            CommandLineParser = parser
                .SetApplicationName(reader.GetAttribute(this).DisplayName)
                .SetDescription(reader.GetAttribute(this).Description)
                .AddOption("quiet", "q", "Enable quiet mode. Will display only errors on the console.",
                    noArgs => _metadata.Quiet = true)
                .AddOption("silent", "si", "Enable silent mode. Will display nothing (not even errors) on the console.",
                    noArgs => _metadata.Silent = true)
                .AddOption("logtoconsole", "l", "Instructs the installer/uninstaller to log the output to the console.",
                    noArgs => _manager.LogToConsole = true)
                .AddOption("debug", "d", "Pauses to attach a debugger.", noArgs => EnableDebugMode())
                .AddOption("uninstall", "u", "Uninstalls the service.", noArgs => _manager.Uninstall())
                .AddOption("install", "i", "Installs the service.", noArgs => _manager.Install())
                .AddOption("installandstart", "is", "Installs and then starts the service.",
                    noArgs => _manager.InstallAndStart())
                .AddOption("start", "s", "Starts the service.", noArgs => _manager.StartService())
                .AddOption("stop", "x", "Stops the service.", noArgs => _manager.StopService())
                .AddOption("status", "st", "Displays the status of the service.", noArgs => _manager.ShowStatus());

            Harness = wrapper.WrapService(this);
        }
开发者ID:LionFree,项目名称:Cush,代码行数:34,代码来源:WindowsService.cs

示例12: GetInstance

 internal static WindowsServiceManager GetInstance(
     IConsoleHarness harness,
     IAssembly assembly,
     ManagedInstallerProxy installerProxy)
 {
     return new Implementation(harness, assembly, installerProxy);
 }
开发者ID:LionFree,项目名称:Cush,代码行数:7,代码来源:WindowsServiceManager.cs

示例13: AssemblyDispatcher

 public AssemblyDispatcher(UnitTestHarness testHarness, IUnitTestProvider provider, 
     IAssembly testAssembly) : base(testHarness, provider)
 {
     _assembly = testAssembly;
     _testClasses = new TestWorkItemDispatcher();
     _classInstances = new TestClassInstanceCollection();
 }
开发者ID:dfr0,项目名称:moon,代码行数:7,代码来源:AssemblyDispatcher.cs

示例14: ConstructorCallWeave

 public ConstructorCallWeave(IAssembly parentAssembly, MethodDefinition parentMethod, Instruction newInstruction, MethodDefinition constructor)
 {
     _parentAssembly = parentAssembly;
       _parentMethod = parentMethod;
       _constructor = constructor;
       _newInstruction = newInstruction;
 }
开发者ID:benlovell,项目名称:machine,代码行数:7,代码来源:ConstructorCallWeave.cs

示例15: GetProject

 public IProject GetProject(IAssembly assembly)
 {
     if (assembly != null)
         return GetProject(assembly.UnresolvedAssembly as IProjectContent);
     else
         return null;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:SharpDevelopSolutionSnapshot.cs


注:本文中的IAssembly类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。