Esempio n. 1
0
        void ReleaseDesignerOutlets()
        {
            if (ConsumeTableView != null)
            {
                ConsumeTableView.Dispose();
                ConsumeTableView = null;
            }

            if (MainView != null)
            {
                MainView.Dispose();
                MainView = null;
            }
        }
Esempio n. 2
0
        //private void SQLConnectionStatus(int status)
        //{
        //    if (status == SQLStates.CONNECTED)
        //    {
        //        try
        //        {
        //            if (Core.GetData() != null)
        //            {
        //                // populate the consume list
        //                ConsumeTableView.Source = new ConsumeTableSource(Core.GetData(), this);

        //                if (Core.GetConnectionStatus())
        //                {
        //                    Core.Disconnect();
        //                }
        //            }

        //        }

        //        catch (Exception ex)
        //        {

        //        }
        //    }

        //    if (status == SQLStates.DISCONNECTED)
        //    {
        //    }

        //}

        public async override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            //var accounts = AccountStore.Create().FindAccountsForService(CREDENTIALS_NAME);
            //var account = accounts.FirstOrDefault();

            var account = authenticator.GetAccount();

            if (account == null)
            {
                // TODO JR: go to login view and clean view history stack
            }
            else
            {
                Core.Connect(account.Username, account.Properties["Password"]);

                // populate the consume list
                ConsumeTableView.Source = new ConsumeTableSource(await Core.GetData(), this);
                ConsumeTableView.ReloadData();



                //try
                //{
                //    //Core.Connect(USERNAME, PASSWORD);
                //    if (!Core.GetConnectionStatus())
                //    {
                //        Core.Connect(account.Username, account.Properties["Password"]);
                //    }
                //}
                //catch (Exception ex)
                //{

                //}
            }
        }