Пример #1
0
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            if (value is string)
            {
                ConstellationFilter cf = ConstellationFilter.Parse(value as string);
                cf.SettingsOwned = true;
                return(cf);
            }

            return(base.ConvertFrom(context, culture, value));
        }
Пример #2
0
        public static void LoadCustomFilters()
        {
            string savedFilders = AppSettings.SettingsBase["SavedFilters"].ToString();

            string[] lines = savedFilders.Split(new char[] { '\n' });
            foreach (string line in lines)
            {
                try
                {
                    string[] parts = line.Split(new char[] { ';' });
                    if (parts.Length > 1)
                    {
                        ConstellationFilter filter = ConstellationFilter.Parse(parts[1]);
                        Families.Add(parts[0], filter);
                    }
                }
                catch
                {
                }
            }
        }