예제 #1
0
        public StandardFilter CreateFilter()
        {
            var fullPath = Directory.GetFiles(path, "filter.json");

            if ((fullPath[0] != null))
            {
                FileStream   fs           = new FileStream(fullPath[0], FileMode.Open, FileAccess.Read);
                StreamReader streamReader = new StreamReader(fs, System.Text.Encoding.UTF8);
                string       json         = streamReader.ReadToEnd();
                fs.Close();
                streamReader.Close();
                StandardFilter filter = Newtonsoft.Json.JsonConvert.DeserializeObject <StandardFilter>(json);
                return(filter);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        public bool Export(StandardFilter filter)
        {
            string json = JsonConvert.SerializeObject(filter);

            return(true);
        }