コード例 #1
0
        private UIBarButtonItem[] GetToolBar()
        {
            int buttonWidth = 80;

            // Edit category
            _editCategoryButton          = new UIBarButtonItem();
            _editCategoryButton.Image    = UIImage.FromFile("Assets/Images/Toolbar/toolbar_edit.png");
            _editCategoryButton.Title    = "Edit category";
            _editCategoryButton.Width    = buttonWidth;
            _editCategoryButton.Clicked += delegate
            {
                AddEditCategoryController controller = new AddEditCategoryController(_category);
                NavigationController.PushViewController(controller, true);
            };

            // Manage questions
            _editQuestionsButton          = new UIBarButtonItem();
            _editQuestionsButton.Image    = UIImage.FromFile("Assets/Images/Toolbar/toolbar_questions.png");
            _editQuestionsButton.Title    = "Manage questions";
            _editCategoryButton.Width     = buttonWidth;
            _editQuestionsButton.Clicked += delegate
            {
                QuestionsController controller = new QuestionsController(_category);
                NavigationController.PushViewController(controller, true);
            };

            // Calendar
            _calendarButton          = new UIBarButtonItem();
            _calendarButton.Image    = UIImage.FromFile("Assets/Images/Toolbar/toolbar_calendar.png");
            _calendarButton.Title    = "Calendar";
            _calendarButton.Width    = buttonWidth;
            _calendarButton.Clicked += delegate
            {
                CalendarController controller = new CalendarController(_category);
                NavigationController.PushViewController(controller, true);
            };

            return(new UIBarButtonItem[] { _editCategoryButton, _editQuestionsButton, _calendarButton });
        }
コード例 #2
0
        /// <summary>
        /// Configures the bottom toolbar.
        /// </summary>
        /// <returns></returns>
        private UIBarButtonItem[] GetToolBar()
        {
            int buttonWidth = 45;

            // Add button
            _addButton          = new UIBarButtonItem();
            _addButton.Image    = UIImage.FromFile("Assets/Images/Toolbar/toolbar_add.png");
            _addButton.Title    = "Add category";
            _addButton.Width    = buttonWidth;
            _addButton.Clicked += delegate
            {
                if (Settings.IsFullVersion)
                {
                    _addEditCategoryController = new AddEditCategoryController(null);
                    NavigationController.PushViewController(_addEditCategoryController, true);
                }
                else
                {
                    UpgradeView view = new UpgradeView();
                    view.Show("Only one category is available in the free edition.");
                }
            };

            // Help button
            _helpButton          = new UIBarButtonItem();
            _helpButton.Image    = UIImage.FromFile("Assets/Images/Toolbar/toolbar_help.png");
            _helpButton.Title    = "Help";
            _helpButton.Width    = buttonWidth;
            _helpButton.Clicked += delegate
            {
                _helpController = new HelpController();
                NavigationController.PushViewController(_helpController, true);
            };

            if (Settings.IsFullVersion)
            {
                _spacer = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
                //_spacer.Width = buttonWidth;

                // Import button
                _importButton          = new UIBarButtonItem();
                _importButton.Image    = UIImage.FromFile("Assets/Images/Toolbar/toolbar_import.png");
                _importButton.Title    = "Import";
                _importButton.Width    = buttonWidth;
                _importButton.Clicked += delegate
                {
                    _importController = new ImportController();
                    NavigationController.PushViewController(_importController, true);
                };

                // Export button
                _exportButton          = new UIBarButtonItem();
                _exportButton.Image    = UIImage.FromFile("Assets/Images/Toolbar/toolbar_export.png");
                _exportButton.Title    = "Export";
                _importButton.Width    = buttonWidth;
                _exportButton.Clicked += delegate
                {
                    _exportController = new ExportController();
                    NavigationController.PushViewController(_exportController, true);
                };

                // Tips button
                _tipsButton          = new UIBarButtonItem();
                _tipsButton.Image    = UIImage.FromFile("Assets/Images/Toolbar/toolbar_tips.png");
                _tipsButton.Title    = "Tips";
                _tipsButton.Width    = buttonWidth;
                _tipsButton.Clicked += delegate
                {
                    _tipsController = new TipsController();
                    NavigationController.PushViewController(_tipsController, true);
                };

                return(new UIBarButtonItem[] { _addButton, _spacer,
                                               _importButton, _spacer,
                                               _exportButton, _spacer,
                                               _helpButton, _spacer,
                                               _tipsButton });
            }
            else
            {
                return(new UIBarButtonItem[] { _addButton, _helpButton });
            }
        }
コード例 #3
0
        /// <summary>
        /// Configures the bottom toolbar.
        /// </summary>
        /// <returns></returns>
        private UIBarButtonItem[] GetToolBar()
        {
            int buttonWidth = 45;

            // Add button
            _addButton = new UIBarButtonItem();
            _addButton.Image = UIImage.FromFile("Assets/Images/Toolbar/toolbar_add.png");
            _addButton.Title = "Add category";
            _addButton.Width = buttonWidth;
            _addButton.Clicked += delegate
            {
                if (Settings.IsFullVersion)
                {
                    _addEditCategoryController = new AddEditCategoryController(null);
                    NavigationController.PushViewController(_addEditCategoryController, true);
                }
                else
                {
                    UpgradeView view = new UpgradeView();
                    view.Show("Only one category is available in the free edition.");
                }
            };

            // Help button
            _helpButton = new UIBarButtonItem();
            _helpButton.Image = UIImage.FromFile("Assets/Images/Toolbar/toolbar_help.png");
            _helpButton.Title = "Help";
            _helpButton.Width = buttonWidth;
            _helpButton.Clicked += delegate
            {
                _helpController = new HelpController();
                NavigationController.PushViewController(_helpController, true);
            };

            if (Settings.IsFullVersion)
            {
                _spacer = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
                //_spacer.Width = buttonWidth;

                // Import button
                _importButton = new UIBarButtonItem();
                _importButton.Image = UIImage.FromFile("Assets/Images/Toolbar/toolbar_import.png");
                _importButton.Title = "Import";
                _importButton.Width = buttonWidth;
                _importButton.Clicked += delegate
                {
                    _importController = new ImportController();
                    NavigationController.PushViewController(_importController, true);
                };

                // Export button
                _exportButton = new UIBarButtonItem();
                _exportButton.Image = UIImage.FromFile("Assets/Images/Toolbar/toolbar_export.png");
                _exportButton.Title = "Export";
                _importButton.Width = buttonWidth;
                _exportButton.Clicked += delegate
                {
                    _exportController = new ExportController();
                    NavigationController.PushViewController(_exportController, true);
                };

                // Tips button
                _tipsButton = new UIBarButtonItem();
                _tipsButton.Image = UIImage.FromFile("Assets/Images/Toolbar/toolbar_tips.png");
                _tipsButton.Title = "Tips";
                _tipsButton.Width = buttonWidth;
                _tipsButton.Clicked += delegate
                {
                    _tipsController = new TipsController();
                    NavigationController.PushViewController(_tipsController, true);
                };

                return new UIBarButtonItem[] { _addButton, _spacer,
                    _importButton, _spacer,
                    _exportButton, _spacer,
                    _helpButton, _spacer,
                    _tipsButton
                };
            }
            else
            {
                return new UIBarButtonItem[] { _addButton, _helpButton };
            }
        }
コード例 #4
0
        private UIBarButtonItem[] GetToolBar()
        {
            int buttonWidth = 80;

            // Edit category
            _editCategoryButton = new UIBarButtonItem();
            _editCategoryButton.Image = UIImage.FromFile("Assets/Images/Toolbar/toolbar_edit.png");
            _editCategoryButton.Title = "Edit category";
            _editCategoryButton.Width = buttonWidth;
            _editCategoryButton.Clicked += delegate
            {
                AddEditCategoryController controller = new AddEditCategoryController(_category);
                NavigationController.PushViewController(controller, true);
            };

            // Manage questions
            _editQuestionsButton = new UIBarButtonItem();
            _editQuestionsButton.Image = UIImage.FromFile("Assets/Images/Toolbar/toolbar_questions.png");
            _editQuestionsButton.Title = "Manage questions";
            _editCategoryButton.Width = buttonWidth;
            _editQuestionsButton.Clicked += delegate
            {
                QuestionsController controller = new QuestionsController(_category);
                NavigationController.PushViewController(controller, true);
            };

            // Calendar
            _calendarButton = new UIBarButtonItem();
            _calendarButton.Image = UIImage.FromFile("Assets/Images/Toolbar/toolbar_calendar.png");
            _calendarButton.Title = "Calendar";
            _calendarButton.Width = buttonWidth;
            _calendarButton.Clicked += delegate
            {
                CalendarController controller = new CalendarController(_category);
                NavigationController.PushViewController(controller, true);
            };

            return new UIBarButtonItem[] { _editCategoryButton, _editQuestionsButton, _calendarButton };
        }