예제 #1
0
        private void publishMenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.projectFile))
            {
                MessageBox.Show("请先保存工程,然后再发布该应用到速学应用平台!", "记忆工具", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            try
            {
                string tempPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                tempPath = System.IO.Path.Combine(tempPath, "SlpTemp");
                if (!Directory.Exists(tempPath))
                {
                    Directory.CreateDirectory(tempPath);
                }
                string slpFile = System.IO.Path.Combine(tempPath, this.memorizeEntry.Id + ".slp");
                PackageCreator.CreateMrePackage(this.projectFile, slpFile);

                installToLocal();

                UploadAppWindow uploadAppWindow = new UploadAppWindow(slpFile);
                uploadAppWindow.ShowDialog();

                // Install to local
                //    MessageBox.Show("发布成功后,打开速学应用平台在相应的分类学可以使用自己的应用.", "记忆工具", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch
            {
                MessageBox.Show("发布应用失败,请稍后再试!", "记忆工具", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }