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) )); }
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) )); }
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) )); }
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>()); }
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>()); }
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>()); }
private ILoadCommandArgs BuildDataEngineeringTableLoad(TableLoadXml xml) { var helper = new ScalarHelper(serviceLocator, new Context(variables)); var args = new { TableName = helper.InstantiateResolver <string>(xml.TableName), FileName = helper.InstantiateResolver <string>(xml.InternalFileName), xml.ConnectionString }; return(args.ActLike <ILoadCommandArgs>()); }
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>()); }
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>()); }
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); }
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>()); }
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>()); }
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>()); }
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>()); }
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>()); }
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(); } }