DataBinding.PropertyType Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene il tipo .NET Framework della proprietà del controllo server ASP.NET con associazione a dati.
public:
property Type ^ PropertyType { Type ^ get(); };
public Type PropertyType { get; }
member this.PropertyType : Type
Public ReadOnly Property PropertyType As Type
Valore della proprietà
Tipo .NET Framework della proprietà con associazione a dati.
Esempio
Nell'esempio di codice seguente vengono dichiarate tre variabili, dataBindingOutput1
, dataBindingOutput2
e dataBindingOutput3
, che accedono alle diverse proprietà di un DataBinding oggetto , myDataBinding2
. Il valore della PropertyType proprietà viene assegnato a dataBindingOutput2
e concatenato con la stringa "Il tipo di proprietà è " e scrive il valore in un file.
// Use the DataBindingCollection.GetEnumerator method
// to iterate through the myDataBindingCollection object
// and write the PropertyName, PropertyType, and Expression
// properties to a file for each DataBinding object
// in the MyDataBindingCollection object.
myDataBindingCollection = DataBindings;
IEnumerator myEnumerator = myDataBindingCollection.GetEnumerator();
while (myEnumerator.MoveNext())
{
myDataBinding2 = (DataBinding)myEnumerator.Current;
String dataBindingOutput1, dataBindingOutput2, dataBindingOutput3;
dataBindingOutput1 = String.Concat("The property name is ", myDataBinding2.PropertyName);
dataBindingOutput2 = String.Concat("The property type is ", myDataBinding2.PropertyType.ToString(), "-", dataBindingOutput1);
dataBindingOutput3 = String.Concat("The expression is ", myDataBinding2.Expression, "-", dataBindingOutput2);
WriteToFile(dataBindingOutput3);
myDataBindingExpression2 = String.Concat("<%#", myDataBinding2.Expression, "%>");
myStringReplace2 = myDataBinding2.PropertyName.Replace(".", "-");
myHtmlControlDesignBehavior.SetAttribute(myStringReplace2, myDataBindingExpression2);
int index = myStringReplace2.IndexOf('-');
}// while loop ends
' Use the DataBindingCollection.GetEnumerator method
' to iterate through the myDataBindingCollection object
' and write the PropertyName, PropertyType, and Expression
' properties to a file for each DataBinding object
' in the MyDataBindingCollection object.
myDataBindingCollection = DataBindings
Dim myEnumerator As IEnumerator = myDataBindingCollection.GetEnumerator()
While myEnumerator.MoveNext()
myDataBinding2 = CType(myEnumerator.Current, DataBinding)
Dim dataBindingOutput1, dataBindingOutput2, dataBindingOutput3 As [String]
dataBindingOutput1 = [String].Concat("The property name is ", myDataBinding2.PropertyName)
dataBindingOutput2 = [String].Concat("The property type is ", myDataBinding2.PropertyType.ToString(), "-", dataBindingOutput1)
dataBindingOutput3 = [String].Concat("The expression is ", myDataBinding2.Expression, "-", dataBindingOutput2)
WriteToFile(dataBindingOutput3)
myDataBindingExpression2 = [String].Concat("<%#", myDataBinding2.Expression, "%>")
myStringReplace2 = myDataBinding2.PropertyName.Replace(".", "-")
myHtmlControlDesignBehavior.SetAttribute(myStringReplace2, myDataBindingExpression2)
Dim index As Integer = myStringReplace2.IndexOf("-"c)
End While ' while loop ends
End Sub