예제 #1
0
        static int Main()
        {
            TimeService.Current         = new TimeService();
            EnvironmentSettings.Current = new EnvironmentSettings();
            FileSystem.Current          = new FileSystem();
            ArchiveFactory.Current      = new ArchiveFactory();
            HttpRequestManager.Current  = new HttpRequestManager();
            ProcessManager.Current      = new ProcessManager();
            Registry.Current            = new Registry();
            ShortcutManager.Current     = new ShortcutManager();
            IconManager.Current         = new IconManager();
            Config.Current = new Config();

            ViewImpl.RegisterViews();

            try
            {
                return(RunMain());
            }
            catch (System.Security.SecurityException)
            {
                ViewFactory.Current.CreateView <IMessage>().Show("A Security exception occurred, This could be because you are running the GamesManager from a network share. If this is the case please try running it from a local folder.", "Security Exception");
            }
            catch (Exception ex)
            {
                ShowUnhandledError(ex);
            }
            return(-1);
        }
예제 #2
0
 public AvaloniaView(Context context) : base(context)
 {
     _view = new ViewImpl(context);
     AddView(_view.View);
     _root = new EmbeddableControlRoot(_view);
     _root.Prepare();
 }
예제 #3
0
        public TopLevelImpl(Context context, bool placeOnTop = false)
        {
            _view           = new ViewImpl(context, this, placeOnTop);
            _keyboardHelper = new AndroidKeyboardEventsHelper <TopLevelImpl>(this);
            _touchHelper    = new AndroidTouchEventsHelper <TopLevelImpl>(this, () => InputRoot,
                                                                          p => GetAvaloniaPointFromEvent(p));

            MaxClientSize = new Size(_view.Resources.DisplayMetrics.WidthPixels,
                                     _view.Resources.DisplayMetrics.HeightPixels);
        }
예제 #4
0
파일: NDalic.cs 프로젝트: walac/NUIPreview
        public static ViewImpl GetImplementation(View handle)
        {
            ViewImpl ret = new ViewImpl(Interop.NDalic.GetImplementation__SWIG_0(View.getCPtr(handle)), false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
예제 #5
0
        public void ViewImplNew()
        {
            tlog.Debug(tag, $"ViewImplNew START");

            var testingTarget = ViewImpl.New();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <View>(testingTarget, "Should return View instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"ViewImplNew END (OK)");
        }
예제 #6
0
        public TopLevelImpl(Context context, bool placeOnTop = false)
        {
            _view            = new ViewImpl(context, this, placeOnTop);
            _textInputMethod = new AndroidInputMethod <ViewImpl>(_view);
            _keyboardHelper  = new AndroidKeyboardEventsHelper <TopLevelImpl>(this);
            _touchHelper     = new AndroidTouchEventsHelper <TopLevelImpl>(this, () => InputRoot,
                                                                           GetAvaloniaPointFromEvent);
            _gl          = GlPlatformSurface.TryCreate(this);
            _framebuffer = new FramebufferManager(this);

            RenderScaling = (int)_view.Scaling;

            MaxClientSize = new PixelSize(_view.Resources.DisplayMetrics.WidthPixels,
                                          _view.Resources.DisplayMetrics.HeightPixels).ToSize(RenderScaling);
        }
예제 #7
0
        public TopLevelImpl(AvaloniaView avaloniaView, bool placeOnTop = false)
        {
            _view            = new ViewImpl(avaloniaView.Context, this, placeOnTop);
            _textInputMethod = new AndroidInputMethod <ViewImpl>(_view);
            _keyboardHelper  = new AndroidKeyboardEventsHelper <TopLevelImpl>(this);
            _pointerHelper   = new AndroidMotionEventsHelper(this);
            _gl          = GlPlatformSurface.TryCreate(this);
            _framebuffer = new FramebufferManager(this);

            RenderScaling = _view.Scaling;

            MaxClientSize = new PixelSize(_view.Resources.DisplayMetrics.WidthPixels,
                                          _view.Resources.DisplayMetrics.HeightPixels).ToSize(RenderScaling);

            NativeControlHost = new AndroidNativeControlHostImpl(avaloniaView);
            StorageProvider   = new AndroidStorageProvider((AvaloniaActivity)avaloniaView.Context);
        }
예제 #8
0
 public virtual void Dispose()
 {
     _view.Dispose();
     _view = null;
 }
예제 #9
0
 public AvaloniaView(Context context) : base(context)
 {
     _view = new ViewImpl(this);
     AddView(_view.View);
 }