Exemple #1
0
 public ProviderInfo()
 {
     currentStatues      = ZBaseEnum.Status.none;
     providerName        = displayProviderName = string.Empty;
     source              = ZBaseEnum.Source.registry;
     downloadURL         = string.Empty;
     currentUnityVersion = "none";
 }
Exemple #2
0
 public ProviderModel()
 {
     currentStatues      = ZBaseEnum.Status.none;
     providerName        = displayProviderName = string.Empty;
     source              = ZBaseEnum.Source.registry;
     downloadURL         = string.Empty;
     currentUnityVersion = "none";
     dependencies        = new Dictionary <string, string>();
 }
Exemple #3
0
 public ProviderInfo(string providerName, string displayName, string currVer, string lastVer, ZBaseEnum.Status currStatus, ZBaseEnum.Source source, string urlDownload = "")
 {
     this.providerName        = providerName;
     this.displayProviderName = displayName;
     this.currentStatues      = currStatus;
     this.currentUnityVersion = currVer;
     this.latestUnityVersion  = lastVer;
     this.source      = source;
     this.downloadURL = urlDownload;
 }
Exemple #4
0
    public bool GetFromJson(string name, Dictionary <string, object> dic)
    {
        providerName = name;
        object obj;

        //source
        dic.TryGetValue("source", out obj);
        if (obj != null)
        {
            ZBaseEnum.Source result;
            if (Enum.TryParse(obj as string, out result))
            {
                this.source = result;
            }
        }
        //display name
        if (ZBasePackageIdConfig.listPackages.ContainsKey(name))
        {
            this.displayProviderName = ZBasePackageIdConfig.listPackages[name];
        }
        //version, url
        dic.TryGetValue("version", out obj);
        if (obj != null)
        {
            if (this.source == ZBaseEnum.Source.registry)
            {
                this.currentUnityVersion = this.latestUnityVersion = obj as string;
            }
            else if (this.source == ZBaseEnum.Source.git)
            {
                string   objString = obj as string;
                string[] arrString = objString.Split('#'); // url = urlGit + # + version
                if (arrString.Length >= 2)
                {
                    this.downloadURL         = arrString[0];
                    this.currentUnityVersion = this.latestUnityVersion = arrString[1];
                }
            }
        }
        //hash
        dic.TryGetValue("hash", out obj);
        if (obj != null)
        {
            this.hash = obj as string;
            this.hash = this.hash.Remove(10);
        }

        return(true);
    }