AutomationElement.ProcessIdProperty Bidang
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
ProcessId Mengidentifikasi properti .
public: static initonly System::Windows::Automation::AutomationProperty ^ ProcessIdProperty;
public static readonly System.Windows.Automation.AutomationProperty ProcessIdProperty;
staticval mutable ProcessIdProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly ProcessIdProperty As AutomationProperty
Nilai Bidang
Contoh
Contoh berikut mengambil nilai properti saat ini. Nilai default dikembalikan jika elemen tidak menyediakannya.
int processIdentifier = (int)
autoElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty);
Dim processIdentifier As Integer = _
CInt(autoElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty))
Contoh berikut mengambil nilai properti saat ini, tetapi menentukan bahwa jika elemen itu sendiri tidak memberikan nilai untuk properti , NotSupported akan dikembalikan alih-alih nilai default.
int processIdentifier1;
object processIdentifierNoDefault =
autoElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty, true);
if (processIdentifierNoDefault == AutomationElement.NotSupported)
{
// TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
processIdentifier1 = (int)processIdentifierNoDefault;
}
Dim processIdentifier1 As Integer
Dim processIdentifierNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty, True)
If processIdentifierNoDefault Is AutomationElement.NotSupported Then
' TODO Handle the case where you do not wish to proceed using the default value.
Else
processIdentifier1 = CInt(processIdentifierNoDefault)
End If
Keterangan
Pengidentifikasi ini digunakan oleh aplikasi klien Automation UI. Penyedia Automation UI harus menggunakan pengidentifikasi yang setara di AutomationElementIdentifiers.
Properti ini juga dapat diambil dari Current properti atau Cached .
Nilai yang dikembalikan dari properti berjenis Int32. Nilai default untuk properti adalah 0.