static void ShowCategoryInfo(TemplateCategoryWidget widget, TemplateCategoryViewModel category)
 {
     if (category != null)
     {
         widget.DisplayCategory(category);
     }
     else
     {
         widget.ClearCategory();
     }
 }
Exemple #2
0
        void Build()
        {
            var mainVBox = new VBox();

            var topLabel = new Label();

            topLabel.Text          = GettextCatalog.GetString("Category changes will take effect the next time you start {0}.", BrandingService.ApplicationName);
            topLabel.TextAlignment = Alignment.Start;
            topLabel.Margin        = 5;
            mainVBox.PackStart(topLabel);

            var mainHBox = new HBox();

            mainVBox.PackStart(mainHBox, true, true);

            templateCategoriesWidget = new TemplateCategoriesWidget();
            mainHBox.PackStart(templateCategoriesWidget, true, true);

            var buttonsVBox = new VBox();

            mainHBox.PackStart(buttonsVBox, false, false);

            addTopLevelCategoryButton       = new Button();
            addTopLevelCategoryButton.Label = GettextCatalog.GetString("Add Top Level Category");
            buttonsVBox.PackStart(addTopLevelCategoryButton, false, false);

            addCategoryButton           = new Button();
            addCategoryButton.Label     = GettextCatalog.GetString("Add Category");
            addCategoryButton.Sensitive = false;
            buttonsVBox.PackStart(addCategoryButton, false, false);

            removeCategoryButton           = new Button();
            removeCategoryButton.Label     = GettextCatalog.GetString("Remove Category");
            removeCategoryButton.Sensitive = false;
            buttonsVBox.PackStart(removeCategoryButton, false, false);

            categoryInformationVBox           = new VBox();
            categoryInformationVBox.Sensitive = false;
            mainVBox.PackStart(categoryInformationVBox, false, false);

            string title = GettextCatalog.GetString("Top Level");

            AddCategorySectionTitleLabel(categoryInformationVBox, title);

            topLevelCategoryWidget = new TemplateCategoryWidget();
            categoryInformationVBox.PackStart(topLevelCategoryWidget);

            title = GettextCatalog.GetString("Second Level");
            AddCategorySectionTitleLabel(categoryInformationVBox, title);

            secondLevelCategoryWidget = new TemplateCategoryWidget();
            categoryInformationVBox.PackStart(secondLevelCategoryWidget);

            title = GettextCatalog.GetString("Third Level");
            AddCategorySectionTitleLabel(categoryInformationVBox, title);

            thirdLevelCategoryWidget = new TemplateCategoryWidget();
            categoryInformationVBox.PackStart(thirdLevelCategoryWidget);

            Content = mainVBox;
        }