Example #1
0
        // The pipe's compile errors are gathered here.
        /// <summary>
        /// Constructs a pipe from a script and references the pipe's file
        /// on disk in order to identify the pipe when generating compile
        /// errors.  If the pipe is not yet saved to disk, specify Folder
        /// and Name as "".
        /// </summary>
        public Pipe(string script, Engine eng, string folder, string name,
      bool loggingEnabled, bool replacingDelims)
        {
            if (eng != null)
             {
            Name = name;
            Eng = eng;
            LoggingEnabled = loggingEnabled;
            Debugging = false;
            DebugFile = null;
            LogWrite("Pipe.Pipe: replacingDelims: " + replacingDelims.ToString());

            if (replacingDelims)
               Script = script.Replace(Engine.PipeDelim.ToString(), System.Environment.NewLine);
            else
               Script = script;

            if (folder != string.Empty)
               Folder = System.IO.Path.GetFullPath(folder);
            else
               Folder = folder;

            DivTextStack = new Stack<string>();
            LogWriteText(Script, "Pipe.Pipe Script... ", "Line[[]]: ");
            LogWrite("Pipe.Pipe: Folder = \"" + folder + "\"");
            LogWrite("Pipe.Pipe: Name = \"" + name + "\"");
            Template = GetKeywordValue("TEMPLATE", Script);
            LogWrite("Pipe.Pipe: Template = \"" + Template + "\"");
            Filters = new List<Filter>();
            CmdLine = new CommandLine(Template, eng.Log, loggingEnabled);
            CmdLine.IgnoringExtraneousText = false;
            Errors = new CompileErrors();
             }
             else
             {
            throw new PipeWrenchEngineException("Engine parameter cannot be null");
             }
        }
Example #2
0
        // The pipe line that was recently clicked on.

        /// <summary>
        /// This constructor is called from Program.cs.
        /// </summary>
        public MainForm(string[] args) : this()
        {
            CoreLogging = Engine.CoreLogging(args);
        }
Example #3
0
        /// <summary>
        /// Exports the pipe text to the clipboard as a command-line style pipe.
        /// </summary>
        private void ExportAction(object sender, EventArgs e)
        {
            string text = PipeTextBox.Text;

            Clipboard.SetDataObject(Engine.GuiPipeToCli(text));
        }
Example #4
0
 /// <summary>
 /// This constructor is called from the other constructor.
 /// </summary>
 public MainForm()
 {
     InitializeComponent();
      PipeEng = new Engine(AppName);
      this.Text = AppName;
      AssyFolder = System.IO.Path.GetDirectoryName(typeof(MainForm).Assembly.Location);
      homeFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
      applDataFolder = homeFolder + System.IO.Path.DirectorySeparatorChar + AppName;
      ConfigFile = AssyFolder + System.IO.Path.DirectorySeparatorChar + AppName + "Conf.xml";
      LoadConfiguration();
      PopulateFilterToolbar();
      this.Text = "new pipe - " + AppName;
      UpdateControls();
 }