語言

MockResources 類別

定義

警告

This class is obsoleted in this android platform

模擬 android.content.res.Resources 課。

[Android.Runtime.Register("android/test/mock/MockResources", DoNotGenerateAcw=true)]
[System.Obsolete("This class is obsoleted in this android platform")]
public class MockResources : Android.Content.Res.Resources
[<Android.Runtime.Register("android/test/mock/MockResources", DoNotGenerateAcw=true)>]
[<System.Obsolete("This class is obsoleted in this android platform")>]
type MockResources = class
    inherit Resources
繼承
屬性

備註

模擬 android.content.res.Resources 課。 所有方法皆非函數式,且拋出 java.lang.UnsupportedOperationException。 覆蓋它以提供你需要的操作。

此會員已被棄用。 使用像 Mockite 這樣的模擬框架。 新的測試應使用 Android 測試支援函式庫撰寫。

Java 文件 android.test.mock.MockResources。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

建構函式

名稱 Description
MockResources()
MockResources(IntPtr, JniHandleOwnership)
已淘汰.

用於建立 JNI 物件受管理表示的建構器;由執行時呼叫。

欄位

名稱 Description
IdNull
已淘汰.

資源 null ID。

(繼承來源 Resources)

屬性

名稱 Description
Assets
已淘汰.

取得這些資源的底層資產管理儲存。

(繼承來源 Resources)
Class
已淘汰.

回傳此 Object的執行時類別。

(繼承來源 Object)
Configuration
已淘汰.

回傳該資源物件目前生效的設定。

(繼承來源 Resources)
DisplayMetrics
已淘汰.

回傳該資源物件目前生效的顯示指標。

(繼承來源 Resources)
Handle
已淘汰.

底層 Android 實例的帳號。

(繼承來源 Object)
JniIdentityHashCode
已淘汰.

取得由互通執行時指派給此 Java 對等端的身份雜湊碼。

(繼承來源 Object)
JniManagedPeerState
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
JniPeerMembers
已淘汰.

模擬 android.content.res.Resources 課。

PeerReference
已淘汰.

取得這個 Java 節點的 JNI 物件參考。

(繼承來源 Object)
ThresholdClass
已淘汰.

此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。

ThresholdType
已淘汰.

此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。

方法

名稱 Description
AddLoaders(ResourcesLoader[])
已淘汰.

將一個載入器加入載入器清單。

(繼承來源 Resources)
Clone()
已淘汰.

建立並回傳此物件的副本。

(繼承來源 Object)
Construct(JniObjectReference, JniObjectReferenceOptions)
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
Dispose()
已淘汰.

釋放該 Java 節點所持有的資源。

(繼承來源 Object)
Dispose(Boolean)
已淘汰.

釋放該 Java 節點所持有的資源。

(繼承來源 Object)
DisposeUnlessReferenced()
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
Equals(Object)
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
Equals(Object)
已淘汰.

表示是否有其他物體「等同」於此物。

(繼承來源 Object)
FinishPreloading()
已淘汰.

受精卵在完成資源預載時呼叫,將資源操作恢復正常。

(繼承來源 Resources)
FlushLayoutCache()
已淘汰.

呼叫此功能以移除 Resources 物件中所有快取載入的版面資源。

(繼承來源 Resources)
GetAnimation(Int32)
已淘汰.

回傳一個 XmlResourceParser,透過它你可以讀取該資源 ID 的動畫描述。

(繼承來源 Resources)
GetBoolean(Int32)
已淘汰.

回傳與特定資源 ID 相關的布林值。

(繼承來源 Resources)
GetColor(Int32, Resources+Theme)
已淘汰.

回傳與特定資源 ID 相關的彩色整數。

(繼承來源 Resources)
GetColor(Int32)
已淘汰.

回傳與特定資源 ID 相關的彩色整數。

(繼承來源 Resources)
GetColorStateList(Int32, Resources+Theme)
已淘汰.

回傳與特定資源 ID 相關的色彩狀態清單。

(繼承來源 Resources)
GetColorStateList(Int32)
已淘汰.

回傳與特定資源 ID 相關的色彩狀態清單。

(繼承來源 Resources)
GetDimension(Int32)
已淘汰.

取得特定資源 ID 的一個維度。

(繼承來源 Resources)
GetDimensionPixelOffset(Int32)
已淘汰.

取得特定資源 ID 的一個維度,作為原始像素的偏移量。

(繼承來源 Resources)
GetDimensionPixelSize(Int32)
已淘汰.

取得特定資源 ID 的一個維度,作為原始像素的大小。

(繼承來源 Resources)
GetDrawable(Int32, Resources+Theme)
已淘汰.

回傳與特定資源 ID 相關的可繪製物件。

(繼承來源 Resources)
GetDrawable(Int32)
已淘汰.

回傳與特定資源 ID 相關的可繪製物件。

(繼承來源 Resources)
GetDrawableForDensity(Int32, Int32, Resources+Theme)
已淘汰.

回傳一個可繪製的物件,對應特定資源 ID 並符合 DPI 的螢幕密度。

(繼承來源 Resources)
GetDrawableForDensity(Int32, Int32)
已淘汰.

回傳一個可繪製的物件,對應特定資源 ID 並符合 DPI 的螢幕密度。

(繼承來源 Resources)
GetFloat(Int32)
已淘汰.

取得特定資源 ID 的浮點數值。

(繼承來源 Resources)
GetFont(Int32)
已淘汰.

回傳與特定資源 ID 相關的字體值。

(繼承來源 Resources)
GetFraction(Int32, Int32, Int32)
已淘汰.

取得特定資源 ID 的分數單位。

(繼承來源 Resources)
GetHashCode()
已淘汰.

回傳物件的雜湊碼值。

(繼承來源 Object)
GetIdentifier(String, String, String)
已淘汰.

回傳給定資源名稱的資源識別碼。

(繼承來源 Resources)
GetIntArray(Int32)
已淘汰.

回傳與特定資源 ID 相關的整數陣列。

(繼承來源 Resources)
GetInteger(Int32)
已淘汰.

回傳與特定資源 ID 相關的整數。

(繼承來源 Resources)
GetLayout(Int32)
已淘汰.

回傳一個 XmlResourceParser,透過它你可以閱讀給定資源 ID 的視圖佈局描述。

(繼承來源 Resources)
GetMovie(Int32)
已淘汰.

回傳與特定資源 ID 相關的電影物件。

(繼承來源 Resources)
GetQuantityString(Int32, Int32, Object[])
已淘汰.

回傳給定資源 ID 對指定數量的文法正確複數化所需的字串。

(繼承來源 Resources)
GetQuantityString(Int32, Int32)
已淘汰.

回傳給定資源 ID 對指定數量的文法正確複數化所需的字串。

(繼承來源 Resources)
GetQuantityText(Int32, Int32)
已淘汰.

回傳給定資源 ID 語法正確複數所需的字元序列。

(繼承來源 Resources)
GetQuantityTextFormatted(Int32, Int32)
已淘汰.

回傳給定資源 ID 語法正確複數所需的字元序列。

(繼承來源 Resources)
GetResourceEntryName(Int32)
已淘汰.

回傳給定資源識別碼的條目名稱。

(繼承來源 Resources)
GetResourceName(Int32)
已淘汰.

回傳給定資源識別碼的全名。

(繼承來源 Resources)
GetResourcePackageName(Int32)
已淘汰.

回傳給定資源識別碼的套件名稱。

(繼承來源 Resources)
GetResourceTypeName(Int32)
已淘汰.

回傳給定資源識別碼的型別名稱。

(繼承來源 Resources)
GetString(Int32, Object[])
已淘汰.

回傳一個以所提供參數格式化的字串資源。

(繼承來源 Resources)
GetString(Int32)
已淘汰.

回傳與特定資源 ID 相關的字串值。

(繼承來源 Resources)
GetStringArray(Int32)
已淘汰.

回傳與特定資源 ID 相關的字串陣列。

(繼承來源 Resources)
GetText(Int32, String)
已淘汰.

回傳與特定資源 ID 相關的字串值。

(繼承來源 Resources)
GetText(Int32)
已淘汰.

回傳與特定資源 ID 相關的字串值。

(繼承來源 Resources)
GetTextArray(Int32)
已淘汰.

回傳與特定資源 ID 相關的樣式文字陣列。

(繼承來源 Resources)
GetTextArrayFormatted(Int32)
已淘汰.

回傳與特定資源 ID 相關的樣式文字陣列。

(繼承來源 Resources)
GetTextFormatted(Int32, ICharSequence)
已淘汰.

回傳與特定資源 ID 相關的字串值。

(繼承來源 Resources)
GetTextFormatted(Int32)
已淘汰.

回傳與特定資源 ID 相關的字串值。

(繼承來源 Resources)
GetValue(Int32, TypedValue, Boolean)
已淘汰.

回傳與特定資源 ID 相關的原始資料。

(繼承來源 Resources)
GetValue(String, TypedValue, Boolean)
已淘汰.

回傳與特定資源 ID 相關的原始資料。

(繼承來源 Resources)
GetValueForDensity(Int32, Int32, TypedValue, Boolean)
已淘汰.

取得與相關密度資源相關的原始值。

(繼承來源 Resources)
GetXml(Int32)
已淘汰.

回傳一個 XmlResourceParser 來讀取給定資源 ID 的通用 XML 資源。

(繼承來源 Resources)
JavaFinalize()
已淘汰.

當垃圾回收判定該物件不再有相關參考時,由垃圾回收器呼叫。

(繼承來源 Object)
NewTheme()
已淘汰.

為這組資源產生一個新的主題物件。

(繼承來源 Resources)
Notify()
已淘汰.

喚醒一個正在該物件監視器上等待的執行緒。

(繼承來源 Object)
NotifyAll()
已淘汰.

喚醒所有等待該物件監視器的執行緒。

(繼承來源 Object)
ObtainAttributes(IAttributeSet, Int32[])
已淘汰.

從屬性集取得一組基本屬性值,而非使用主題和/或樣式資源來進行樣式調整。

(繼承來源 Resources)
ObtainTypedArray(Int32)
已淘汰.

回傳一組異質數值。

(繼承來源 Resources)
OpenRawResource(Int32, TypedValue)
已淘汰.

開啟資料串流來讀取原始資源。

(繼承來源 Resources)
OpenRawResource(Int32)
已淘汰.

開啟資料串流來讀取原始資源。

(繼承來源 Resources)
OpenRawResourceFd(Int32)
已淘汰.

打開一個檔案描述符來讀取原始資源。

(繼承來源 Resources)
ParseBundleExtra(String, IAttributeSet, Bundle)
已淘汰.

從儲存該資料的 XML 標籤中解析出一對名稱/值對。

(繼承來源 Resources)
ParseBundleExtras(XmlReader, Bundle)
已淘汰.

從 XML 檔案解析一系列 android.R.styleable#Extra &lt;extra&gt; 標籤。

(繼承來源 Resources)
RemoveLoaders(ResourcesLoader[])
已淘汰.

將載入器從載入器列表中移除。

(繼承來源 Resources)
SetHandle(IntPtr, JniHandleOwnership)
已淘汰.

設定 Handle 屬性。

(繼承來源 Object)
SetPeerReference(JniObjectReference, JniObjectReferenceOptions)
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
ToArray<T>()
已淘汰.

從這個 Java 陣列包裝器建立一個受管理陣列。

(繼承來源 Object)
ToString()
已淘汰.

回傳物件的字串表示。

(繼承來源 Object)
UnregisterFromRuntime()
已淘汰.

將此 Java 節點從互通執行時中取消註冊。

(繼承來源 Object)
UpdateConfiguration(Configuration, DisplayMetrics)
已淘汰.

儲存新更新的設定。

(繼承來源 Resources)
Wait()
已淘汰.

導致目前執行緒等待被喚醒,通常是透過 <em>通知</><em 或 em>中斷</em> 來喚醒。

(繼承來源 Object)
Wait(Int64, Int32)
已淘汰.

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)
Wait(Int64)
已淘汰.

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)

明確介面實作

名稱 Description
IJavaPeerable.Disposed()
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
IJavaPeerable.Finalized()
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32)
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference)
已淘汰.

模擬 android.content.res.Resources 課。

(繼承來源 JavaObject)

擴充方法

名稱 Description
GetJniTypeName(IJavaPeerable)
已淘汰.

取得實例 self類型的 JNI 名稱。

JavaAs<TResult>(IJavaPeerable)
已淘汰.

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

JavaCast<TResult>(IJavaObject)
已淘汰.

執行 Android 執行時檢查型別轉換。

JavaCast<TResult>(IJavaObject)
已淘汰.

模擬 android.content.res.Resources 課。

TryJavaCast<TResult>(IJavaPeerable, TResult)
已淘汰.

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

適用於