Пример #1
0
        public bool Process(IStepArgs args)
        {
            string a = SNAP.Scripts.Util.Interpret(args.MyScript, A, args.MyResource);
            string b = SNAP.Scripts.Util.Interpret(args.MyScript, B, args.MyResource);

            return(a.Equals(b));
        }
Пример #2
0
 public void Execute(IStepArgs args)
 {
     foreach (IStep step in Steps)
     {
         step.Execute(args);
     }
 }
Пример #3
0
        /// <summary>
        /// Executes the step for the specified resource.
        /// </summary>
        /// <param name="resource">The resource.</param>
        public void Execute(IStepArgs args)
        {
            string executionFolder = Scripts.Util.GetExecutionFolder(args.MyScript, args.MyResource);

            Controller.CurrentResources.LoadAdditionalResources(
                args.MyResource,
                Path.Combine(executionFolder, this.Filename)
                );
        }
Пример #4
0
        /// <summary>
        /// Gets the value.
        /// </summary>
        /// <value>The value.</value>
        public override string GetValue(IStepArgs args)
        {
            /// retrieve the path
            string result = Util.Interpret(args.MyScript, _value, args.MyResource);

            /// TODO: allow basing the path on some directory, resulting in
            /// a relative path instead of an absolute path

            /// we use unix-style paths, with a '/' separator instead of a '\' separator
            result = result.Replace('\\', '/');

            /// we replace a space character ' ' with a space escape sequence "\ "
            result = result.Replace(" ", @"\ ");
            return(result);
        }
Пример #5
0
        /// <summary>
        /// Executes the step for the specified resource.
        /// </summary>
        /// <param name="resource">The resource.</param>
        public void Execute(IStepArgs args)
        {
            Resource resource     = args.MyResource;
            string   fullFilename = System.IO.Path.Combine(
                Util.GetExecutionFolder(args.MyScript, resource), Filename);

            System.IO.Directory.GetParent(fullFilename).Create();

            /// create the file
            using (StreamWriter writer = new StreamWriter(fullFilename))
            {
                FieldExportStepArgs fieldExportArgs = new FieldExportStepArgs(writer, args);

                /// write all fields to file
                foreach (IStep step in this._fields)
                {
                    step.Execute(fieldExportArgs);
                }

                writer.Flush();
            }
        }
Пример #6
0
 public bool Process(IStepArgs args)
 {
     string a = SNAP.Scripts.Util.Interpret(args.MyScript, A, args.MyResource);
     string b = SNAP.Scripts.Util.Interpret(args.MyScript, B, args.MyResource);
     return a.Equals(b);
 }
Пример #7
0
 /// <summary>
 /// Executes the step for the specified resource.
 /// </summary>
 /// <param name="resource">The resource.</param>
 public void Execute(IStepArgs args)
 {
     Util.Run(this, args.MyResource, args.MyScript);
 }
Пример #8
0
 /// <summary>
 /// Gets the value.
 /// </summary>
 /// <value>The value.</value>
 public override string GetValue(IStepArgs args)
 {
     return(Util.Interpret(args.MyScript, _value, args.MyResource));
 }
Пример #9
0
 public FieldExportStepArgs(StreamWriter writer, IStepArgs args)
 {
     _writer   = writer;
     InnerArgs = args;
 }
Пример #10
0
 void IStep.Execute(IStepArgs args)
 {
     Execute((IFieldExportStepArgs)args);
 }
Пример #11
0
 public abstract string GetValue(IStepArgs resource);