コード例 #1
0
 public ListsAdapter(ListDrawerFragment _enclosing, Context context, QueryEnumerator
                     enumerator)
 {
     this._enclosing = _enclosing;
     this.context    = context;
     this.enumerator = enumerator;
 }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            RequestWindowFeature(WindowFeatures.Progress);
            SetContentView(Resource.Layout.activity_main);
            mDrawerFragment = (ListDrawerFragment)FragmentManager.FindFragmentById(Resource.Id.
                                                                                   navigation_drawer);
            mTitle = Title;
            mDrawerFragment.SetUp(Resource.Id.navigation_drawer, (DrawerLayout)FindViewById(Resource.Id.drawer_layout
                                                                                            ));
            string currentListId = GetCurrentListId();

            if (currentListId != null)
            {
                DisplayListContent(currentListId);
            }
            // Log the current user in and start replication sync
            Application application = (CouchbaseSample.Android.Application)Application;

            application.GetOnSyncProgressChangeObservable().AddObserver(new _Observer_109(this
                                                                                          ));
            application.GetOnSyncUnauthorizedObservable().AddObserver(new _Observer_125(this)
                                                                      );
            // clear the saved user id, since our session is no longer valid
            // and we want to show the login button
            if (application.GetCurrentUserId() != null)
            {
                switch (application.GetAuthenticationType())
                {
                case CouchbaseSample.Android.Application.AuthenticationType.CustomCookie:
                {
                    // since the user has already logged in before, assume that we
                    // can start sync using the persisted cookie.  if it's expired,
                    // a message will be shown and the user can login.
                    StartSyncWithStoredCustomCookie();
                    break;
                }

                case CouchbaseSample.Android.Application.AuthenticationType.Facebook:
                {
                    throw new NotImplementedException();
                    LoginWithFacebookAndStartSync();
                    break;
                }
                }
            }
        }
コード例 #3
0
 public ListsAdapter(ListDrawerFragment _enclosing, Context context, QueryEnumerator
      enumerator)
 {
     this._enclosing = _enclosing;
     this.context = context;
     this.enumerator = enumerator;
 }