Ejemplo n.º 1
0
        public void ExtractPlugin(DirectoryInfo pluginsDirectory)
        {
            if (_model == null)
            {
                return;
            }

            _model.ExtractPlugin(pluginsDirectory);
            OnPropertyChanged("");
        }
        private void PluginList_OnDrop(object sender, DragEventArgs e)
        {
            var d = e.Data.GetFormats();

            if (!d.Contains("FileNameW"))
            {
                return;
            }
            var fnames = e.Data.GetData("FileNameW") as IEnumerable <string>;

            if (fnames == null)
            {
                return;
            }
            foreach (var fname in fnames)
            {
                try
                {
                    var fInfo = new FileInfo(fname);
                    if (fInfo.Extension != ".nupkg")
                    {
                        continue;
                    }
                    IPackage p  = new ZipPackage(fInfo.FullName);
                    var      pi = new PluginInformation(p);
                    pi.ExtractPlugin(
                        PluginManagement.GetPluginsDirectory()
                        );
                }
                catch (Exception ex)
                {
                    Log.Error($"Error processing package file [{fname}].", ex);
                }
            }
            RefreshPluginList();
        }
Ejemplo n.º 3
0
 public void ExtractPlugin(DirectoryInfo pluginsDirectory)
 {
     _model.ExtractPlugin(pluginsDirectory);
 }