Exemplo n.º 1
0
        /// <summary>
        /// A coroutine which returns the json returned by the Github Api about the given plugin as a useable object
        /// </summary>
        /// <param name="interop"></param>
        /// <param name="plugin"></param>
        /// <param name="method"></param>
        /// <returns></returns>
        public static IEnumerator GetGithubJson(VcInterop interop, IGithubInfoPlugin plugin, Action <GithubReleasePage> method)
        {
            yield return(interop.StartCoroutine(interop.GithubInterop(plugin.Author, plugin.GithubProjName)));

            var page = interop.CoroutineResults.FirstOrDefault(o =>
                                                               o.Author == plugin.Author && o.ProjName == plugin.GithubProjName).Page;

            //Logger.Log($"Pages is Null? {page == null}");
            method.Invoke(page);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Created a base oject then calls the GetGithubJson coroutine using the VCInterop,
 /// calls the LatestPluginInfoEvent once the data has been retrieved
 /// </summary>
 /// <param name="plugin"></param>
 /// <param name="interop"></param>
 /// <param name="vCheck"></param>
 public LatestPluginInfo(IGithubInfoPlugin plugin, VcInterop interop, LatestPluginInfoEvent vCheck)
 {
     Plugin            = plugin;
     IsLatestVersion   = false;
     HasVersionBeenSet = false;
     _ue           = vCheck;
     LatestVersion = string.Empty;
     ReleasePage   = null;
     interop.StartCoroutine(Util.GetGithubJson(interop, Plugin,
                                               SetLatestVersion)); //starts a coroutine to retrieve the latest plugin version
 }