Beispiel #1
0
        public void Export(string pluginName, string initializeString, string exportPath, string cardProfileSelectedText)
        {
            try
            {
                var plugin = _dataProvider.GetPlugin(pluginName);

                if (ApplicationDataModels == null || ApplicationDataModels.Count == 0 || plugin == null)
                {
                    MessageBox.Show(@"Could not export, either not a comptable plugin or no data model to export");
                    return;
                }

                Task.Run(() =>
                {
                    CurrentState = State.StateExporting;
                    _updateStatusAction(CurrentState, "Export in Progress");

                    var selectApplicationDataModel =
                        ApplicationDataModels.First(
                            x => x.Catalog.Description.ToLower().Equals(cardProfileSelectedText.ToLower()));
                    DataProvider.Export(plugin, selectApplicationDataModel, initializeString,
                                        GetExportDirectory(exportPath));

                    CurrentState = State.StateIdle;
                    _updateStatusAction(CurrentState, "Done");
                });
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Beispiel #2
0
        public void Export(string pluginName, string initializeString, string exportPath)
        {
            try
            {
                var plugin = _dataProvider.GetPlugin(pluginName);

                if (ApplicationDataModels == null || ApplicationDataModels.Count == 0 || plugin == null)
                {
                    MessageBox.Show(@"Could not export, either not a comptable plugin or no data model to export");
                    return;
                }

                foreach (var applicationDataModel in ApplicationDataModels)
                {
                    DataProvider.Export(plugin, applicationDataModel, initializeString, GetExportDirectory(exportPath));
                }

                MessageBox.Show(@"Data exported successfully.");
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }