Пример #1
0
        private void ImportDataCard(string datacardPath, string initializeString, TreeView treeView)
        {
            _treeView = treeView;

            Task.Run(() =>
            {
                _updateStatusAction(CurrentState, "Starting Import");

                ApplicationDataModels = _dataProvider.Import(datacardPath, initializeString);
                if (ApplicationDataModels == null || ApplicationDataModels.Count == 0)
                {
                    MessageBox.Show(@"Not supported data format.");
                    CurrentState = State.StateIdle;
                    _updateStatusAction(CurrentState, "Done");
                    return;
                }

                _admIndex = 0;
                for (; _admIndex < ApplicationDataModels.Count; _admIndex++)
                {
                    var applicationDataModel = ApplicationDataModels[_admIndex];

                    applicationDataModel.Documents.LoggedData.SelectMany(x => x.OperationData.ToList()).ToList();

                    var parentNode = (TreeNode)_treeView.Invoke(new Func <TreeNode>(() => treeView.Nodes.Add("ApplicationDataModel")));

                    AddNode(applicationDataModel, parentNode);
                }

                CurrentState = State.StateIdle;
                _updateStatusAction(CurrentState, "Done");
            });
        }
Пример #2
0
        private void ImportDataCard(string datacardPath, string initializeString, TreeView treeView)
        {
            ApplicationDataModels = _dataProvider.Import(datacardPath, initializeString);
            if (ApplicationDataModels == null || ApplicationDataModels.Count == 0)
            {
                MessageBox.Show(@"Not supported data format.");
                return;
            }

            _admIndex = 0;
            for (; _admIndex < ApplicationDataModels.Count; _admIndex++)
            {
                var applicationDataModel = ApplicationDataModels[_admIndex];
                var parentNode           = treeView.Nodes.Add("ApplicationDataModel");
                AddNode(applicationDataModel, parentNode);
            }
        }
Пример #3
0
        private void ImportDataCard(string datacardPath, string initializeString, TreeView treeView, ApplicationDataModel.ADM.Properties properties)
        {
            _treeView = treeView;

            Task.Run(() =>
            {
                DateTime start = DateTime.Now;  //170629 MSp

                _updateStatusAction(CurrentState, "Starting Import");

                ApplicationDataModels = _dataProvider.Import(datacardPath, initializeString, properties);
                if (ApplicationDataModels == null || ApplicationDataModels.Count == 0)
                {
                    MessageBox.Show(@"Not supported data format.");
                    CurrentState = State.StateIdle;
                    _updateStatusAction(CurrentState, "Done");
                    return;
                }

                _admIndex = 0;
                for (; _admIndex < ApplicationDataModels.Count; _admIndex++)
                {
                    var applicationDataModel = ApplicationDataModels[_admIndex];

                    applicationDataModel.Documents?.LoggedData.SelectMany(x => x.OperationData.ToList()).ToList();

                    var parentNode = (TreeNode)_treeView.Invoke(new Func <TreeNode>(() => treeView.Nodes.Add("ApplicationDataModel")));

                    AddNode(applicationDataModel, parentNode);
                }

                CurrentState = State.StateIdle;
                _updateStatusAction(CurrentState, "Done");

                //170629 MSp How long did it take to parse the data model into the tree?
                DateTime stop     = DateTime.Now;
                TimeSpan duration = new TimeSpan(stop.Ticks - start.Ticks);
                System.Diagnostics.Debug.Print($"ImportDataCard had a duration of {duration.Seconds:#,##0.0}.");
            });
        }