本文整理汇总了C#中JniHandleOwnership类的典型用法代码示例。如果您正苦于以下问题:C# JniHandleOwnership类的具体用法?C# JniHandleOwnership怎么用?C# JniHandleOwnership使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JniHandleOwnership类属于命名空间,在下文中一共展示了JniHandleOwnership类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MainApp
public MainApp(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
// Catch unhandled exceptions
// Found at http://xandroid4net.blogspot.de/2013/11/how-to-capture-unhandled-exceptions.html
// Add an exception handler for all uncaught exceptions.
AndroidEnvironment.UnhandledExceptionRaiser += AndroidUnhandledExceptionHandler;
AppDomain.CurrentDomain.UnhandledException += ApplicationUnhandledExceptionHandler;
// Save prefernces instance
Main.Prefs = new PreferenceValues(PreferenceManager.GetDefaultSharedPreferences(this));
// Get path from preferences or default path
string path = Main.Prefs.GetString("filepath", Path.Combine(global::Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "WF.Player"));
try {
if (!Directory.Exists (path))
Directory.CreateDirectory (path);
}
catch {
}
if (!Directory.Exists (path))
{
AlertDialog.Builder builder = new AlertDialog.Builder (this);
builder.SetTitle (GetString (Resource.String.main_error));
builder.SetMessage(String.Format(GetString(Resource.String.main_error_directory_not_found), path));
builder.SetCancelable (true);
builder.SetNeutralButton(Resource.String.ok,(obj,arg) => { });
builder.Show ();
} else {
Main.Path = path;
Main.Prefs.SetString("filepath", path);
}
}
开发者ID:WFoundation,项目名称:WF.Player.Android,代码行数:34,代码来源:MainApp.cs
示例2: D3Calc
public D3Calc(IntPtr javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
{
RegisterPcl.Register();
D3Api.ApiKey = ApiKey;
}
开发者ID:djtms,项目名称:D3-Android-by-ZTn,代码行数:7,代码来源:D3Calc.cs
示例3: MainApplication
public MainApplication(IntPtr javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
{
var builder = new ContainerBuilder();
builder.Register(x => this).As<IApplicationLifecycle>();
builder.Update(ViewLocator.Instance.Container);
RegisterReceiver(new NetworkInformation(), new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
}
开发者ID:jsauve,项目名称:CurrencyConverter,代码行数:8,代码来源:MainApplication.cs
示例4: CreateLoginUserApplication
public CreateLoginUserApplication(IntPtr intPtr, JniHandleOwnership jho)
: base(intPtr, jho)
{
// TODO: Go to http://dev.buddyplatform.com to get an app ID and app key.
Buddy.Init ("\Your App ID", "\Your App Key");
CreateLoginUserLibrary.ActivtyBase.HomeActivityType = typeof(CreateLoginUserSample.ViewUserActivity);
}
开发者ID:nickatbuddy,项目名称:Buddy-DotNET-SDK,代码行数:8,代码来源:CreateLoginUserApplication.cs
示例5: Application
public Application(IntPtr javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer) {
//TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironment_UnhandledExceptionRaiser;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
}
开发者ID:gruan01,项目名称:Xamarin.Form.UWPTest,代码行数:8,代码来源:Application.cs
示例6: CustomApplication
public CustomApplication(IntPtr handle, JniHandleOwnership ownerShip)
: base(handle, ownerShip)
{
Iconics.RegisterFont(new Meteoconcs());
Iconics.RegisterFont(new Octicons());
Iconics.RegisterFont(new CommunityMaterial());
Iconics.RegisterFont(new CustomFont());
}
开发者ID:gitter-badger,项目名称:Android-Iconics-Xamarin,代码行数:8,代码来源:CustomApplication.cs
示例7: AlbumsApplication
public AlbumsApplication(IntPtr intPtr, JniHandleOwnership jho)
: base(intPtr, jho)
{
// TODO: Go to http://dev.buddyplatform.com to get an app ID and app password.
Buddy.Init ("", "");
CreateLoginUserLibrary.ActivtyBase.HomeActivityType = typeof(AlbumsSample.AlbumsActivity);
}
开发者ID:halukmy,项目名称:Buddy-DotNET-SDK,代码行数:8,代码来源:AlbumsApplication.cs
示例8: Application
/// <summary>
/// The constructor of the application class.
/// </summary>
/// <param name="javaReference"></param>
/// <param name="transfer"></param>
public Application(IntPtr javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
{
if (Default != null)
{
Default = this;
}
}
开发者ID:justdude,项目名称:DbExport,代码行数:13,代码来源:Application.cs
示例9: ZXingSurfaceView
protected ZXingSurfaceView(IntPtr javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
{
lastPreviewAnalysis = DateTime.Now.AddMilliseconds(options.InitialDelayBeforeAnalyzingFrames);
this.surface_holder = Holder;
this.surface_holder.AddCallback(this);
this.surface_holder.SetType(SurfaceType.PushBuffers);
this.tokenSource = new System.Threading.CancellationTokenSource();
}
开发者ID:jerryshen1987,项目名称:ZXing.Net.Mobile,代码行数:11,代码来源:ZXingSurfaceView.cs
示例10: MainApplication
public MainApplication (IntPtr handle, JniHandleOwnership transfer)
: base (handle, transfer)
{
BaseAppContext.Init();
//platform specific mappings
DI.MapClassToInterface<GetContactsDelegate, IGetContactsDelegate> ();
GetContactsDelegate.ABook = new Xamarin.Contacts.AddressBook (this.ApplicationContext);
}
开发者ID:krenhammer,项目名称:MonkeyArmsAddressBook,代码行数:11,代码来源:MainApplication.cs
示例11: FromJniHandle
public static ICollection FromJniHandle(IntPtr handle, JniHandleOwnership transfer)
{
if (handle == IntPtr.Zero)
return null;
IJavaObject inst = Java.Lang.Object.PeekObject (handle);
if (inst == null)
inst = new JavaCollection (handle, transfer);
else
JNIEnv.DeleteRef (handle, transfer);
return (ICollection) inst;
}
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:13,代码来源:JavaCollection.cs
示例12: FromNative
internal static Stream FromNative(IntPtr handle, JniHandleOwnership transfer)
{
if (handle == IntPtr.Zero)
return null;
IJavaObject inst = Java.Lang.Object.PeekObject (handle);
if (inst == null)
inst = Java.Interop.TypeManager.CreateInstance (handle, transfer);
else
JNIEnv.DeleteRef (handle, transfer);
return new OutputStreamInvoker ((Java.IO.OutputStream)inst);
}
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:14,代码来源:OutputStreamInvoker.cs
示例13: QmunicateApplication
public QmunicateApplication (IntPtr handle, JniHandleOwnership transfer)
: base (handle, transfer)
{
App.Version = AppVersionNumber (this);
// Create the broadcast receiver and bind the event handler
// so that the app gets updates of the network connectivity status
var _broadcastReceiver = new NetworkStatusBroadcastReceiver();
_broadcastReceiver.ConnectionStatusChanged += OnNetworkStatusChanged;
// Register the broadcast receiver
global::Android.App.Application.Context.RegisterReceiver(_broadcastReceiver,
new IntentFilter(ConnectivityManager.ConnectivityAction));
}
开发者ID:QuickBlox,项目名称:quickblox-dotnet-sdk,代码行数:14,代码来源:QmunicateApplication.cs
示例14: Throwable
public Throwable (IntPtr handle, JniHandleOwnership transfer)
: base (_GetMessage (handle), _GetInnerException (handle))
{
if (GetType () == typeof (Throwable))
is_generated = true;
// Check if handle was preset by our java activation mechanism
if (this.handle != IntPtr.Zero) {
needsActivation = true;
handle = this.handle;
if (handle_type != 0)
return;
transfer = JniHandleOwnership.DoNotTransfer;
}
SetHandle (handle, transfer);
}
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:17,代码来源:Throwable.cs
示例15: MainApplication
public MainApplication(IntPtr handle, JniHandleOwnership transfer)
: base(handle, transfer)
{
_logger = new Logger();
Insights.Initialize(Settings.XamarinInsightsApiKey, ApplicationContext);
AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
{
args.Handled = false;
_logger.Log(args.Exception as Exception, LogType.ERROR);
};
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
{
_logger.Log(e.ExceptionObject as Exception, LogType.ERROR);
};
}
开发者ID:EckyZero,项目名称:Hashtagg,代码行数:17,代码来源:MainApplication.cs
示例16: App
public App (IntPtr h, JniHandleOwnership jho) : base (h, jho)
{
Guid userId;
if (!Guid.TryParse (LoadPreference (SipperPreference.UserId), out userId)) {
userId = Guid.NewGuid ();
}
Guid deviceId;
if (!Guid.TryParse (LoadPreference (SipperPreference.DeviceId), out deviceId)) {
deviceId = Guid.NewGuid ();
}
User = new UserModel { Id = userId, DeviceId = deviceId };
var builder = new ContainerBuilder ();
builder.RegisterType<WebApiService> ().As<IWebApiService> ().WithParameter ("deviceId", deviceId);
builder.RegisterType<UserService> ().As<IUserService> ();
builder.RegisterType<SippService> ().As<ISippService> ();
builder.RegisterType<VoteService> ().As<IVoteService> ();
builder.RegisterType<PeekService> ().As<IPeekService> ();
builder.RegisterType<ExtraService> ().As<IExtraService> ();
Container = builder.Build ();
}
开发者ID:ppkdo,项目名称:sipper,代码行数:21,代码来源:App.cs
示例17: MainApp
public MainApp(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
// Save instance for later use
instance = this;
TestFlight.TakeOff(this, "0596e62a-e3cb-4107-8d05-96fa7ae0c26a");
// Catch unhandled exceptions
// Found at http://xandroid4net.blogspot.de/2013/11/how-to-capture-unhandled-exceptions.html
// Add an exception handler for all uncaught exceptions.
AndroidEnvironment.UnhandledExceptionRaiser += AndroidUnhandledExceptionHandler;
AppDomain.CurrentDomain.UnhandledException += ApplicationUnhandledExceptionHandler;
preferences = Application.Context.GetSharedPreferences("WF.Player.preferences", FileCreationMode.MultiProcess);
path = preferences.GetString("path", "");
if (String.IsNullOrEmpty(path))
path = global::Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + Java.IO.File.Separator + "WF.Player";
try {
if (!Directory.Exists (path))
Directory.CreateDirectory (path);
}
catch {
}
if (!Directory.Exists (path))
{
AlertDialog.Builder builder = new AlertDialog.Builder (this);
builder.SetTitle (GetString (Resource.String.main_error));
builder.SetMessage(String.Format(GetString(Resource.String.main_error_directory_not_found), path));
builder.SetCancelable (true);
builder.SetNeutralButton(Resource.String.ok,(obj,arg) => { });
builder.Show ();
} else {
preferences.Edit().PutString("path", path).Commit();
}
}
开发者ID:jonny65,项目名称:WF.Player.Android,代码行数:39,代码来源:Main.cs
示例18: BitmapDrawableResource
protected BitmapDrawableResource (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer) {}
开发者ID:thanhdatbkhn,项目名称:GlideXamarinBinding,代码行数:1,代码来源:Com.Bumptech.Glide.Load.Resource.Bitmap.BitmapDrawableResource.cs
示例19: SuggestionSearchOption
protected SuggestionSearchOption (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer) {}
开发者ID:lq-ever,项目名称:CommunityCenter,代码行数:1,代码来源:Com.Baidu.Mapapi.Search.Sug.SuggestionSearchOption.cs
示例20: TransformationUtils
internal TransformationUtils (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer) {}
开发者ID:thanhdatbkhn,项目名称:GlideXamarinBinding,代码行数:1,代码来源:Com.Bumptech.Glide.Load.Resource.Bitmap.TransformationUtils.cs
注:本文中的JniHandleOwnership类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论