Exemplo n.º 1
0
        public static void SaveCategoryFilter(ViewsManager views, CategoryFilterViewModel filter)
        {
            try
            {
                var json = JsonConvert.SerializeObject(filter);

                BrowserManager.SetViewData(views, "CategoryFilter", json);
            }
            catch (Exception ex)
            {
                MainForm.ShowExceptionMessage(ex);
            }
        }
Exemplo n.º 2
0
        public static CategoryFilterViewModel GetCategoryFilter(ViewsManager views)
        {
            try
            {
                var json = BrowserManager.GetViewData(views, "CategoryFilter");
                if (!String.IsNullOrEmpty(json))
                {
                    var filter = JsonConvert.DeserializeObject <CategoryFilterViewModel>(json);
                    return(filter);
                }
            }
            catch (Exception ex)
            {
                MainForm.ShowExceptionMessage(ex);
            }

            return(new CategoryFilterViewModel
            {
                ShowAllDocuments = true,
                ShowUncategorizedDocuments = false
            });
        }