Esempio n. 1
0
        /// <summary>
        /// Главное окно
        /// </summary>
        /// <param name="rootObject">головной объект для подчиненного окна</param>
        public MainPage(MainCarrouselPage carrousel, string url, IPilotObject rootObject = null)
        {
            InitializeComponent();

            carrouselPage = carrousel;

            try
            {
                if (Global.DALContext != null && Global.DALContext.IsInitialized && Global.CurrentPerson == null)
                {
                    Global.CurrentPerson = Global.DALContext.Repository.CurrentPerson();
                }

                context = new MainPage_Context(this, rootObject, url);

                if (rootObject != null)
                {
                    context.FirstLaunch = false;
                }

                this.BindingContext = context;
            }
            catch (Exception ex)
            {
                DisplayMessage("Ошибка", ex.Message, false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Класс запуска мобильного клиента Pilot
        /// </summary>
        public App(string url)
        {
            InitializeComponent();

            Global.DALContext = new Context();

            Credentials credentials = TryGetCredentials();

            if (credentials != null)
            {
                if (Global.DALContext.Connect(credentials) == null)
                {
                    Global.Credentials = credentials;
                }
            }

            // Подключение обработчика уведомлений
            NotificationCenter.Current.NotificationReceived += OnLocalNotificationReceived;
            NotificationCenter.Current.NotificationTapped   += OnLocalNotificationTapped;

            if (Global.DALContext.IsInitialized)
            {
                Global.GetMetaData();

                MainPage = new MainCarrouselPage(url);
            }
            else
            {
                MainPage = new AuthorizePage();
            }
        }