Esempio n. 1
0
        //Upload the plugin
        private void BT_Upload_Click(object sender, RoutedEventArgs e)
        {
            if (installer == null)
            {
                return;
            }

            LocalZipFile = this.TB_ZipFile.Text;

            if (!File.Exists(LocalZipFile))
            {
                return;
            }

            if (string.IsNullOrEmpty(this.TB_Version.Text))
            {
                System.Windows.Forms.MessageBox.Show("Entrer tout les champs !", "Agenda-Virtuel", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            string pluginUrl = LocalZipFile.SplitAndGetLastPart(@"\").Replace(" ", "");

            StoreItem = new PluginStoreItem(installer.ThePlugin.name, this.TB_Description.Text, pluginUrl, userAccount, userAccount, true, this.TB_Version.Text);

            switch (mode)
            {
            case UploadMode.Normal:
                PluginStoreManager.InsertPlugin(StoreItem, LocalZipFile);
                break;
            }

            this.DialogResult = true;
            this.Close();
        }
        //Display all plugins of the store
        private async void BT_DisplayAll_Click(object sender, RoutedEventArgs e)
        {
            HighlightButton(this.BT_DisplayAll);

            await PluginStoreManager.LoadAllStoreAsync();

            DisplayPlugins();
        }
 //Display all plugins of the store
 private void DisplayPlugins()
 {
     PluginStoreManager.installedPlugins = PluginStoreManager.GetInstalledPlugins();
     this.SP_PluginItems.Children.Clear();
     foreach (PluginStoreItem i in PluginStoreManager.Plugins)
     {
         this.SP_PluginItems.Children.Add(new PStoreItemViewer(i));
     }
 }
        //Load
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            HighlightButton(this.BT_DisplayAll);

            await PluginStoreManager.LoadAllStoreAsync();

            DisplayPlugins();

            await TryToConnectAsync();
        }
        //Display plugins of the user
        private void BT_DisplayUserPlugin_Click(object sender, RoutedEventArgs e)
        {
            if (connected)
            {
                HighlightButton((Button)sender);

                this.SP_PluginItems.Children.Clear();
                PluginStoreManager.GetUserPlugins(PluginStoreManager.UserName).ForEach((x) =>
                {
                    this.SP_PluginItems.Children.Add(new PStoreItemViewer(x, PStoreItemViewer.PStoreItemMode.MyUploadedPlugins));
                });
            }
        }