Esempio n. 1
0
        public void InitializeLayoutFormat()
        {
            HttpCookie myLayoutCookie = Request.Cookies[layoutCookie];

            if (myLayoutCookie == null)
            {
                _selectionLayout = LayoutFormat.simple;
            }
            else
            {
                _selectionLayout = Request.Cookies[layoutCookie].Value.ToString() == "compact" ? LayoutFormat.compact : LayoutFormat.simple;
            }
            if (_selectionLayout == LayoutFormat.compact)
            {
                SwitchLayout.Text     = _switchToListTxt;
                SwitchLayout.CssClass = "variableselector-list-view  pxweb-btn icon-placement variableselector-buttons";
                //ucVariableOverview.Visible = false;
            }
            else
            {
                SwitchLayout.Text     = _switchToCompactTxt;;
                SwitchLayout.CssClass = "variableselector-compact-view  pxweb-btn icon-placement variableselector-buttons";
                //ucVariableOverview.Visible = true;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new <see cref="LayoutScript"/> object from a string.
        /// </summary>
        /// <param name="source">The <see cref="LayoutScript"/> source code string.</param>
        /// <param name="format">The source code format.</param>
        /// <returns>The newly-created <see cref="LayoutScript"/> object.</returns>
        /// <exception cref="LayoutScriptException">
        /// Thrown if the <see cref="LayoutScript"/> is empty or contains a
        /// malformatted version string.
        /// </exception>
        /// <exception cref="SyntaxException">
        /// Thrown if the <see cref="LayoutScript"/> contains a syntax error.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// Thrown if the source string is empty or null.
        /// </exception>
        internal static LayoutScript Parse(string source, LayoutFormat format)
        {
            if (string.IsNullOrWhiteSpace(source))
            {
                throw new ArgumentException(Resources.ArgumentExceptionEmptyString, nameof(source));
            }

            switch (format)
            {
            case LayoutFormat.Xml:
                return(XmlLayoutScript.Parse(source));

            default:
                throw new NotSupportedException();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a new <see cref="LayoutScript"/> object from a file.
        /// </summary>
        /// <param name="path">The path to the file to load.</param>
        /// <param name="format">The source code format.</param>
        /// <returns>The newly-created <see cref="LayoutScript"/> object.</returns>
        /// <exception cref="LayoutScriptException">
        /// Thrown if the <see cref="LayoutScript"/> is empty or contains a
        /// malformatted version string.
        /// </exception>
        /// <exception cref="SyntaxException">
        /// Thrown if the <see cref="LayoutScript"/> contains a syntax error.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// Thrown if the path is empty or null.
        /// </exception>
        internal static LayoutScript Load(string path, LayoutFormat format)
        {
            if (string.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentException(Resources.ArgumentExceptionEmptyString, nameof(path));
            }

            switch (format)
            {
            case LayoutFormat.Xml:
                return(XmlLayoutScript.Load(path));

            default:
                // TODO: message
                throw new NotSupportedException();
            }
        }