ConnectionStringEditor 클래스

정의

디자인 타임에 연결 문자열 속성을 선택하고 편집하는 데 사용할 사용자 인터페이스에 대한 기본 클래스를 제공합니다.

public ref class ConnectionStringEditor : System::Drawing::Design::UITypeEditor
public class ConnectionStringEditor : System.Drawing.Design.UITypeEditor
type ConnectionStringEditor = class
    inherit UITypeEditor
Public Class ConnectionStringEditor
Inherits UITypeEditor
상속
ConnectionStringEditor
파생

예제

다음 코드 예제에는 인스턴스에 연결 하는 방법을 보여 줍니다.는 ConnectionStringEditor 사용자 지정 컨트롤에 포함 된 속성이 있는 클래스입니다. 디자인 화면에서 컨트롤 속성을 편집할 때는 ConnectionStringEditor 클래스는 선택한 속성 값에 대 한 연결 문자열을 편집 하는 사용자 인터페이스를 제공 합니다.

// Define a custom class derived from the SqlDataSource Web control. 
public class SqlDataSourceWithBackup : SqlDataSource
{
    private string _alternateConnectionString;

    // Define an alternate connection string, which could be used
    // as a fallback value if the primary connection string fails.
    
    // The EditorAttribute indicates the property can
    // be edited at design-time with the ConnectionStringEditor class.
    [
      DefaultValue(""),
      EditorAttribute(typeof(System.Web.UI.Design.ConnectionStringEditor),
                     typeof(System.Drawing.Design.UITypeEditor)),
      Category("Data"),
      Description("The alternate connection string.")
    ]
    public string AlternateConnectionString
    {
        get
        {
            return _alternateConnectionString;
        }
        set
        {
            _alternateConnectionString = value;
        }
    }
}
' Define a custom class derived from the SqlDataSource Web control. 
Public Class SqlDataSourceWithBackup
    Inherits SqlDataSource

    Private _alternateConnectionString As String

    ' Define an alternate connection string, which could be used
    ' as a fallback value if the primary connection string fails.

    ' The EditorAttribute indicates the property can
    ' be edited at design-time with the ConnectionStringEditor class.
    <DefaultValue(""), _
     EditorAttribute(GetType(System.Web.UI.Design.ConnectionStringEditor), _
         GetType(System.Drawing.Design.UITypeEditor)), _
     Category("Data"), _
     Description("The alternate connection string.")> _
   Public Property AlternateConnectionString() As String

        Get
            Return _alternateConnectionString
        End Get
        Set(ByVal value As String)
            _alternateConnectionString = value
        End Set
    End Property

End Class

설명

인스턴스를 ConnectionStringEditor 클래스를 UITypeEditor 선택 하 고 연결 문자열 식을 편집 하 고 컨트롤 속성에 식을 할당할 디자인 타임에 사용할 수 있는 개체입니다. 예를 들어 합니다 SqlDataSource 컨트롤이 사용 하는 ConnectionStringEditor 디자인 타임에 값을 설정 하는 클래스를 ConnectionString 속성입니다.

사용 합니다 EditorAttribute 연결할 특성을 ConnectionStringEditor 속성을 사용 하 여 합니다. 디자이너 호스트를 호출 하는 연결된 된 속성을 디자인 화면에서 편집 하는 경우는 EditValue 메서드. EditValue 메서드는 연결 문자열 식을 작성 하기 위한 사용자 인터페이스를 표시 하 고 사용자가 선택 되어 있는 연결 문자열을 반환 합니다. GetEditStyle 메서드는 사용자 인터페이스의 표시 스타일을 나타냅니다.

생성자

ConnectionStringEditor()

ConnectionStringEditor 클래스의 새 인스턴스를 초기화합니다.

속성

IsDropDownResizable

드롭다운 편집기를 사용자가 크기 조정할 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 UITypeEditor)

메서드

EditValue(IServiceProvider, Object)

GetEditStyle() 메서드에 표시된 편집기 스타일을 사용하여 지정된 개체의 값을 편집합니다.

(다음에서 상속됨 UITypeEditor)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

지정된 서비스 공급자와 컨텍스트를 사용하여 지정된 개체의 값을 편집합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetEditStyle()

EditValue(IServiceProvider, Object) 메서드에서 사용하는 편집기 스타일을 가져옵니다.

(다음에서 상속됨 UITypeEditor)
GetEditStyle(ITypeDescriptorContext)

지정된 컨텍스트에 대해 연결 문자열 편집기와 연결된 편집 스타일을 반환합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetPaintValueSupported()

이 편집기에서 개체 값 표현를 칠할 수 있는지 여부를 나타냅니다.

(다음에서 상속됨 UITypeEditor)
GetPaintValueSupported(ITypeDescriptorContext)

지정된 컨텍스트에서 지정된 컨텍스트 내의 개체 값 표현를 칠할 수 있는지 여부를 나타냅니다.

(다음에서 상속됨 UITypeEditor)
GetProviderName(Object)

제공된 ConnectionStringEditor 클래스 인스턴스에 대한 공급자 이름을 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
PaintValue(Object, Graphics, Rectangle)

지정된 개체의 값 표시를 지정된 캔버스에 칠합니다.

(다음에서 상속됨 UITypeEditor)
PaintValue(PaintValueEventArgs)

지정된 PaintValueEventArgs를 사용하여 개체 값 표현를 칠합니다.

(다음에서 상속됨 UITypeEditor)
SetProviderName(Object, DesignerDataConnection)

지정된 ConnectionStringEditor 클래스 인스턴스에서 공급자 이름을 설정합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보