Share via


Property.Name 속성

개체의 이름을 가져옵니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
ReadOnly Property Name As String
string Name { get; }
property String^ Name {
    String^ get ();
}
abstract Name : string with get
function get Name () : String

속성 값

형식: String
개체의 이름을 나타내는 문자열 값입니다.

예제

public void CodeExample(DTE2 dte)
{  
    try
    {   // Open a solution before running this example
        Properties props = dte.Solution.Properties;
        Property prop;
        string msg = "";
        if (props.Count > 0)
        {
            prop = props.Item(1); // Get first property
            msg += "\nThis Property is named: " + prop.Name;
            msg += "\nThis Property is located in a collection within 
            the following solution: " + 
            ((Solution)prop.Collection.Parent).FullName;
            if (prop.Parent.Equals(prop.Collection))
                msg += "\nThe parent and collection properties return 
                the same object.";
            msg += "\nThe DTE property returns: " + prop.DTE.Name;
        }
        MessageBox.Show(msg, "Property Object");
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 보안

참고 항목

참조

Property 인터페이스

EnvDTE 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행