GetEnvironmentVariable() публичный статический Метод

获取环境变量
public static GetEnvironmentVariable ( String variable ) : String
variable String 变量名称
Результат String
Пример #1
0
 /// <summary>
 /// TemplateLexer
 /// </summary>
 /// <param name="text">待分析内容</param>
 public TemplateLexer(string text)
 {
     this._document = text;
     this._prefix   = Engine.GetEnvironmentVariable("TagPrefix");
     this._flag     = Engine.GetEnvironmentVariable("TagFlag")[0];
     this._suffix   = Engine.GetEnvironmentVariable("TagSuffix");
     Reset();
 }
Пример #2
0
        /// <summary>
        /// 模板上下文
        /// </summary>
        /// <param name="data">数据</param>
        public TemplateContext(VariableScope data)
        {
            String charset;

            this._variableScope   = data ?? new VariableScope();
            this._errors          = new List <System.Exception>();
            this._currentPath     = null;
            this._throwErrors     = Common.Utility.ToBoolean(Engine.GetEnvironmentVariable("ThrowErrors"));
            this._stripWhiteSpace = Common.Utility.ToBoolean(Engine.GetEnvironmentVariable("StripWhiteSpace"));
            if (String.IsNullOrEmpty(charset = Engine.GetEnvironmentVariable("Charset")))
            {
                this._charset = Encoding.UTF8;
            }
            else
            {
                this._charset = Encoding.GetEncoding(charset);
            }
        }