Поделиться через


VCCodeVariable.InitExpression - свойство

Gets or sets an object defining the initialization code for an element.

Пространство имен:  Microsoft.VisualStudio.VCCodeModel
Сборка:  Microsoft.VisualStudio.VCCodeModel (в Microsoft.VisualStudio.VCCodeModel.dll)

Синтаксис

'Декларация
Property InitExpression As Object
'Применение
Dim instance As VCCodeVariable
Dim value As Object

value = instance.InitExpression

instance.InitExpression = value
Object InitExpression { get; set; }
property Object^ InitExpression {
    Object^ get ();
    void set (Object^ value);
}
function get InitExpression () : Object
function set InitExpression (value : Object)

Значение свойства

Тип: System.Object

An object defining the initialization expression for the code variable.

Заметки

The value must be a string or a CodeElement for an expression object. When setting this to a string, the implementation of the property inserts any required syntax, such as equal signs or semicolons, if the variable does not already have an initialization expression.

Depending on the languages and any syntactic or semantic checks it performs on the string passed in, setting this property might fail. Languages are not required to check the string, and because the string is necessarily language-dependent, setting this property can result in undefined behavior if the string has ill-formed content.

When setting this property to a CodeElement, whether or not the CodeElement must be newly created depends on the language implementation of the code model. Some languages might implement copying semantics if you pass in a CodeElement that is already in a source file.

Разрешения

  • Полное доверие для непосредственно вызывающего метода. Этот член не может быть использован частично доверенным кодом. Дополнительные сведения см. в разделе Using Libraries from Partially Trusted Code.

См. также

Основные понятия

How to: Compile and Run the Automation Object Model Code Examples

Ссылки

VCCodeVariable Интерфейс

VCCodeVariable - члены

Microsoft.VisualStudio.VCCodeModel - пространство имен