Пример #1
0
        private IDecorationConditionArgs BuildServiceRunning(ServiceRunningConditionXml serviceRunning)
        {
            var scalarHelper = new ScalarHelper(serviceLocator, new Context(variables));

            return(new RunningArgs(
                       scalarHelper.InstantiateResolver <string>(serviceRunning.ServiceName)
                       , scalarHelper.InstantiateResolver <int>(serviceRunning.TimeOut)
                       ));
        }
Пример #2
0
        private IDecorationConditionArgs BuildCustomCondition(CustomConditionXml custom)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));

            return(new CustomConditionArgs(
                       helper.InstantiateResolver <string>(custom.AssemblyPath),
                       helper.InstantiateResolver <string>(custom.TypeName),
                       custom.Parameters.ToDictionary(x => x.Name, y => helper.InstantiateResolver <object>(y.StringValue) as IScalarResolver)
                       ));
        }
Пример #3
0
        private IKillCommandArgs BuildProcessKill(ExeKillXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                ProcessName = helper.InstantiateResolver <string>(xml.ProcessName),
            };

            return(args.ActLike <IKillCommandArgs>());
        }
Пример #4
0
        private IWaitCommandArgs BuildProcessWait(WaitXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                MilliSeconds = helper.InstantiateResolver <int>(xml.MilliSeconds),
            };

            return(args.ActLike <IWaitCommandArgs>());
        }
Пример #5
0
        private IDecorationConditionArgs BuildFolderExists(FolderExistsConditionXml folderExists)
        {
            var scalarHelper = new ScalarHelper(serviceLocator, new Context(variables));

            return(new FolderExistsConditionArgs(
                       serviceLocator.BasePath
                       , scalarHelper.InstantiateResolver <string>(folderExists.Path)
                       , scalarHelper.InstantiateResolver <string>(folderExists.Name)
                       , scalarHelper.InstantiateResolver <bool>(folderExists.NotEmpty)
                       ));
        }
Пример #6
0
        private IStopCommandArgs BuildProcessStop(ServiceStopXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                ServiceName = helper.InstantiateResolver <string>(xml.ServiceName),
                TimeOut     = helper.InstantiateResolver <int>(xml.TimeOut),
            };

            return(args.ActLike <IStopCommandArgs>());
        }
Пример #7
0
        private IResetCommandArgs BuildDataEngineeringTableReset(TableResetXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                TableName = helper.InstantiateResolver <string>(xml.TableName),
                xml.ConnectionString
            };

            return(args.ActLike <IResetCommandArgs>());
        }
Пример #8
0
        private IConnectionWaitCommandArgs BuildDataEngineeringConnectionWait(ConnectionWaitXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                xml.ConnectionString,
                Version = helper.InstantiateResolver <int>(xml.TimeOut),
            };

            return(args.ActLike <IConnectionWaitCommandArgs>());
        }
Пример #9
0
        private ICustomCommandArgs BuildProcessCustom(CustomCommandXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                AssemblyPath = helper.InstantiateResolver <string>(xml.AssemblyPath),
                TypeName     = helper.InstantiateResolver <string>(xml.TypeName),
                Parameters   = xml.Parameters.ToDictionary(x => x.Name, y => helper.InstantiateResolver <object>(y.StringValue)),
            };

            return(args.ActLike <ICustomCommandArgs>());
        }
Пример #10
0
        private IDeleteExtensionCommandArgs BuildIoDeleteExtension(FileDeleteExtensionXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                Path      = helper.InstantiateResolver <string>(xml.Path),
                Extension = helper.InstantiateResolver <string>(xml.Extension),
                xml.Settings?.BasePath
            };

            return(args.ActLike <IDeleteExtensionCommandArgs>());
        }
Пример #11
0
        private IEtlRunCommandArgs BuildDataEngineeringEtlRun(EtlRunXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                Name    = helper.InstantiateResolver <string>(xml.Name),
                Path    = helper.InstantiateResolver <string>(xml.Path),
                Version = helper.InstantiateResolver <string>(xml.Version),
            };

            return(args.ActLike <IEtlRunCommandArgs>());
        }
Пример #12
0
        private ICopyPatternCommandArgs BuildIoCopyPattern(FileCopyPatternXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                SourcePath      = helper.InstantiateResolver <string>(xml.SourcePath),
                DestinationPath = helper.InstantiateResolver <string>(xml.DestinationPath),
                Pattern         = helper.InstantiateResolver <string>(xml.Pattern),
                xml.Settings?.BasePath
            };

            return(args.ActLike <ICopyPatternCommandArgs>());
        }
Пример #13
0
        private ISequenceResolverArgs BuildSentinelLoopResolverArgs <T, U>(string seed, string terminal, string step, IntervalMode intervalMode)
        {
            var helper = new ScalarHelper(serviceLocator, globalVariables);

            var args = new SentinelLoopSequenceResolverArgs <T, U>(
                helper.InstantiateResolver <T>(seed).Execute(),
                helper.InstantiateResolver <T>(terminal).Execute(),
                helper.InstantiateResolver <U>(step).Execute(),
                intervalMode
                );

            return(args);
        }
Пример #14
0
        private IBatchRunCommandArgs BuildDataEngineeringBatchRun(SqlRunXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                Name = helper.InstantiateResolver <string>(xml.Name),
                Path = helper.InstantiateResolver <string>(xml.Path),
                xml.Settings?.BasePath,
                Version = helper.InstantiateResolver <string>(xml.Version),
                xml.ConnectionString,
            };

            return(args.ActLike <IBatchRunCommandArgs>());
        }
Пример #15
0
        private IRunCommandArgs BuildProcessRun(ExeRunXml xml)
        {
            var helper = new ScalarHelper(serviceLocator, new Context(variables));
            var args   = new
            {
                Name = helper.InstantiateResolver <string>(xml.Name),
                Path = helper.InstantiateResolver <string>(xml.Path),
                xml.Settings?.BasePath,
                Argument = helper.InstantiateResolver <string>(xml.Argument),
                TimeOut  = helper.InstantiateResolver <int>(xml.TimeOut),
            };

            return(args.ActLike <IRunCommandArgs>());
        }
Пример #16
0
        public void Build()
        {
            if (!isSetup)
            {
                throw new InvalidOperationException();
            }

            if (obj is SentinelLoopXml)
            {
                var loop = obj as SentinelLoopXml;
                switch (columnType)
                {
                case ColumnType.Numeric:
                    args = BuildSentinelLoopResolverArgs <decimal, decimal>(loop.Seed, loop.Terminal, loop.Step, loop.IntervalMode);
                    break;

                case ColumnType.DateTime:
                    args = BuildSentinelLoopResolverArgs <DateTime, IDuration>(loop.Seed, loop.Terminal, loop.Step, loop.IntervalMode);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            else if (obj is List <string> )
            {
                var helper    = new ScalarHelper(serviceLocator, globalVariables);
                var resolvers = new List <IScalarResolver>();
                foreach (var value in obj as List <string> )
                {
                    resolvers.Add(helper.InstantiateResolver <string>(value));
                }
                args = new ListSequenceResolverArgs(resolvers);
            }

            if (args == null)
            {
                throw new ArgumentException();
            }
        }