oaassemblyreference.cs :  » Installers-Generators » WiX » Microsoft » VisualStudio » Package » Automation » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Installers Generators » WiX 
WiX » Microsoft » VisualStudio » Package » Automation » oaassemblyreference.cs
/***************************************************************************

Copyright (c) Microsoft Corporation. All rights reserved.
This code is licensed under the Visual Studio SDK license terms.
THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

***************************************************************************/
using System;
using System.Reflection;
using System.Runtime.InteropServices;

using Microsoft.VisualStudio.Package;
using VSLangProj;
using System.Text;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.VisualStudio.Package.Automation{
  [SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible")]
  [ComVisible(true)]
  public class OAAssemblyReference : OAReferenceBase<AssemblyReferenceNode>
  {
    public OAAssemblyReference(AssemblyReferenceNode assemblyReference) :
      base(assemblyReference)
    {
    }

    #region Reference override
    public override int BuildNumber
    {
      get
      {
        if ((null == BaseReferenceNode.ResolvedAssembly) ||
          (null == BaseReferenceNode.ResolvedAssembly.Version))
        {
          return 0;
        }
        return BaseReferenceNode.ResolvedAssembly.Version.Build;
      }
    }
    public override string Culture
    {
      get
      {
        if ((null == BaseReferenceNode.ResolvedAssembly) ||
          (null == BaseReferenceNode.ResolvedAssembly.CultureInfo))
        {
          return string.Empty;
        }
        return BaseReferenceNode.ResolvedAssembly.CultureInfo.Name;
      }
    }
    public override string Identity
    {
      get
      {
        // Note that in this function we use the assembly name instead of the resolved one
        // because the identity of this reference is the assembly name needed by the project,
        // not the specific instance found in this machine / environment.
        if (null == BaseReferenceNode.AssemblyName)
        {
          return null;
        }
        return BaseReferenceNode.AssemblyName.FullName;
      }
    }
    public override int MajorVersion
    {
      get
      {
        if ((null == BaseReferenceNode.ResolvedAssembly) ||
          (null == BaseReferenceNode.ResolvedAssembly.Version))
        {
          return 0;
        }
        return BaseReferenceNode.ResolvedAssembly.Version.Major;
      }
    }
    public override int MinorVersion
    {
      get
      {
        if ((null == BaseReferenceNode.ResolvedAssembly) ||
          (null == BaseReferenceNode.ResolvedAssembly.Version))
        {
          return 0;
        }
        return BaseReferenceNode.ResolvedAssembly.Version.Minor;
      }
    }

    public override string PublicKeyToken
    {
      get
      {
        if ((null == BaseReferenceNode.ResolvedAssembly) ||
        (null == BaseReferenceNode.ResolvedAssembly.GetPublicKeyToken()))
        {
          return null;
        }
        StringBuilder builder = new StringBuilder();
        byte[] publicKeyToken = BaseReferenceNode.ResolvedAssembly.GetPublicKeyToken();
        for (int i = 0; i < publicKeyToken.Length; i++)
        {
          builder.AppendFormat("{0:x}", publicKeyToken[i]);
        }
        return builder.ToString();
      }
    }

    public override string Name
    {
      get
      {
        if (null != BaseReferenceNode.ResolvedAssembly)
        {
          return BaseReferenceNode.ResolvedAssembly.Name;
        }
        if (null != BaseReferenceNode.AssemblyName)
        {
          return BaseReferenceNode.AssemblyName.Name;
        }
        return null;
      }
    }
    public override int RevisionNumber
    {
      get
      {
        if ((null == BaseReferenceNode.ResolvedAssembly) ||
          (null == BaseReferenceNode.ResolvedAssembly.Version))
        {
          return 0;
        }
        return BaseReferenceNode.ResolvedAssembly.Version.Revision;
      }
    }
    public override bool StrongName
    {
      get
      {
        if ((null == BaseReferenceNode.ResolvedAssembly) ||
          (0 == (BaseReferenceNode.ResolvedAssembly.Flags & AssemblyNameFlags.PublicKey)))
        {
          return false;
        }
        return true;
      }
    }
    public override prjReferenceType Type
    {
      get
      {
        return prjReferenceType.prjReferenceTypeAssembly;
      }
    }
    public override string Version
    {
      get
      {
        if ((null == BaseReferenceNode.ResolvedAssembly) ||
          (null == BaseReferenceNode.ResolvedAssembly.Version))
        {
          return string.Empty;
        }
        return BaseReferenceNode.ResolvedAssembly.Version.ToString();
      }
    }
    #endregion
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.