Ejemplo n.º 1
0
        protected override object[] GetRunnables()
        {
            lock (_oLock)
                ExtractCommands.Clear();

            var commands = new List <IExtractCommand>();

            //if we are extracting globals
            if (_options.ExtractGlobals)
            {
                var g       = _configuration.GetGlobals();
                var globals = new GlobalsBundle(g.OfType <SupportingDocument>().ToArray(), g.OfType <SupportingSQLTable>().ToArray());
                _globalsCommand = new ExtractGlobalsCommand(RepositoryLocator, _project, _configuration, globals);
                commands.Add(_globalsCommand);
            }

            var factory = new ExtractCommandCollectionFactory();

            foreach (ISelectedDataSets sds in GetSelectedDataSets())
            {
                var extractDatasetCommand = factory.Create(RepositoryLocator, sds);
                commands.Add(extractDatasetCommand);

                lock (_oLock)
                    ExtractCommands.Add(sds, extractDatasetCommand);
            }

            return(commands.ToArray());
        }
Ejemplo n.º 2
0
        public GlobalsBundle GetGlobalsBundle()
        {
            //get the checked globals
            var docs = Categories[ExtractionDirectory.GLOBALS_DATA_NAME].OfType <SupportingDocument>().Where(g => tlvDatasets.CheckedObjects.Contains(g)).ToArray();

            //and the checked global supporting sql
            var sqls = Categories[ExtractionDirectory.GLOBALS_DATA_NAME].OfType <SupportingSQLTable>().Where(g => tlvDatasets.CheckedObjects.Contains(g)).ToArray();

            //record it so we can decide what icon to use
            _lastDispatchedGlobalsBundle = new GlobalsBundle(docs, sqls);
            return(_lastDispatchedGlobalsBundle);
        }
Ejemplo n.º 3
0
        public void SaveState(GlobalsBundle globals)
        {
            foreach (var gkvp in globals.States)
            {
                if (!GlobalsStates.ContainsKey(gkvp.Key))
                {
                    GlobalsStates.Add(gkvp.Key, gkvp.Value);
                }

                GlobalsStates[gkvp.Key] = gkvp.Value;
            }
        }
Ejemplo n.º 4
0
 public IEnumerable <object> GetAllChangedObjects(GlobalsBundle globals)
 {
     foreach (var gkvp in globals.States)
     {
         if (!GlobalsStates.ContainsKey(gkvp.Key))
         {
             GlobalsStates.Add(gkvp.Key, gkvp.Value);
             yield return(gkvp.Key);//new objects also are returned as changed
         }
         else
         //State has changed since last save
         if (GlobalsStates[gkvp.Key] != gkvp.Value)
         {
             yield return(gkvp.Key);
         }
     }
 }
Ejemplo n.º 5
0
        public ExtractGlobalsCommand(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IProject project, ExtractionConfiguration configuration, GlobalsBundle globals) : base(configuration)
        {
            this.RepositoryLocator = repositoryLocator;
            this.project           = project;
            this.Globals           = globals;

            ExtractionResults = new List <IExtractionResults>();
        }