Sage.SageContext.GetProjectVariable C# (CSharp) 메소드

GetProjectVariable() 공개 메소드

Gets the value of the project variable with the specified name.
public GetProjectVariable ( string name, string locale = null ) : string
name string The name of the variable.
locale string Optional locale to use to select the variable value. If omitted the current will be used
리턴 string
        public string GetProjectVariable(string name, string locale = null)
        {
            if (string.IsNullOrWhiteSpace(locale) || !this.ProjectConfiguration.Locales.ContainsKey(locale))
                locale = this.Locale;

            return this.ProjectConfiguration.GetVariable(name, locale);
        }

Usage Example

예제 #1
0
        internal static string GetVariable(SageContext context, params string[] arguments)
        {
            if (arguments.Length < 1)
                return string.Empty;

            string name = arguments[0];
            string locale = arguments.Length < 2 ? null : arguments[1];

            return context.GetProjectVariable(name, locale);
        }