Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.UnhandledException += HandleExceptions;

            SetContentView(Resource.Layout.Main);
            try
            {
                if (_gestureDetector == null)
                {
                    _gestureDetector = new GestureDetector(this);
                }

                if (_manager == null)
                {
                    try
                    {
                        _manager = new TcpClientmanager();
                        _manager.Connect();
                    }
                    catch (Exception)
                    {
                        ShowAlertWindow("Connection problem", "Connection problem! Check IP address and port.",
                                        "Options",
                                        (sender, args) =>
                        {
                            GoToOptions();
                        });
                    }
                }
                if (_gestureManager == null)
                {
                    _gestureManager = new GestureManager(_manager, new AdditionalInfo()
                    {
                        DeviceWidth = this.GetDeviceWidthInPixels()
                    });
                }
            }
            catch (Exception e)
            {
                TextView t = FindViewById <TextView>(Resource.Id.textView1);
                t.Text = e.ToString();
            }
        }
Пример #2
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     SetContentView(Resource.Layout.Drawing);
     if (_gestureDetector == null)
     {
         _gestureDetector = new GestureDetector(this);
     }
     if (_manager == null)
     {
         _manager = new TcpClientmanager();
         _manager.Connect();
     }
     if (_gestureManager == null)
     {
         _gestureManager = new DrawingManager(_manager, new AdditionalInfo()
         {
             DeviceWidth = this.GetDeviceWidthInPixels()
         });
     }
 }