Ejemplo n.º 1
0
        private void LoadProperties()
        {
            try
            {
                var analyser = new CollectionPropertyAnalyser(
                    MongoUtilities.Create(_connection),
                    _database,
                    _collectionName);

                var props = analyser.GetAllProperties();

                _mainWindow.Dispatcher.Invoke(new Action(() => PopulateList(props)));
            }
            catch (Exception ex)
            {
                Utilities.LogException(ex);
            }
        }
Ejemplo n.º 2
0
        private void ScanCollectionForProperties()
        {
            try
            {
                var analyser = new CollectionPropertyAnalyser(
                    MongoUtilities.Create(_cnn),
                    _databaseName,
                    _collectionName);

                _sortFieldsTemp.Clear();

                var allProperties = analyser.GetAllProperties();
                _sortFieldsTemp.AddRange(allProperties.Select(item => item.FullName).ToList());
                allProperties.ToList().ForEach(item =>
                    {
                        if (!_sortFieldsInfo.ContainsKey(item.FullName))
                        {
                            _sortFieldsInfo.Add(item.FullName, item.Type);
                        }
                    });

                _control.Dispatcher.Invoke(new Action(() => ShowScanResults()));
            }
            catch (Exception ex)
            {
                Utilities.LogException(ex);
            }
        }