コード例 #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);
            }
        }
コード例 #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
            });
        }