Feature.GetValueOrDefault
inhoud
[
verbergen
]GetValueOrDefault<T>(string)
Krijgt de waarde van een attribuut, ofDefaultValue als de waarde niet is ingesteld ofnul .
public T GetValueOrDefault<T>(string attributeName)
| Parameter | Beschrijving |
|---|---|
| T | Gewenst type voor de waarde. |
| attributeName | Naam van het attribuut. |
Winstwaarde
Waarde van het attribuut.
Uitzonderingen
| uitzondering | voorwaarde |
|---|---|
| ArgumentNullException | De attribuutnaam isnull. |
| ArgumentException | Het attribuut met deze naam bestaat niet in deze laag. |
| InvalidOperationException | Het attribuut is niet vergrendeld. |
| InvalidOperationException | De waarde van dit attribuut is niet ingesteld voor dit object. |
| InvalidCastException | Het aangevraagde type wordt niet geïmplementeerdIConvertible. |
| InvalidCastException | Waarde van het attribuut isnull, maar het aangevraagde type is een waardetype. |
| FormatException | Conversie is mislukt omdat de waarde een onjuist formaat heeft. |
| OverflowException | Conversie mislukt vanwege overflow. |
Opmerkingen
Deze methode converteert de waarde automatisch naar het type dat wordt gevraagd in de generieke typeparameter.
Zie ook
- class Feature
- naamruimte Aspose.Gis
- montage Aspose.GIS
GetValueOrDefault(string, object)
Krijgt de waarde van een attribuut, ofDefaultValue als de waarde niet is ingesteld ofnul .
public object GetValueOrDefault(string attributeName, object defaultValue = null)
| Parameter | Type | Beschrijving |
|---|---|---|
| attributeName | String | Naam van het attribuut. |
| defaultValue | Object | De waarde die moet worden geretourneerd als de kenmerkwaarde ontbreekt. Standaardwaarde isnull . |
Winstwaarde
Waarde van het attribuut.
Uitzonderingen
| uitzondering | voorwaarde |
|---|---|
| ArgumentNullException | De attribuutnaam isnull. |
| ArgumentException | Het attribuut met deze naam bestaat niet in deze laag. |
| InvalidOperationException | Het attribuut is niet vergrendeld. |
| InvalidOperationException | De waarde van dit attribuut is niet ingesteld voor dit object. |
Zie ook
- class Feature
- naamruimte Aspose.Gis
- montage Aspose.GIS
GetValueOrDefault<T>(string, object)
Krijgt de waarde van een attribuut, ofDefaultValue als de waarde niet is ingesteld ofnul .
public T GetValueOrDefault<T>(string attributeName, object defaultValue)
| Parameter | Beschrijving |
|---|---|
| T | Gewenst type voor de waarde. |
| attributeName | Naam van het attribuut. |
| defaultValue | De waarde die moet worden geretourneerd als de kenmerkwaarde ontbreekt. |
Winstwaarde
Waarde van het attribuut.
Uitzonderingen
| uitzondering | voorwaarde |
|---|---|
| ArgumentNullException | De attribuutnaam isnull. |
| ArgumentException | Het attribuut met deze naam bestaat niet in deze laag. |
| InvalidOperationException | Het attribuut is niet vergrendeld. |
| InvalidOperationException | De waarde van dit attribuut is niet ingesteld voor dit object. |
| InvalidCastException | Het aangevraagde type wordt niet geïmplementeerdIConvertible. |
| InvalidCastException | Waarde van het attribuut isnull, maar het aangevraagde type is een waardetype. |
| FormatException | Conversie is mislukt omdat de waarde een onjuist formaat heeft. |
| OverflowException | Conversie mislukt vanwege overflow. |
Opmerkingen
Deze methode converteert de waarde automatisch naar het type dat wordt gevraagd in de generieke typeparameter.
Zie ook
- class Feature
- naamruimte Aspose.Gis
- montage Aspose.GIS