public static MightyDownloadDocWindow Open(WindowState state, MightyDocVersion docVersion) { var window = GetWindow <MightyDownloadDocWindow>(); window.m_windowState = state; window.m_docVersion = docVersion; window.Show(); return(window); }
private static void DownloadDocAtPath(string path, MightyDocVersion docVersion) { using (var client = new MightyWebClient()) { client.Path = path; client.DocVersion = docVersion; client.DownloadFileCompleted += OnDownloadDocCompleted; client.DownloadProgressChanged += OnDownloadProgressChanged; client.DownloadFileAsync(new Uri(docVersion.docURL), path); DownloadingWindowUtilities.Open(); } }
public static void DownloadDocFromVersion(MightyDocVersion docVersion) { if (!docVersion.isValid) { return; } var path = OpenSavePanel(); if (!string.IsNullOrWhiteSpace(path)) { DownloadDocAtPath(path, docVersion); } }