Exemplo n.º 1
0
        internal PackageInfo(
            string packageId,
            string displayName         = "",
            string category            = "",
            string description         = "",
            string resolvedPath        = "",
            string tag                 = "",
            PackageStatus status       = PackageStatus.Unavailable,
            IEnumerable <Error> errors = null,
            VersionsInfo versions      = null,
            PackageSource source       = PackageSource.Registry,
            string version             = "")
        {
            // Set the default values
            m_Source       = source;
            m_PackageId    = packageId;
            m_DisplayName  = displayName;
            m_Category     = category;
            m_Description  = description;
            m_ResolvedPath = resolvedPath;
            m_Status       = status;
            m_Errors       = (errors ?? new Error[] {}).ToArray();
            m_Versions     = versions ?? new VersionsInfo(null, null, null);

            // Populate name and version
            var nameAndVersion = packageId.Split('@');

            m_Name    = nameAndVersion[0];
            m_Version = !string.IsNullOrEmpty(version) ? version : nameAndVersion[1];
        }
Exemplo n.º 2
0
 internal PackageInfo(string packageId, string displayName = "", string category = "", string description = "", string resolvedPath = "", string tag = "", PackageStatus status = PackageStatus.Unavailable, IEnumerable <Error> errors = null, VersionsInfo versions = null)
 {
     this.m_OriginType   = OriginType.Unknown;
     this.m_PackageId    = packageId;
     this.m_DisplayName  = displayName;
     this.m_Category     = category;
     this.m_Description  = description;
     this.m_ResolvedPath = resolvedPath;
     this.m_Status       = status;
     this.m_Errors       = (errors ?? new Error[0]).ToArray <Error>();
     this.m_Versions     = (versions ?? new VersionsInfo(null, null, null));
     string[] array = packageId.Split(new char[]
     {
         '@'
     });
     this.m_Name    = array[0];
     this.m_Version = array[1];
 }