Beispiel #1
0
        private void SetAppInfoViews(BaseActivity activity)
        {
            this.imgAppInfo        = activity.FindViewById <ImageButton>(Resource.Id.imgAppInfo);
            this.imgAppInfo.Click += (s, e) =>
            {
                var intent = new Intent(activity, typeof(AppInfoAndContactActivity));
                activity.StartActivity(intent);
            };
            var appInfoLayout = activity.FindViewById <RelativeLayout>(Resource.Id.relLayoutAppInfos);

            appInfoLayout.Click += (s, e) =>
            {
                var intent = new Intent(activity, typeof(AppInfoAndContactActivity));
                activity.StartActivity(intent);
            };
        }
Beispiel #2
0
        public static void StartViewLegislatorIntent(BaseActivity activity, Legislator legislator)
        {
            using (var intent = new Intent(activity, typeof(ViewLegislatorActivity)))
            {
                if (legislator != null)
                {
                    intent.PutExtra(BundleType.Legislator, legislator.SerializeToJson());
                }

                activity.StartActivity(intent);
            }
        }
        private bool ValidateExit(bool Exit = false)
        {
            bool IsChanged = false;

            try
            {
                IsChanged = !(
                    CSIWebServerName == CSIWebServerEdit.Text &&
                    Configuration == ((string)ConfigurationSpinner.SelectedItem ?? string.Empty) &&
                    Theme == InterpretThemeValue(((string)ThemeSpinner.SelectedItem ?? string.Empty)) &&
                    SavedUser == UserEdit.Text &&
                    SavedPassword == PasswordEdit.Text &&
                    EnableHTTPS == EnableHTTPSSwitch.Checked &&
                    UseRESTForRequest == UseRESTForRequestSwitch.Checked &&
                    LoadPicture == LoadPictureSwitch.Checked &&
                    ForceAutoPost == ForceAutoPostSwitch.Checked &&
                    ShowSuccessMessage == ShowSuccessMessageSwitch.Checked &&
                    RecordCap == RecordCapEdit.Text &&
                    SaveUser == SaveUserSwitch.Checked &&
                    SavePassword == SavePasswordSwitch.Checked
                    );
                if (IsChanged)
                {
                    FragmentTransaction ft            = FragmentManager.BeginTransaction();
                    CSIMessageDialog    SignOutDialog = new CSIMessageDialog(GetString(Resource.String.app_name), GetString(Resource.String.SettingChanged), DialogTypes.YesNoCancle, this.BaseActivity);
                    SignOutDialog.YesHandler += (sender, args) =>
                    {
                        bool bChangeTheme = false;
                        if (CSISystemContext.CSIWebServerName != Theme)
                        {
                            bChangeTheme = true;
                        }
                        SaveConfiguration();
                        if (Exit)
                        {
                            Dismiss();
                            Dispose();
                            if (bChangeTheme)
                            {
                                Intent intent = new Intent(Application.Context, typeof(MainActivity));
                                Bundle bundle = BaseActivity.GetCSISystemContext().BuildBundle();
                                intent.PutExtra("CSISystemContext", bundle);
                                BaseActivity.StartActivity(intent);
                                BaseActivity.Finish();
                            }
                        }
                    };
                    SignOutDialog.NoHandler += (sender, args) =>
                    {
                        CSISystemContext.CSIWebServerName   = CSIWebServerName;
                        CSISystemContext.Theme              = Theme;
                        CSISystemContext.SavedUser          = SavedUser;
                        CSISystemContext.SavedPassword      = SavedPassword;
                        CSISystemContext.EnableHTTPS        = EnableHTTPS;
                        CSISystemContext.UseRESTForRequest  = UseRESTForRequest;
                        CSISystemContext.LoadPicture        = LoadPicture;
                        CSISystemContext.ForceAutoPost      = ForceAutoPost;
                        CSISystemContext.ShowSuccessMessage = ShowSuccessMessage;
                        CSISystemContext.RecordCap          = RecordCap;
                        CSISystemContext.SaveUser           = SaveUser;
                        CSISystemContext.SavePassword       = SavePassword;
                        if (Exit)
                        {
                            Dismiss();
                            Dispose();
                        }
                    };
                    SignOutDialog.CancelHandler += (sender, args) =>
                    {
                    };
                    SignOutDialog.Show(ft, "");
                }
                else
                {
                    Dismiss();
                    Dispose();
                }
            }
            catch (Exception Ex)
            {
                WriteErrorLog(Ex);
                return(false);
            }
            return(true);
        }