UrlBuilder.BuildUrl 方法

定义

创建用户界面以创建或选取 URL。Creates a UI to create or pick a URL.

重载

BuildUrl(IComponent, Control, String, String, String)

创建用户界面以创建或选取 URL。Creates a UI to create or pick a URL.

BuildUrl(IComponent, Control, String, String, String, UrlBuilderOptions)

使用指定的 UrlBuilderOptions 对象创建用户界面以创建或选取 URL。Creates a UI to create or pick a URL, using the specified UrlBuilderOptions object.

BuildUrl(IServiceProvider, Control, String, String, String, UrlBuilderOptions)

使用指定的 UrlBuilderOptions 对象创建用户界面以创建或选取 URL。Creates a UI to create or pick a URL, using the specified UrlBuilderOptions object.

BuildUrl(IComponent, Control, String, String, String)

创建用户界面以创建或选取 URL。Creates a UI to create or pick a URL.

public:
 static System::String ^ BuildUrl(System::ComponentModel::IComponent ^ component, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter);
public static string BuildUrl (System.ComponentModel.IComponent component, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter);
static member BuildUrl : System.ComponentModel.IComponent * System.Windows.Forms.Control * string * string * string -> string
Public Shared Function BuildUrl (component As IComponent, owner As Control, initialUrl As String, caption As String, filter As String) As String

参数

component
IComponent

将使用其站点来访问设计时服务的 IComponentThe IComponent whose site is to be used to access design-time services.

owner
Control

用作选择器窗口的父级的 ControlThe Control used as the parent for the picker window.

initialUrl
String

要在选择器窗口中显示的初始 URL。The initial URL to be shown in the picker window.

caption
String

选择器窗口的标题。The caption of the picker window.

filter
String

筛选字符串,用于有选择地筛选显示在选择器窗口中的文件。The filter string to use to optionally filter the files displayed in the picker window.

返回

从用户界面中返回的 URL。The URL returned from the UI.

示例

下面的代码示例演示如何在设计时BuildUrl使用方法从菜单命令启动 URL 生成器。The following code example shows how to use the BuildUrl method to launch a URL builder from a menu command at design time.

// Create a parent control.
System::Windows::Forms::Control^ c = gcnew System::Windows::Forms::Control;
c->CreateControl();

// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter String* and URLBuilderOptions value.
UrlBuilder::BuildUrl( this->Component, c, "http://www.example.com", "Select a URL", "", UrlBuilderOptions::None );

// This method handles the "Launch Url Builder UI" menu command.
// Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
private void launchUrlBuilder(object sender, EventArgs e)
{
    // Create a parent control.
    System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
    c.CreateControl();            
                
    // Launch the Url Builder using the specified control
    // parent, initial URL, empty relative base URL path,
    // window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl(
        this.Component, 
        c, 
        "http://www.example.com", 
        "Select a URL", 
        "", 
        UrlBuilderOptions.None);                      
}        
' This method handles the "Launch Url Builder UI" menu command.
' Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
Private Sub launchUrlBuilder(ByVal sender As Object, ByVal e As EventArgs)
    ' Create a parent control.
    Dim c As New System.Windows.Forms.Control()
    c.CreateControl()

    ' Launch the Url Builder using the specified control
    ' parent, initial URL, empty relative base URL path,
    ' window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl( _
        Me.Component, _
        c, _
        "http://www.example.com", _
        "Select a URL", _
        "", _
        UrlBuilderOptions.None)
End Sub

另请参阅

BuildUrl(IComponent, Control, String, String, String, UrlBuilderOptions)

使用指定的 UrlBuilderOptions 对象创建用户界面以创建或选取 URL。Creates a UI to create or pick a URL, using the specified UrlBuilderOptions object.

public:
 static System::String ^ BuildUrl(System::ComponentModel::IComponent ^ component, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter, System::Web::UI::Design::UrlBuilderOptions options);
public static string BuildUrl (System.ComponentModel.IComponent component, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter, System.Web.UI.Design.UrlBuilderOptions options);
static member BuildUrl : System.ComponentModel.IComponent * System.Windows.Forms.Control * string * string * string * System.Web.UI.Design.UrlBuilderOptions -> string
Public Shared Function BuildUrl (component As IComponent, owner As Control, initialUrl As String, caption As String, filter As String, options As UrlBuilderOptions) As String

参数

component
IComponent

将使用其站点来访问设计时服务的 IComponentThe IComponent whose site is to be used to access design-time services.

owner
Control

用作选择器窗口的父级的 ControlThe Control used as the parent for the picker window.

initialUrl
String

要在选择器窗口中显示的初始 URL。The initial URL to be shown in the picker window.

caption
String

选择器窗口的标题。The caption of the picker window.

filter
String

筛选字符串,用于有选择地筛选显示在选择器窗口中的文件。The filter string to use to optionally filter the files displayed in the picker window.

options
UrlBuilderOptions

指示 URL 选择的选项的 UrlBuilderOptionsA UrlBuilderOptions indicating the options for URL selection.

返回

从用户界面中返回的 URL。The URL returned from the UI.

示例

// Create a parent control.
System::Windows::Forms::Control^ c = gcnew System::Windows::Forms::Control;
c->CreateControl();

// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter String* and URLBuilderOptions value.
UrlBuilder::BuildUrl( this->Component, c, "http://www.example.com", "Select a URL", "", UrlBuilderOptions::None );

// This method handles the "Launch Url Builder UI" menu command.
// Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
private void launchUrlBuilder(object sender, EventArgs e)
{
    // Create a parent control.
    System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
    c.CreateControl();            
                
    // Launch the Url Builder using the specified control
    // parent, initial URL, empty relative base URL path,
    // window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl(
        this.Component, 
        c, 
        "http://www.example.com", 
        "Select a URL", 
        "", 
        UrlBuilderOptions.None);                      
}        
' This method handles the "Launch Url Builder UI" menu command.
' Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
Private Sub launchUrlBuilder(ByVal sender As Object, ByVal e As EventArgs)
    ' Create a parent control.
    Dim c As New System.Windows.Forms.Control()
    c.CreateControl()

    ' Launch the Url Builder using the specified control
    ' parent, initial URL, empty relative base URL path,
    ' window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl( _
        Me.Component, _
        c, _
        "http://www.example.com", _
        "Select a URL", _
        "", _
        UrlBuilderOptions.None)
End Sub

另请参阅

BuildUrl(IServiceProvider, Control, String, String, String, UrlBuilderOptions)

使用指定的 UrlBuilderOptions 对象创建用户界面以创建或选取 URL。Creates a UI to create or pick a URL, using the specified UrlBuilderOptions object.

public:
 static System::String ^ BuildUrl(IServiceProvider ^ serviceProvider, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter, System::Web::UI::Design::UrlBuilderOptions options);
public static string BuildUrl (IServiceProvider serviceProvider, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter, System.Web.UI.Design.UrlBuilderOptions options);
static member BuildUrl : IServiceProvider * System.Windows.Forms.Control * string * string * string * System.Web.UI.Design.UrlBuilderOptions -> string
Public Shared Function BuildUrl (serviceProvider As IServiceProvider, owner As Control, initialUrl As String, caption As String, filter As String, options As UrlBuilderOptions) As String

参数

serviceProvider
IServiceProvider

要用来访问设计时服务的 IServiceProviderThe IServiceProvider to be used to access design-time services.

owner
Control

用作选择器窗口的父级的 ControlThe Control used as the parent for the picker window.

initialUrl
String

要在选择器窗口中显示的初始 URL。The initial URL to be shown in the picker window.

caption
String

选择器窗口的标题。The caption of the picker window.

filter
String

筛选字符串,用于有选择地筛选显示在选择器窗口中的文件。The filter string to use to optionally filter the files displayed in the picker window.

options
UrlBuilderOptions

指示 URL 选择的选项的 UrlBuilderOptionsA UrlBuilderOptions indicating the options for URL selection.

返回

从用户界面中返回的 URL。The URL returned from the UI.

注解

接口用于获取设计器宿主的实现。IDesignerHost IServiceProviderThe IServiceProvider interface is used to obtain the IDesignerHost implementation for the designer host.

另请参阅

适用于