internal void _SetFormatter ( PftFormatter formatter ) { _formatter = formatter; }
public PftContext ( PftFormatter formatter, PftContext parent ) { _formatter = formatter; _parent = parent; PftOutputBuffer parentBuffer = (parent == null) ? null : parent.Output; Output = new PftOutputBuffer(parentBuffer); Globals = (parent == null) ? new PftGlobalManager() : parent.Globals; // Переменные в каждом контексте свои Variables = new PftVariableManager(); // Процедуры в каждом контексте свои Procedures = new PftProcedureManager(); Record = (parent == null) ? new IrbisRecord() : parent.Record; Client = (parent == null) ? new ManagedClient64() : parent.Client; }
public string ExecuteFormat ( string format ) { PftFormatter formatter = new PftFormatter(Context); formatter.ParseInput(format); string result = formatter.Format(Context.Record); return(result); }
/// <summary> /// Расформатирует текст скрипта локально. /// </summary> /// <param name="client"></param> /// <param name="formatSource"></param> /// <param name="record"></param> /// <returns></returns> public static string FormatSource ( ManagedClient64 client, string formatSource, IrbisRecord record ) { using (PftFormatter formatter = new PftFormatter(client)) { string input = formatter.ResolveInline(formatSource); string result = formatter .ParseInput(input) .Format(record); return(result); } }