public JsonWriter() { _instStringBuilder = new System.Text.StringBuilder(); _writer = new System.IO.StringWriter(_instStringBuilder); Init(); }
public override void BeginAssembly() { if (_consoleOnly) { base.BeginAssembly(); Init = System.IO.TextWriter.Null; //This is a publi member that other classes may use! return; } OpenOutput(Filename + ".cpp"); base.BeginAssembly(); Init = new System.IO.StringWriter(); var execDir = System.IO.Path.GetDirectoryName(System.IO.Path.GetFullPath(System.Reflection.Assembly.GetExecutingAssembly().Location)); if (execDir.EndsWith("Debug")) execDir = execDir.Replace("Debug", "Release"); WriteOutput(@" #using <System.dll> //#using <{0}/MCDynamicRuntime.dll> //#using <{0}/mjr.exe> using namespace System; using namespace mjr; namespace MDRSrcGen {{ ref class Program {{ ", execDir.Replace('\\', '/')); }
public static void Main(string[] args) { nick = "SecureIRC"; owner = "SecureIRC"; server = "irc.entalyan.com"; port = 6999; chan = "#SecureIRC"; pass = ""; //Enter just the password //Connect to irc server and get input and output text streams from TcpClient. sock.Connect(server, port); if (!sock.Connected) { Console.WriteLine("Failed to connect!"); return; } input = new System.IO.StreamReader(sock.GetStream()); output = new System.IO.StreamWriter(sock.GetStream()); //Starting USER and NICK login commands output.Write( "PASS " + nick + ":" + pass + "\r\n" + "USER " + nick + " 0 * :" + owner + "\r\n" + "NICK " + nick + "\r\n" + "PRIVMSG #SecureIRC Successful login at: " + DateTime.Now.ToString() + "\r\n" ); output.Flush(); Listen(); Console.WriteLine("Press any key to exit."); Console.ReadKey(); }
public static void zombolize(string[] args) { if(args.Length!=6) { ConsoleLog.WriteLine("Usage: zombolize loginlist dictionary proxylist threadcount outfile"); return; } m_NickNameList=new NerZul.Core.Utils.StringHolder(args[1]); m_Dictionary=System.IO.File.ReadAllLines(args[2]); m_ProxyList=new NerZul.Core.Utils.StringSelector(args[3]); int ThreadCount=int.Parse(args[4]); m_OutS=new System.IO.StreamWriter(args[5]); m_List=new System.Collections.Generic.List<Engine.Zomboloid.LoginPassword>(); for(int i=0; i<ThreadCount;i++) { new System.Threading.Thread(zombolize_thread).Start(); } while(true) { System.Threading.Thread.Sleep(500); lock(m_ThreadCountLock) { if(m_ThreadCount<=0) return; } } }
public TextWriterErrorListener(TextWriter writer) { if (writer == null) throw new ArgumentNullException("writer"); _writer = writer; }
public CommandBase() { //by default, read from/write to standard streams this.In = System.Console.In; this.Out = System.Console.Out; this.Error = System.Console.Error; }
protected void Initializer(string FeatureName) { this.In = System.Console.In; this.Out = System.Console.Out; this.Error = System.Console.Out; Name = FeatureName; }
public IndentPrinter(TW Out, string IndentString, string PrefixString, bool FreshLine) { this.Out = Out; this.IndentString = IndentString; this.PrefixString = PrefixString; this.nl = FreshLine; }
public void Dispose() { if (mFile != null) mFile.Close(); mFile = null; }
/// <summary> /// Formats a complete HTML document describing the given /// <see cref="Error"/> instance. /// </summary> public override void Format(TextWriter writer, Error error) { if (writer == null) throw new ArgumentNullException("writer"); if (error == null) throw new ArgumentNullException("error"); var page = new ErrorMailHtmlPage(error); writer.Write(page.TransformText()); }
// This method is OPTIONAL, you may choose to implement Write and WriteLiteral without use of __razor_writer // and provide another means of invoking Execute. // /// <summary>Executes the template, writing to the provided text writer.</summary> /// <param name=""writer"">The TextWriter to which to write the template output.</param> public void Generate(System.IO.TextWriter writer) { Html = new HtmlHelper (writer); Url = new UrlHelper (); __razor_writer = writer; Execute (); __razor_writer = null; }
public HtmlTextWriter(System.IO.TextWriter inner) { this._inner = inner; var nl = inner.NewLine; this.CoreNewLine = nl.ToCharArray(); this._windowsNewLine = nl == "\r\n"; }
public TextFileWriter(String fileNameBase, String directory = null, String nameExtension = ".txt") { textWriter = null; FileNameBase = fileNameBase; NameExtension = nameExtension; Directory = directory; FileAccessMutex = new Mutex(); }
void WriteLine(string level, string text) { if (m_writer == null && MyAPIGateway.Utilities != null) m_writer = MyAPIGateway.Utilities.WriteFileInLocalStorage(m_filename, typeof(Log)); m_cache.AppendLine(string.Format("{0}\t {1}\t {2}", DateTime.Now.ToString("[HH:mm:ss]"), level, text)); Flush(); }
public static ITemplateWriter GetStringTemplateWriter(this TemplateGroup group, TextWriter writer) { if (group == null) throw new ArgumentNullException("group"); if (writer == null) throw new ArgumentNullException("writer"); return new AutoIndentWriter(writer); }
protected override void DumpChildren(TextWriter Out, uint Depth) { foreach (VEntry e in Fields.Values) { Indent(Out, Depth); Out.Write(e.Name); Out.WriteLine(" ="); e.Value.Dump(Out, Depth+1); } }
public Game(int players, System.IO.TextWriter log) { this.Log = log; this.Deck = new Deck(); this.Players = Enumerable.Range(0, players).Select(i => new Player(this, i)).ToList(); this.Fails = FAILS; this.Hints = HINTS; this.FinalTurns = players; }
internal static void PrintStackTrace(this Exception e, TextWriter writer) { writer.WriteLine(e.ToString()); string trace = e.StackTrace ?? string.Empty; foreach (string line in trace.Split('\n', '\r')) { if (!string.IsNullOrEmpty(line)) writer.WriteLine(" " + line); } }
protected override bool CloseHelper() { bool result; if (result = this.writer.NotNull()) { this.writer.Close(); this.writer = null; } return result; }
/// <summary> /// Writes flow state that is true on exit from the basic block. /// </summary> /// <param name="arch"></param> /// <param name="writer"></param> public void WriteAfter(IProcessorArchitecture arch, TextWriter writer) { EmitRegisters(arch, "// DataOut:", DataOut, writer); writer.WriteLine(); EmitFlagGroup(arch, "// DataOut (flags):", grfOut, writer); writer.WriteLine(); EmitLocals("// LocalsOut:", writer); if (TerminatesProcess) writer.WriteLine("// Terminates process"); }
public bool Open(string filename) { mFilename = filename; mFile = new System.IO.StreamWriter(mFilename); if (mFile != null) return true; else return false; }
protected override void DumpChildren(TextWriter Out, uint Depth) { foreach (Element e in Elements) { e.First.Dump(Out, Depth); if (e.ArrowPos != null) { Indent(Out, Depth+1); Out.WriteLine("->"); e.Second.Dump(Out, Depth+1); } } }
internal void Close() { Flush(true); m_cache.Clear(); m_cache = null; if (m_writer == null) return; m_writer.Flush(); m_writer.Close(); m_writer = null; }
internal ImmutableRepositoryStartSettings(RepositoryStartSettings settings) { _startLuceneManager = settings.StartLuceneManager; _backupIndexAtTheEnd = settings.BackupIndexAtTheEnd; var configRestoreIndex = RepositoryStartSettings.ConfigRestoreIndex; _restoreIndex = configRestoreIndex.HasValue ? configRestoreIndex.Value : settings.RestoreIndex; _startWorkflowEngine = settings.StartWorkflowEngine; _console = settings.Console; _pluginsPath = settings.PluginsPath; _indexPath = settings.IndexPath; }
public void Main(string[] args, System.IO.TextReader In, System.IO.TextWriter Out, System.IO.TextWriter Error) { //this version of Main allows alternate streams this.In = In; this.Out = Out; this.Error = Error; this.Main(args); }
public static void Close() { if (writer != null) { writer.Flush(); writer.Close(); writer = null; } indent = 0; cache.Clear(); }
public override void Emit(IProcessorArchitecture arch, TextWriter writer) { EmitRegisters(arch, "// DataOut:", DataOut, writer); writer.WriteLine(); EmitFlagGroup(arch, "// DataOut (flags):", grfOut, writer); writer.WriteLine(); SymbolicIn.Emit(arch, "// SymbolicIn:", writer); writer.WriteLine(); EmitLocals("// LocalsOut:", writer); if (TerminatesProcess) writer.WriteLine("// Terminates process"); }
/// <summary> /// Initializes a new instance of the RunStyleCopHandler class. /// </summary> public RunStyleCopHandler() { Pad tmpPad = IdeApp.Workbench.Pads.Find( delegate(Pad toCheck) { return toCheck.Id.Equals("MonoDevelop.Ide.Gui.Pads.ErrorListPad"); }); if (tmpPad != null) { this.errorPad = tmpPad.Content as ErrorListPad; } this.logger = this.errorPad.GetBuildProgressMonitor().Log; }
public ComponentSelectionForm(IMgaModel component, IMgaModel alternativeContainer, System.IO.TextWriter errorWriter=null, System.IO.TextWriter infoWriter=null) { InitializeComponent(); #region Initialize Class Variables this.component = component; this.alternativeContainer = alternativeContainer; this.dataSource = new List<ComponentListItem>(); this.ErrorWriter = (errorWriter == null) ? Console.Error : errorWriter; this.InfoWriter = (infoWriter == null) ? Console.Out : infoWriter; this.clm = new ClmLib.Clm(this.component); #endregion this.filterParameters = this.clm.GenerateFilter(alternativeContainer, this.ErrorWriter, this.InfoWriter); RefreshLocalComponentList(); }
public void Assign(string s, AssignType type) { _type = type; if (s != string.Empty) { if (type == AssignType.Read) { reader = new System.IO.StreamReader(s); } else { writer = new System.IO.StreamWriter(s); } } field_2 = 0xD7B0; }
public void Generate(SqlNode node, System.IO.TextWriter writer) { bool writeWhitespace = false; Generate(node, writer, ref writeWhitespace); }
// This method is OPTIONAL, you may choose to implement Write and WriteLiteral without use of __razor_writer // and provide another means of invoking Execute. // /// <summary>Executes the template, writing to the provided text writer.</summary> /// <param name="writer">The TextWriter to which to write the template output.</param> public void Generate(System.IO.TextWriter writer) { __razor_writer = writer; Execute(); __razor_writer = null; }
public void Save(System.IO.TextWriter textWriter) { }
public IndentedTextWriter(System.IO.TextWriter textWriter) { this.textWriter = textWriter; }
public void Save(System.IO.TextWriter textWriter, System.Xml.Linq.SaveOptions options) { }
public void Write(ContentItem item, string propertyName, System.IO.TextWriter writer) { writer.Write(item[propertyName]); }
public void Encode(System.IO.TextWriter output, string value) { }
public override void Encode(System.IO.TextWriter output, char[] value, int startIndex, int characterCount) { }
public override void WriteCommand(System.IO.TextWriter writer) { writer.WriteLine("Drop {0}", _Amount); }
/// <summary> /// Initializes a new instance of the <see cref="RewriteFormHtmlTextWriter"/> class. /// </summary> /// <param name="writer">The writer.</param> public RewriteFormHtmlTextWriter(System.IO.TextWriter writer) : base(writer) { this.InnerWriter = writer; }
public abstract void WriteTo(System.IO.TextWriter writer, System.Text.Encodings.Web.HtmlEncoder encoder);
public static void RunWithController(TestHelper helper, IControllerPrx controller) { Communicator?communicator = helper.Communicator; TestHelper.Assert(communicator != null); bool ice1 = TestHelper.GetTestProtocol(communicator.GetProperties()) == Protocol.Ice1; var timeout = ITimeoutPrx.Parse(helper.GetTestProxy("timeout", 0), communicator); System.IO.TextWriter output = helper.Output; output.Write("testing connect timeout... "); output.Flush(); { Dictionary <string, string>?properties = communicator.GetProperties(); properties["Ice.ConnectTimeout"] = "100ms"; using var comm = new Communicator(properties); var to = ITimeoutPrx.Parse(helper.GetTestProxy("timeout", 0), comm); // Expect ConnectTimeoutException. controller.HoldAdapter(-1); try { to.Op(); TestHelper.Assert(false); } catch (ConnectTimeoutException) { // Expected. } controller.ResumeAdapter(); timeout.Op(); // Ensure adapter is active. } { // Expect success. controller.HoldAdapter(100); timeout.Op(); } output.WriteLine("ok"); // The sequence needs to be large enough to fill the write/recv buffers byte[] seq = new byte[2000000]; output.Write("testing connection timeout... "); output.Flush(); { // Expect TimeoutException. controller.HoldAdapter(-1); timeout.GetConnection().Acm = new Acm(TimeSpan.FromMilliseconds(50), AcmClose.OnInvocationAndIdle, AcmHeartbeat.Off); try { timeout.SendData(seq); TestHelper.Assert(false); } catch (ConnectionClosedException) { // Expected. } controller.ResumeAdapter(); timeout.Op(); // Ensure adapter is active. } { // Expect success. controller.HoldAdapter(100); try { timeout.SendData(new byte[1000000]); } catch (ConnectionClosedException) { TestHelper.Assert(false); } } output.WriteLine("ok"); output.Write("testing invocation timeout... "); output.Flush(); { timeout.IcePing(); // Makes sure a working connection is associated with the proxy Connection?connection = timeout.GetConnection(); try { timeout.Clone(invocationTimeout: TimeSpan.FromMilliseconds(100)).SleepAsync(1000).Wait(); TestHelper.Assert(false); } catch (AggregateException ex) when(ex.InnerException is OperationCanceledException) { } timeout.IcePing(); TestHelper.Assert(connection == timeout.GetConnection()); try { timeout.Clone(invocationTimeout: TimeSpan.FromMilliseconds(1000)).SleepAsync(100).Wait(); } catch (AggregateException ex) when(ex.InnerException is OperationCanceledException) { TestHelper.Assert(false); } TestHelper.Assert(connection == timeout.GetConnection()); } output.WriteLine("ok"); output.Write("testing close timeout... "); output.Flush(); { Dictionary <string, string> properties = communicator.GetProperties(); properties["Ice.CloseTimeout"] = "100ms"; using var comm = new Communicator(properties); var to = ITimeoutPrx.Parse(helper.GetTestProxy("timeout", 0), comm); Connection?connection = to.GetConnection(); Connection?connection2 = timeout.GetConnection(); // No close timeout TestHelper.Assert(connection != null && connection2 != null); controller.HoldAdapter(-1); // Make sure there's no ReadAsync pending _ = to.IcePingAsync(); _ = timeout.IcePingAsync(); var semaphore = new System.Threading.SemaphoreSlim(0); connection.Closed += (sender, args) => semaphore.Release(); connection.GoAwayAsync(); TestHelper.Assert(semaphore.Wait(500)); connection2.Closed += (sender, args) => semaphore.Release(); connection2.GoAwayAsync(); TestHelper.Assert(!semaphore.Wait(500)); controller.ResumeAdapter(); timeout.Op(); // Ensure adapter is active. } output.WriteLine("ok"); output.Write("testing invocation timeouts with collocated calls... "); output.Flush(); { communicator.SetProperty("TimeoutCollocated.AdapterId", "timeoutAdapter"); ObjectAdapter adapter = communicator.CreateObjectAdapter("TimeoutCollocated"); adapter.Activate(); ITimeoutPrx proxy = adapter.AddWithUUID(new Timeout(), ITimeoutPrx.Factory); try { proxy.Clone(invocationTimeout: TimeSpan.FromMilliseconds(100)).SleepAsync(500).Wait(); TestHelper.Assert(false); } catch (AggregateException ex) when(ex.InnerException is OperationCanceledException) { } adapter.Dispose(); } output.WriteLine("ok"); if (!ice1) { output.Write("testing deadlines... "); output.Flush(); { var comm1 = new Communicator( communicator.GetProperties(), invocationInterceptors: new InvocationInterceptor[] { (target, request, next, cancel) => { request.AddBinaryContextEntry(10, request.Deadline, (ostr, value) => { var deadline = (value - DateTime.UnixEpoch).TotalMilliseconds; ostr.WriteVarLong((long)deadline); }); return(next(target, request, cancel)); } }); for (int i = 1000; i < 5000;) { i += 33; ITimeoutPrx to = ITimeoutPrx.Parse(helper.GetTestProxy("timeout", 0), comm1).Clone( invocationTimeout: TimeSpan.FromMilliseconds(i)); TestHelper.Assert(to.CheckDeadline()); } } output.WriteLine("ok"); } controller.Shutdown(); }
public void WriteAsJSON(System.IO.TextWriter wri, int nestingLevel, JSONWritingOptions options = null) { JSONWriter.WriteMap(wri, m_Data, nestingLevel, options); }
// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently // /// <summary>Writes a literal value to the TextWriter without HTML escaping it.</summary> /// <param name="writer">The TextWriter to which to write the literal.</param> /// <param name="value">The literal value.</param> protected static void WriteLiteralTo(System.IO.TextWriter writer, string value) { writer.Write(value); }
public virtual void Encode(System.IO.TextWriter output, string value, int startIndex, int characterCount) { }
/// <summary> /// Writes fielddef as JSON. Do not call this method directly, instead call rowset.ToJSON() or use JSONWriter class /// </summary> public void WriteAsJSON(System.IO.TextWriter wri, int nestingLevel, JSONWritingOptions options = null) { var attr = this[null]; if (attr.NonUI) { wri.Write("{}"); return; //nothing to write for NONUI } bool typeIsNullable; string tp = JSONMappings.MapCLRTypeToJSON(m_Type, out typeIsNullable); var map = new Dictionary <string, object> { { "Name", m_Name }, { "Order", m_Order }, { "Type", tp }, { "Nullable", typeIsNullable } }; if (attr != null) { map.Add("IsKey", attr.Key); map.Add("IsRequired", attr.Required); map.Add("Visible", attr.Visible); if (attr.Default != null) { map.Add("Default", attr.Default); } if (attr.CharCase != CharCase.AsIs) { map.Add("CharCase", attr.CharCase); } if (attr.Kind != DataKind.Text) { map.Add("Kind", attr.Kind); } if (attr.MinLength != 0) { map.Add("MinLen", attr.MinLength); } if (attr.MaxLength != 0) { map.Add("MaxLen", attr.MaxLength); } if (attr.Min != null) { map.Add("Min", attr.Min); } if (attr.Max != null) { map.Add("Max", attr.Max); } if (attr.ValueList != null) { map.Add("ValueList", attr.ValueList); } if (attr.Description != null) { map.Add("Description", attr.Description); } //metadata content is in the internal format and not dumped } JSONWriter.WriteMap(wri, map, nestingLevel, options); }
public void Write(System.IO.TextWriter writer, string destFileName) { writer.NewLine = "\n"; writer.WriteLine("#define POST_ACTOR_COMPILER 1"); int outLine = 1; if (LineNumbersEnabled) { writer.WriteLine("#line {0} \"{1}\"", tokens[0].SourceLine, sourceFile); outLine++; } int inBlocks = 0; for (int i = 0; i < tokens.Length; i++) { if (tokens[0].SourceLine == 0) { throw new Exception("Internal error: Invalid source line (0)"); } if (tokens[i].Value == "ACTOR" || tokens[i].Value == "TEST_CASE") { int end; var actor = ParseActor(i, out end); var actorWriter = new System.IO.StringWriter(); actorWriter.NewLine = "\n"; new ActorCompiler(actor, sourceFile, inBlocks == 0, LineNumbersEnabled).Write(actorWriter); string[] actorLines = actorWriter.ToString().Split('\n'); bool hasLineNumber = false; bool hadLineNumber = true; foreach (var line in actorLines) { if (LineNumbersEnabled) { bool isLineNumber = line.Contains("#line"); if (isLineNumber) { hadLineNumber = true; } if (!isLineNumber && !hasLineNumber && hadLineNumber) { writer.WriteLine("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#line {0} \"{1}\"", outLine + 1, destFileName); outLine++; hadLineNumber = false; } hasLineNumber = isLineNumber; } writer.WriteLine(line.TrimEnd('\n', '\r')); outLine++; } i = end; if (i != tokens.Length && LineNumbersEnabled) { writer.WriteLine("#line {0} \"{1}\"", tokens[i].SourceLine, sourceFile); outLine++; } } else if (tokens[i].Value == "DESCR") { int end; var descr = ParseDescr(i, out end); int lines; new DescrCompiler(descr, sourceFile, inBlocks == 0, tokens[i].BraceDepth).Write(writer, out lines); i = end; outLine += lines; if (i != tokens.Length && LineNumbersEnabled) { writer.WriteLine("#line {0} \"{1}\"", tokens[i].SourceLine, sourceFile); outLine++; } } else { if (tokens[i].Value == "{") { inBlocks++; } else if (tokens[i].Value == "}") { inBlocks--; } writer.Write(tokens[i].Value); outLine += tokens[i].Value.Count(c => c == '\n'); } } }
public void Serialize(System.IO.TextWriter textWriter, object o, System.Xml.Serialization.XmlSerializerNamespaces namespaces) { }
public void WriteTo(System.IO.TextWriter writer) { }
private void DisplayHelp(TextWriter stdout) { this.DisplayVersion(stdout); this.options.WriteOptionDescriptions(stdout); }
public void Write(System.IO.TextWriter writer, Span span) { throw new NotImplementedException(); }
/// <summary> /// Instantiates. /// </summary> public TextWriterLogger(System.IO.TextWriter writer) { _writer = writer; }
private void DisplayVersion(TextWriter stdout) { stdout.WriteLine("Pickles version {0}", Assembly.GetExecutingAssembly().GetName().Version); }
public void Serialize(System.IO.TextWriter textWriter, object o) { }
private void Generate(SqlNode node, System.IO.TextWriter writer, ref bool writeWhitespace) { switch (node.Type) { case SqlNodeType.AscDesc: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.ColumnList: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.ColumnListTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.ComparisonOperator: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.From: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.FunctionParameterList: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.FunctionParameterListTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.GroupByClause: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.GroupByTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.JoinList: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.LogicalOperator: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.OrderByClause: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.OrderByTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.Predicate: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.PredicateIdentifierTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.PredicateTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.Select: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.SelectItem: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.SelectItemAlias: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.SelectItemTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.SelectList: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.SelectListTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.SetList: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.SetListTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.Statement: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.StatementTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.TableList: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.TableListTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.TableTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.Union: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.VALUE: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.ValueList: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.ValueListTail: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.WhereClause: { for (int i = 0; i < node.Nodes.Count; i++) { Generate(node.Nodes[i], writer, ref writeWhitespace); } break; } case SqlNodeType.AND: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.AS: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.ASC: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.BETWEEN: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.BY: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.COMMA: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.DATE: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.DELETE: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.DESC: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.EPSILON: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.EQUALS: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.FLOAT: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.FROM: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.GREATER_THAN: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.GREATER_THAN_OR_EQUAL: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.GROUP: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.IDENTIFIER: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.INNER: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.INSERT: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.INTEGER: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.INTO: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.JOIN: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.LEFT: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.LEFT_PAREN: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.LESS_THAN: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.LESS_THAN_OR_EQUAL: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.LIKE: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.NOT: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.NOT_EQUALS: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.ON: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.OR: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.ORDER: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.OUTER: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.QUOTED_STRING: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.REPLACE: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.RIGHT: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.RIGHT_PAREN: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.SELECT: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.SEMICOLON: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.SET: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.UNION: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.UPDATE: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.VALUES: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } case SqlNodeType.WHERE: { if (writeWhitespace) { writer.Write(" "); } writer.Write(node.Value); writeWhitespace = true; break; } default: { throw new System.Exception("Invalid node type."); } } }
public bool Parse(string[] args, Configuration configuration, TextWriter stdout) { var currentDirectory = this.fileSystem.DirectoryInfo.FromDirectoryName(this.fileSystem.Directory.GetCurrentDirectory()); configuration.FeatureFolder = currentDirectory; configuration.OutputFolder = currentDirectory; List <string> extra = this.options.Parse(args); if (this.versionRequested) { this.DisplayVersion(stdout); return(false); } else if (this.helpRequested) { this.DisplayHelp(stdout); return(false); } if (!string.IsNullOrEmpty(this.featureDirectory)) { configuration.FeatureFolder = this.fileSystem.DirectoryInfo.FromDirectoryName(this.featureDirectory); } if (!string.IsNullOrEmpty(this.outputDirectory)) { configuration.OutputFolder = this.fileSystem.DirectoryInfo.FromDirectoryName(this.outputDirectory); } if (!string.IsNullOrEmpty(this.testResultsFormat)) { configuration.TestResultsFormat = (TestResultsFormat)Enum.Parse(typeof(TestResultsFormat), this.testResultsFormat, true); } if (!string.IsNullOrEmpty(this.testResultsFile)) { var files = this.testResultsFile.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); configuration.AddTestResultFiles(files.Select(f => this.fileSystem.FileInfo.FromFileName(f))); } if (!string.IsNullOrEmpty(this.systemUnderTestName)) { configuration.SystemUnderTestName = this.systemUnderTestName; } if (!string.IsNullOrEmpty(this.systemUnderTestVersion)) { configuration.SystemUnderTestVersion = this.systemUnderTestVersion; } if (!string.IsNullOrEmpty(this.language)) { configuration.Language = this.language; } if (!string.IsNullOrEmpty(this.documentationFormat)) { configuration.DocumentationFormat = (DocumentationFormat)Enum.Parse(typeof(DocumentationFormat), this.documentationFormat, true); } return(true); }
public static void SetOut(System.IO.TextWriter newOut) { }
// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently // /// <summary> /// Conditionally writes an attribute to a TextWriter. /// </summary> /// <param name="writer">The TextWriter to which to write the attribute.</param> /// <param name="name">The name of the attribute.</param> /// <param name="prefix">The prefix of the attribute.</param> /// <param name="suffix">The suffix of the attribute.</param> /// <param name="values">Attribute values, each specifying a prefix, value and whether it's a literal.</param> ///<remarks>Used by Razor helpers to write attributes.</remarks> protected static void WriteAttributeTo(System.IO.TextWriter writer, string name, string prefix, string suffix, params Tuple <string, object, bool>[] values) { // this is based on System.Web.WebPages.WebPageExecutingBase // Copyright (c) Microsoft Open Technologies, Inc. // Licensed under the Apache License, Version 2.0 if (values.Length == 0) { // Explicitly empty attribute, so write the prefix and suffix writer.Write(prefix); writer.Write(suffix); return; } bool first = true; bool wroteSomething = false; for (int i = 0; i < values.Length; i++) { Tuple <string, object, bool> attrVal = values [i]; string attPrefix = attrVal.Item1; object value = attrVal.Item2; bool isLiteral = attrVal.Item3; if (value == null) { // Nothing to write continue; } // The special cases here are that the value we're writing might already be a string, or that the // value might be a bool. If the value is the bool 'true' we want to write the attribute name instead // of the string 'true'. If the value is the bool 'false' we don't want to write anything. // // Otherwise the value is another object (perhaps an IHtmlString), and we'll ask it to format itself. string stringValue; bool? boolValue = value as bool?; if (boolValue == true) { stringValue = name; } else if (boolValue == false) { continue; } else { stringValue = value as string; } if (first) { writer.Write(prefix); first = false; } else { writer.Write(attPrefix); } if (isLiteral) { writer.Write(stringValue ?? value); } else { WriteTo(writer, stringValue ?? value); } wroteSomething = true; } if (wroteSomething) { writer.Write(suffix); } }
public override void WriteText(Assembler aAssembler, System.IO.TextWriter aOutput) { aOutput.Write(Code); }
public override void WriteTo(System.IO.TextWriter writer, System.Text.Encodings.Web.HtmlEncoder encoder) { }