public override void ExtractData(string outputDirectory, CommonExtractionContext context, Dictionary<string, object> pluginSettings)
        {
            GlobalContext.Properties[Name] = Name + " Plugin";

            var settings = new NightWatchmanSettings(Path.Combine(context.PluginsDirectory, "SavingsAnalysis.Plugin.NightWatchman.xml"));
            if (!RunValidationQueries(settings, context))
            {
                return;
            }

            SqlQueryResultSerializer resultSerializer = new SqlQueryResultSerializer(queryExecutor, context.SccmConnection, outputDirectory);
            foreach (var query in settings.Queries)
            {
                var queryParameters = new[]
                        {
                            new SqlParameter("@startdate", SqlDbType.DateTime) { Value = context.StartDate },
                            new SqlParameter("@enddate", SqlDbType.DateTime) { Value = context.EndtDate }
                        };

                resultSerializer.SerializeQueryResult(query.SelectionQuery, query.Name, queryParameters, (msg) => NotifyProgress(
                            new ExtractionEventArgs()
                            {
                               Status = ExtractionStatus.Succeeded,
                               Message = msg
                            }));

                Log.Info("Successfully extracted data for " + query.Name);
            }

            if (settings.Queries.Count > 0)
            {
                NotifyProgress(
                    new ExtractionEventArgs()
                        {
                            Status = ExtractionStatus.Succeeded, Message = "All query results collected successfully." 
                        });
            }
        }
        public override void ExtractData(
            string outputDirectory, CommonExtractionContext context, Dictionary<string, object> pluginSettings)
        {
            var collectorQueries = new CollectorQueries();
            var collectionStatistics = new Dictionary<string, long>();
            var resultSerializer = new SqlQueryResultSerializer(
                this.queryExecutor, context.SccmConnection, outputDirectory);
            foreach (QuerySettings query in collectorQueries.Queries)
            {
                long numberOfRows = resultSerializer.SerializeQueryResult(
                    query.SelectionQuery, query.Name, null, (msg) => this.Notify(ExtractionStatus.Info, msg));
                collectionStatistics.Add(query.Name, numberOfRows);
            }

            if (collectorQueries.Queries.Count > 0)
            {
                this.Notify(ExtractionStatus.Succeeded, "All query results collected successfully.");
                foreach (var stats in collectionStatistics)
                {
                    this.Notify(ExtractionStatus.Info, string.Format("{0} {1} rows collected", stats.Key, stats.Value));
                }
            }
        }
        public override void ExtractData(string outputDirectory, CommonExtractionContext context, Dictionary<string, object> pluginSettings)
        {
            SqlQueryResultSerializer resultSerializer = new SqlQueryResultSerializer(queryExecutor,context.SccmConnection,outputDirectory);
            foreach (var query in SCCMQueries.Queries())
            {
               resultSerializer.SerializeQueryResult(query.SelectionQuery,query.Name,null,(msg)=> NotifyProgress(
                  new ExtractionEventArgs()
                     {
                        Status = ExtractionStatus.Succeeded,
                        Message = msg
                     }));
            }

           if (SCCMQueries.Queries().Count > 0)
            {
                NotifyProgress(
                    new ExtractionEventArgs()
                        {
                            Status = ExtractionStatus.Succeeded,
                            Message = "All query results collected successfully."
                        });
            }
        }