internal static void DownloadExpansion(Expansion expansion)
        {
            List<Expansion> expansions;
            if (!downloadingExpansions.TryGetValue(expansion.Id, out expansions))
            {
                expansions = new List<Expansion>();
                downloadingExpansions[expansion.Id] = expansions;
            }

            expansions.Add(expansion);

            Plugin.DownloadExpansion(expansion);
        }
 public static bool DeleteExpansion(Expansion expansion)
 {
     return Plugin.DeleteExpansion(expansion);
 }
 internal static void RaiseExpansionsToUpdate(Expansion[] expansions)
 {
     if (OnExpansionsToUpdate != null)
     {
         OnExpansionsToUpdate(expansions);
     }
 }
 internal static void RaiseServerExpansions(Expansion[] expansions)
 {
     if (OnServerExpansions != null)
     {
         OnServerExpansions(expansions);
     }
 }
 internal static void RaiseExpansion(Expansion expansion)
 {
     if (OnExpansion != null)
     {
         OnExpansion(expansion);
     }
 }
Ejemplo n.º 6
0
    private void ShowExpansions(string tag, Expansion[] expansions)
    {
        if (expansions == null)
        {
            SetStatus("No expansions");
        }

        var names = string.Join(", ", (from e in expansions
            select string.Format("{0}(id={1} v={2}]", e.Name, e.Id, e.Version)).ToArray());
        SetStatus(string.Format("{0} {1} expansions: {2}", expansions.Length, tag, names));
    }
Ejemplo n.º 7
0
    private void OnExpansionDownloaded(bool success)
    {
        SetStatus("Expansion downloaded: " + success);

        downloadingExpansion.IsDownloaded = success;
        downloadingExpansion.OnProgress -= OnExpansionProgress;
        downloadingExpansion.OnDownloaded -= OnExpansionDownloaded;
        downloadingExpansion = null;
    }
Ejemplo n.º 8
0
 private void DownloadFirstServerExpansionWithProgress()
 {
     if (serverExpansions != null && serverExpansions.Length > 0)
     {
         if (downloadingExpansion != null)
         {
             SetStatus("Another expansion is downloading. Please wait");
         }
         else
         {
             downloadingExpansion = serverExpansions.FirstOrDefault(e => !e.IsDownloaded);
             if (downloadingExpansion == null)
             {
                 SetStatus("All server expansions downloaded");
             }
             else
             {
                 SetStatus("Downloading started...");
                 downloadingExpansion.OnDownloaded += OnExpansionDownloaded;
                 downloadingExpansion.OnProgress += OnExpansionProgress;
                 downloadingExpansion.Download();
             }
         }
     }
     else
     {
         SetStatus("No available server expansions. Try to get server expansions.");
     }
 }
Ejemplo n.º 9
0
 public Usage(Expansion expansion)
 {
     Expansion = expansion;
 }