示例#1
0
    /// <summary>
    /// Sets the control with a new URL path
    /// </summary>
    /// <param name="urlPath">URL path to set</param>
    protected void SetURLPath(string urlPath)
    {
        radRoute.Checked = false;
        radPage.Checked  = false;

        // Process the URL path
        if (String.IsNullOrEmpty(urlPath))
        {
            radPage.Checked = true;
            txtUrlPath.Text = "";
            return;
        }

        // Parse the path
        string    prefix;
        Hashtable values = new Hashtable();

        TreePathUtils.ParseUrlPath(ref urlPath, out prefix, values);

        // Examine the prefix
        if (prefix.StartsWithCSafe(TreePathUtils.URL_PREFIX_ROUTE, true))
        {
            radRoute.Checked = true;
        }
        else
        {
            radPage.Checked = true;
        }

        txtUrlPath.Text = urlPath;
    }
示例#2
0
    protected object UniGridAlias_OnExternalDataBound(object sender, string sourceName, object parameter)
    {
        switch (sourceName.ToLower())
        {
        case "culture":
            return(UniGridFunctions.CultureDisplayName(parameter));

        case "urlpath":
        {
            // Parse the URL path
            string urlPath = ValidationHelper.GetString(parameter, "");

            string prefix = null;
            TreePathUtils.ParseUrlPath(ref urlPath, out prefix, null);

            if (prefix.StartsWith(TreePathUtils.URL_PREFIX_MVC, StringComparison.InvariantCultureIgnoreCase))
            {
                urlPath = GetString("URLPath.MVC") + ": " + urlPath;
            }
            else if (prefix.StartsWith(TreePathUtils.URL_PREFIX_ROUTE, StringComparison.InvariantCultureIgnoreCase))
            {
                urlPath = GetString("URLPath.Route") + ": " + urlPath;
            }

            return(urlPath);
        }
        }

        return(parameter);
    }
    /// <summary>
    /// Sets the control with a new URL path
    /// </summary>
    /// <param name="urlPath">URL path to set</param>
    protected void SetURLPath(string urlPath)
    {
        radMVC.Checked   = false;
        radRoute.Checked = false;
        radPage.Checked  = false;

        // Process the URL path
        if (String.IsNullOrEmpty(urlPath))
        {
            radPage.Checked = true;
            txtUrlPath.Text = "";
            return;
        }

        // Parse the path
        string    prefix;
        Hashtable values = new Hashtable();

        TreePathUtils.ParseUrlPath(ref urlPath, out prefix, values);

        // Examine the prefix
        if (prefix.StartsWithCSafe(TreePathUtils.URL_PREFIX_MVC, true))
        {
            radMVC.Checked = true;
        }
        else if (prefix.StartsWithCSafe(TreePathUtils.URL_PREFIX_ROUTE, true))
        {
            radRoute.Checked = true;
        }
        else
        {
            radPage.Checked = true;
        }

        txtUrlPath.Text = urlPath;

        txtController.Text = ValidationHelper.GetString(values["controller"], "");
        txtAction.Text     = ValidationHelper.GetString(values["action"], "");
    }