Ejemplo n.º 1
0
        public static void SaveFiltersInventoryToCsvFile(FilterSize filterSize)
        {
            string fileName = filterCsvFiles[filterSize];

            if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(fileName)))
            {
                System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fileName));
            }

            using (var sw = new System.IO.StreamWriter(fileName))
            {
                sw.WriteLine("#");
                sw.WriteLine(string.Format("# Wise40 {0}\" filter inventory", filterSize.ToString()));
                sw.WriteLine(string.Format("# Last saved on: {0}", DateTime.Now.ToString()));
                sw.WriteLine("# Filter line format:");
                sw.WriteLine("#  name;decription;offset");
                sw.WriteLine("# Name and description are free strings, offset must be a integer.");
                sw.WriteLine("# Empty lines and comments (starting with #) are ignored.");
                sw.WriteLine("#");

                foreach (var filter in _filterInventory[filterSizeToIndex[filterSize]])
                {
                    sw.WriteLine(string.Format("{0};{1};{2}", filter.Name, filter.Description, filter.Offset.ToString()));
                }
            }
        }
Ejemplo n.º 2
0
            public WheelFilterDigest(FilterSize size)
            {
                Wheel      = size == WiseFilterWheel.FilterSize.TwoInch ? "Wheel8" : "Wheel4";
                FilterSize = size.ToString();
                Filters    = new List <FilterDigest>();

                List <Filter> inventory = _filterInventory[filterSizeToIndex[size]];

                foreach (var filter in inventory)
                {
                    Filters.Add(new FilterDigest
                    {
                        Name        = filter.Name,
                        Description = filter.Description,
                        Offset      = filter.Offset,
                    });
                }
            }