Beispiel #1
0
        public override void ViewDidLoad()
        {
            try {
                AddLabel.Font = Theme.HugeFont;

                Source = (Source)Activator.CreateInstance (SourceType);

                AddLabel.Text = "ADD " + SourceTypes.GetTitle (SourceType);

                var y = AddLabel.Frame.Bottom + App.Inst.LabelGap;
                _form = new Form (Source, new RectangleF (AddLabel.Frame.Left, y, View.Frame.Width, View.Frame.Height - y));
                _form.OnOK += delegate {
                    try {
                        Repo.Foreground.AddOrActivateSource (Source);
                        SourceUpdater.SetSourcesChanged ();
                        App.Inst.ShowSourceMessages (Source);
                    } catch (Exception error) {
                        Log.Error (error);
                    }
                };

                View.AddSubview (_form);
            } catch (Exception error) {
                Log.Error (error);
            }
        }
Beispiel #2
0
        public override void ViewDidLoad()
        {
            try {
                TitleLabel.Font = Theme.HugeFont;
                TitleLabel.Text = "USER SETTINGS";

                var info = Repo.Foreground.Table<GoogleReaderConfig> ().FirstOrDefault ();
                if (info == null) {
                    info = new GoogleReaderConfig ();
                    Repo.Foreground.Insert (info);
                }

                _settings = new UserSettings.Settings ();

                _settings.GoogleAccount = info.Account;
                _settings.GooglePassword = info.Password;

                var y = TitleLabel.Frame.Bottom + App.Inst.LabelGap;
                _form = new Form (_settings, new RectangleF (TitleLabel.Frame.Left, y, View.Frame.Width, View.Frame.Height - y));
                _form.ConfirmButtonText = "SAVE";

                _form.OnCancel += delegate {
                    try {
                        App.Inst.PopDialog ();
                    } catch (Exception error) {
                        Log.Error (error);
                    }
                };
                _form.OnOK += delegate {
                    try {
                        info.Account = _settings.GoogleAccount;
                        info.Password = _settings.GooglePassword;
                        Repo.Foreground.Update (info);

                        GoogleReaderUpdater.SetReaderChanged ();

                        App.Inst.PopDialog ();
                    } catch (Exception error) {
                        Log.Error (error);
                    }
                };

                View.AddSubview (_form);
            } catch (Exception error) {
                Log.Error (error);
            }
        }
Beispiel #3
0
        public override void ViewDidLoad()
        {
            try {
                TitleLabel.Font = Theme.HugeFont;
                TitleLabel.Text = "EMAIL";

                _info = Repo.Foreground.Table<ShareInfo> ().FirstOrDefault ();
                if (_info == null) {
                    _info = new ShareInfo { From = UIDevice.CurrentDevice.Name, To = "" };
                    Repo.Foreground.Insert (_info);
                }

                var y = TitleLabel.Frame.Bottom + App.Inst.LabelGap;
                _form = new Form (_info, new RectangleF (TitleLabel.Frame.Left, y, View.Frame.Width, View.Frame.Height - y));
                _form.ConfirmButtonText = "SHARE";
                _form.ShowCancelButton = true;

                _form.OnCancel += delegate {
                    try {
                        App.Inst.PopDialog ();
                    } catch (Exception error) {
                        Log.Error (error);
                    }
                };
                _form.OnOK += delegate {
                    try {
                        Repo.Foreground.Update (_info);

                        var sh = new ShareMessage { From = _info.From, To = _info.To, Comment = "", MessageId = Message.Id, Status = ShareMessageStatus.Unsent };
                        Repo.Foreground.Insert (sh);

                        ShareUpdater.SetSharesChanged ();

                        App.Inst.PopDialog ();

                    } catch (Exception error) {
                        Log.Error (error);
                    }
                };

                View.AddSubview (_form);
            } catch (Exception error) {
                Log.Error (error);
            }
        }