Exemplo n.º 1
0
 /// <summary>
 /// Create instance of the asynchronous forwarding appender.
 /// </summary>
 public AsyncAppender()
 {
     Layout       = new AsyncNullLayout();
     Strategy     = new AsyncStrategyHotSwap();
     Appender     = new AsyncNullAppender();
     ErrorHandler = new AsyncErrorHandler(this);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Prepares the app for use.
        /// </summary>
        private async Task InitalizeAsync()
        {
            Application.Current.UnhandledException += (s, e) => AsyncErrorHandler.HandleException(e.Exception);

            AuthenticationHelper.UserLoggedIn += async(s, e) =>
            {
                User = e;
                SynchronizationHelper.RecursiveRegisterPropertyChanged(e);
                var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

                var hub = new NotificationHub(HubName, HubEndpoint);
                await hub.RegisterNativeAsync(channel.Uri, new[] { User.Email });
            };

            await AuthenticationHelper.TryLogInSilently();

            if (App.User != null)
            {
                Window.Current.Content = new Views.Shell();
            }
            else
            {
                Window.Current.Content = new Views.Welcome();
            }
            Window.Current.Activate();
        }
Exemplo n.º 3
0
        internal IntPtr AllocNativeInitParams(IntPtr aCallbackPtr)
        {
            IntPtr nativeParams = OhNetInitParamsCreate();

            if (LogOutput != null)
            {
                OhNetInitParamsSetLogOutput(nativeParams, LogOutput.Callback, LogOutput.Handle());
            }
            if (FatalErrorHandler != null)
            {
                OhNetInitParamsSetFatalErrorHandler(nativeParams, FatalErrorHandler.Callback, FatalErrorHandler.Handle());
            }
            if (AsyncBeginHandler != null)
            {
                OhNetInitParamsSetAsyncBeginHandler(nativeParams, AsyncBeginHandler.Callback, AsyncBeginHandler.Handle());
            }
            if (AsyncEndHandler != null)
            {
                OhNetInitParamsSetAsyncEndHandler(nativeParams, AsyncEndHandler.Callback, AsyncEndHandler.Handle());
            }
            if (AsyncErrorHandler != null)
            {
                OhNetInitParamsSetAsyncErrorHandler(nativeParams, AsyncErrorHandler.Callback, AsyncErrorHandler.Handle());
            }
            if (SubnetListChangedListener != null)
            {
                OhNetInitParamsSetSubnetListChangedListener(nativeParams, SubnetListChangedListener.Callback, SubnetListChangedListener.Handle());
            }
            if (SubnetAddedListener != null)
            {
                OhNetInitParamsSetSubnetAddedListener(nativeParams, SubnetAddedListener.Callback, SubnetAddedListener.Handle());
            }
            if (SubnetRemovedListener != null)
            {
                OhNetInitParamsSetSubnetRemovedListener(nativeParams, SubnetRemovedListener.Callback, SubnetRemovedListener.Handle());
            }
            if (NetworkAdapterChangedListener != null)
            {
                OhNetInitParamsSetNetworkAdapterChangedListener(nativeParams, NetworkAdapterChangedListener.Callback, NetworkAdapterChangedListener.Handle());
            }
            OhNetInitParamsSetTcpConnectTimeout(nativeParams, TcpConnectTimeoutMs);
            OhNetInitParamsSetMsearchTime(nativeParams, MsearchTimeSecs);
            OhNetInitParamsSetMsearchTtl(nativeParams, MsearchTtl);
            OhNetInitParamsSetNumEventSessionThreads(nativeParams, NumEventSessionThreads);
            OhNetInitParamsSetNumXmlFetcherThreads(nativeParams, NumXmlFetcherThreads);
            OhNetInitParamsSetNumActionInvokerThreads(nativeParams, NumActionInvokerThreads);
            OhNetInitParamsSetNumInvocations(nativeParams, NumInvocations);
            OhNetInitParamsSetNumSubscriberThreads(nativeParams, NumSubscriberThreads);
            OhNetInitParamsSetSubscriptionDuration(nativeParams, SubscriptionDurationSecs);
            OhNetInitParamsSetPendingSubscriptionTimeout(nativeParams, PendingSubscriptionTimeoutMs);
            OhNetInitParamsSetDvMaxUpdateTime(nativeParams, DvMaxUpdateTimeSecs);
            OhNetInitParamsSetDvNumServerThreads(nativeParams, DvNumServerThreads);
            OhNetInitParamsSetDvNumPublisherThreads(nativeParams, DvNumPublisherThreads);
            OhNetInitParamsSetDvNumWebSocketThreads(nativeParams, DvNumWebSocketThreads);
            OhNetInitParamsSetCpUpnpEventServerPort(nativeParams, CpUpnpEventPort);
            OhNetInitParamsSetDvUpnpServerPort(nativeParams, DvUpnpWebServerPort);
            OhNetInitParamsSetDvWebSocketPort(nativeParams, DvWebSocketPort);
            if (DvEnableBonjour)
            {
                OhNetInitParamsSetDvEnableBonjour(nativeParams);
            }
            if (UseLoopbackNetworkAdapter)
            {
                OhNetInitParamsSetUseLoopbackNetworkAdapter(nativeParams);
            }
            return(nativeParams);
        }