MockResources 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
android.content.res.Resources
模擬類別。
[Android.Runtime.Register("android/test/mock/MockResources", DoNotGenerateAcw=true)]
public class MockResources : Android.Content.Res.Resources
[<Android.Runtime.Register("android/test/mock/MockResources", DoNotGenerateAcw=true)>]
type MockResources = class
inherit Resources
- 繼承
- 屬性
備註
android.content.res.Resources
模擬類別。 所有方法都是非功能性,而且會擲回 java.lang.UnsupportedOperationException
。 覆寫它以提供您需要的作業。
已取代這個成員。 使用模擬架構,例如 Mockito。 應該使用 Android測試支持連結庫撰寫新的測試。
的 android.test.mock.MockResources
Java 檔。
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
建構函式
MockResources() | |
MockResources(IntPtr, JniHandleOwnership) |
建立 JNI 物件的 Managed 表示法時使用的建構函式;由運行時間呼叫。 |
欄位
IdNull |
|
屬性
Assets |
擷取這些資源的基礎 AssetManager 記憶體。 (繼承來源 Resources) |
Class |
傳回這個 |
Configuration |
傳回此資源物件生效的目前組態。 (繼承來源 Resources) |
DisplayMetrics |
傳回此資源物件作用中的目前顯示計量。 (繼承來源 Resources) |
Handle |
基礎Android實例的句柄。 (繼承來源 Object) |
JniIdentityHashCode |
|
JniPeerMembers |
|
PeerReference |
|
ThresholdClass |
此 API 支援適用於 Android 的 Mono 基礎結構,並不適合直接從您的程式代碼使用。 |
ThresholdType |
此 API 支援適用於 Android 的 Mono 基礎結構,並不適合直接從您的程式代碼使用。 |
方法
AddLoaders(ResourcesLoader[]) |
將載入器新增至載入器清單。 (繼承來源 Resources) |
Clone() |
建立並傳回這個 對象的複本。 (繼承來源 Object) |
Dispose() |
|
Dispose(Boolean) |
|
Equals(Object) |
指出其他物件是否「等於」這個物件。 (繼承來源 Object) |
FinishPreloading() |
當完成預先載入資源時,由 zygote 呼叫,以變更回一般 Resources 作業。 (繼承來源 Resources) |
FlushLayoutCache() |
呼叫這個 ,以從 Resources 物件中移除所有快取載入的配置資源。 (繼承來源 Resources) |
GetAnimation(Int32) |
傳回 XmlResourceParser,您可以在其中讀取指定資源識別碼的動畫描述。 (繼承來源 Resources) |
GetBoolean(Int32) |
傳回與特定資源標識符相關聯的布爾值。 (繼承來源 Resources) |
GetColor(Int32) |
傳回與特定資源標識符相關聯的色彩整數。 (繼承來源 Resources) |
GetColor(Int32, Resources+Theme) |
傳回與特定資源標識符相關聯的色彩整數。 (繼承來源 Resources) |
GetColorStateList(Int32) |
傳回與特定資源標識符相關聯的色彩狀態清單。 (繼承來源 Resources) |
GetColorStateList(Int32, Resources+Theme) |
傳回與特定資源標識符相關聯的色彩狀態清單。 (繼承來源 Resources) |
GetDimension(Int32) |
擷取特定資源標識碼的維度。 (繼承來源 Resources) |
GetDimensionPixelOffset(Int32) |
擷取特定資源標識碼的維度,以作為原始圖元的位移。 (繼承來源 Resources) |
GetDimensionPixelSize(Int32) |
擷取特定資源標識碼的維度,以作為原始圖元的大小。 (繼承來源 Resources) |
GetDrawable(Int32) |
傳回與特定資源標識符相關聯的可繪製物件。 (繼承來源 Resources) |
GetDrawable(Int32, Resources+Theme) |
傳回與特定資源標識符相關聯的可繪製物件。 (繼承來源 Resources) |
GetDrawableForDensity(Int32, Int32) |
針對 DPI 中指定螢幕密度,傳回與特定資源識別符相關聯的可繪製物件。 (繼承來源 Resources) |
GetDrawableForDensity(Int32, Int32, Resources+Theme) |
針對 DPI 中指定螢幕密度,傳回與特定資源識別符相關聯的可繪製物件。 (繼承來源 Resources) |
GetFloat(Int32) |
擷取特定資源標識碼的浮點值。 (繼承來源 Resources) |
GetFont(Int32) |
傳回與特定資源標識符相關聯的 Typeface 值。 (繼承來源 Resources) |
GetFraction(Int32, Int32, Int32) |
擷取特定資源標識子的小數單位。 (繼承來源 Resources) |
GetHashCode() |
傳回此物件的雜湊碼值。 (繼承來源 Object) |
GetIdentifier(String, String, String) |
傳回指定資源名稱的資源識別碼。 (繼承來源 Resources) |
GetIntArray(Int32) |
傳回與特定資源標識符相關聯的 int 陣列。 (繼承來源 Resources) |
GetInteger(Int32) |
傳回與特定資源標識符相關聯的整數。 (繼承來源 Resources) |
GetLayout(Int32) |
傳回 XmlResourceParser,您可以在其中讀取指定資源識別碼的檢視配置描述。 (繼承來源 Resources) |
GetMovie(Int32) |
傳回與特定資源標識符相關聯的電影物件。 (繼承來源 Resources) |
GetQuantityString(Int32, Int32) |
傳回指定數量之指定資源識別碼的文法正確複數所需的字串。 (繼承來源 Resources) |
GetQuantityString(Int32, Int32, Object[]) |
傳回指定數量之指定資源識別碼的文法正確複數所需的字串。 (繼承來源 Resources) |
GetQuantityText(Int32, Int32) |
傳回指定數量之指定資源識別碼的文法正確複數所需的字元序列。 (繼承來源 Resources) |
GetQuantityTextFormatted(Int32, Int32) |
傳回指定數量之指定資源識別碼的文法正確複數所需的字元序列。 (繼承來源 Resources) |
GetResourceEntryName(Int32) |
傳回指定資源識別碼的項目名稱。 (繼承來源 Resources) |
GetResourceName(Int32) |
傳回指定資源識別碼的完整名稱。 (繼承來源 Resources) |
GetResourcePackageName(Int32) |
傳回指定資源識別碼的套件名稱。 (繼承來源 Resources) |
GetResourceTypeName(Int32) |
傳回指定資源識別碼的類型名稱。 (繼承來源 Resources) |
GetString(Int32) |
傳回與特定資源標識符相關聯的字串值。 (繼承來源 Resources) |
GetString(Int32, Object[]) |
|
GetStringArray(Int32) |
傳回與特定資源標識符相關聯的字串陣列。 (繼承來源 Resources) |
GetText(Int32) |
傳回與特定資源標識符相關聯的字串值。 (繼承來源 Resources) |
GetText(Int32, String) |
傳回與特定資源標識符相關聯的字串值。 (繼承來源 Resources) |
GetTextArray(Int32) |
傳回與特定資源標識符相關聯的樣式文字陣列。 (繼承來源 Resources) |
GetTextArrayFormatted(Int32) |
傳回與特定資源標識符相關聯的樣式文字陣列。 (繼承來源 Resources) |
GetTextFormatted(Int32) |
傳回與特定資源標識符相關聯的字串值。 (繼承來源 Resources) |
GetTextFormatted(Int32, ICharSequence) |
傳回與特定資源標識符相關聯的字串值。 (繼承來源 Resources) |
GetValue(Int32, TypedValue, Boolean) |
傳回與特定資源標識符相關聯的原始數據。 (繼承來源 Resources) |
GetValue(String, TypedValue, Boolean) |
傳回與特定資源標識符相關聯的原始數據。 (繼承來源 Resources) |
GetValueForDensity(Int32, Int32, TypedValue, Boolean) |
取得與具有相關聯密度之資源相關聯的原始值。 (繼承來源 Resources) |
GetXml(Int32) |
傳回 XmlResourceParser,您可以透過其中讀取指定資源識別碼的泛型 XML 資源。 (繼承來源 Resources) |
JavaFinalize() |
當垃圾收集決定不再參考物件時,垃圾收集行程在 物件上呼叫。 (繼承來源 Object) |
NewTheme() |
為這組資源產生新的 Theme 物件。 (繼承來源 Resources) |
Notify() |
喚醒正在等候此物件監視器的單一線程。 (繼承來源 Object) |
NotifyAll() |
喚醒正在等候此物件監視器的所有線程。 (繼承來源 Object) |
ObtainAttributes(IAttributeSet, Int32[]) |
從 AttributeSet 擷取一組基本屬性值,而不是使用主題和/或樣式資源執行它們的樣式。 (繼承來源 Resources) |
ObtainTypedArray(Int32) |
傳回異質值的陣列。 (繼承來源 Resources) |
OpenRawResource(Int32) |
開啟數據流以讀取原始資源。 (繼承來源 Resources) |
OpenRawResource(Int32, TypedValue) |
開啟數據流以讀取原始資源。 (繼承來源 Resources) |
OpenRawResourceFd(Int32) |
開啟檔案描述元以讀取原始資源。 (繼承來源 Resources) |
ParseBundleExtra(String, IAttributeSet, Bundle) |
將名稱/值組剖析出保存該資料的 XML 標記。 (繼承來源 Resources) |
ParseBundleExtras(XmlReader, Bundle) |
剖析 XML 檔案中的 |
RemoveLoaders(ResourcesLoader[]) |
從載入器清單中移除載入器。 (繼承來源 Resources) |
SetHandle(IntPtr, JniHandleOwnership) |
設定 Handle 屬性。 (繼承來源 Object) |
ToArray<T>() |
|
ToString() |
傳回物件的字串表示。 (繼承來源 Object) |
UnregisterFromRuntime() |
|
UpdateConfiguration(Configuration, DisplayMetrics) |
儲存新更新的組態。 (繼承來源 Resources) |
Wait() |
讓目前線程等候直到喚醒為止,通常是藉由em <notified/em>或<em>interrupted</em> 來喚醒它。<> (繼承來源 Object) |
Wait(Int64) |
讓目前的線程等到喚醒為止,通常是因為 <em>notified</em> 或 <em>interrupted</em>,或直到經過一定數量的實時為止。 (繼承來源 Object) |
Wait(Int64, Int32) |
讓目前的線程等到喚醒為止,通常是因為 <em>notified</em> 或 <em>interrupted</em>,或直到經過一定數量的實時為止。 (繼承來源 Object) |
明確介面實作
IJavaPeerable.Disposed() |
|
IJavaPeerable.DisposeUnlessReferenced() |
|
IJavaPeerable.Finalized() |
|
IJavaPeerable.JniManagedPeerState |
|
IJavaPeerable.SetJniIdentityHashCode(Int32) |
|
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
|
IJavaPeerable.SetPeerReference(JniObjectReference) |
|
擴充方法
JavaCast<TResult>(IJavaObject) |
執行 Android 執行時間檢查的類型轉換。 |
JavaCast<TResult>(IJavaObject) |
|
GetJniTypeName(IJavaPeerable) |
|