Exemple #1
0
        /// <summary>
        /// Очистка размеров и положений окон авторов от удаленных авторов
        /// и дефолтных размеров
        /// </summary>
        /// <param name="authors"></param>
        private void Cleaning(AuthorList authors)
        {
            try
            {
                string[] keys = new string[AdvancedWindowSettingDictionary.Keys.Count];
                AdvancedWindowSettingDictionary.Keys.CopyTo(keys, 0);
                foreach (string key in keys)
                {
                    if ((key != "Default") && (authors.FindAuthor(key) == null))
                    {
                        AdvancedWindowSettingDictionary.Remove(key);
                    }
                }
                Dictionary <string, AdvancedWindowSetting> copy =
                    new Dictionary <string, AdvancedWindowSetting>(AdvancedWindowSettingDictionary);
                AdvancedWindowSetting @default = AdvancedWindowSettingDictionary["Default"];
                foreach (KeyValuePair <string, AdvancedWindowSetting> pair in copy)
                {
                    if ((pair.Key != "Default") && (pair.Value.Size == @default.Size) &&
                        (pair.Value.HeightComment == @default.HeightComment))
                    {
                        AdvancedWindowSettingDictionary.Remove(pair.Key);
                    }
                }

                keys = new string[AuthorWindowSettingDictionary.Keys.Count];
                AuthorWindowSettingDictionary.Keys.CopyTo(keys, 0);
                foreach (string key in keys)
                {
                    try
                    {
                        if ((key != "Default") && (authors.FindAuthor(key) == null))
                        {
                            AuthorWindowSettingDictionary.Remove(key);
                        }
                    }
                    catch
                    {
                    }
                }
                var copy1 =
                    new Dictionary <string, AuthorWindowSetting>(AuthorWindowSettingDictionary);
                AuthorWindowSetting @default1 = AuthorWindowSettingDictionary["Default"];
                foreach (var pair in copy1)
                {
                    if ((pair.Key != "Default") && (pair.Value.Size == @default1.Size) &&
                        (pair.Value.Location == @default1.Location) &&
                        (pair.Value.HeightComment == @default1.HeightComment))
                    {
                        AuthorWindowSettingDictionary.Remove(pair.Key);
                    }
                }
            }
            catch
            {
            }
        }
Exemple #2
0
        /// <summary>
        /// Очистка размеров и положений окон авторов от удаленных авторов
        /// и дефолтных размеров
        /// </summary>
        /// <param name="authors"></param>
        private void Cleaning(AuthorList authors)
        {
            string[] keys = new string[AdvancedWindowSettingDictionary.Keys.Count];
            AdvancedWindowSettingDictionary.Keys.CopyTo(keys, 0);
            foreach (string key in keys)
            {
                if ((key != "Default") && (authors.FindAuthor(key) == null))
                    AdvancedWindowSettingDictionary.Remove(key);
            }
            Dictionary<string, AdvancedWindowSetting> copy =
                new Dictionary<string, AdvancedWindowSetting>(AdvancedWindowSettingDictionary);
            AdvancedWindowSetting @default = AdvancedWindowSettingDictionary["Default"];
            foreach (KeyValuePair<string, AdvancedWindowSetting> pair in copy)
            {
                if ((pair.Key != "Default") && (pair.Value.Size == @default.Size) &&
                    (pair.Value.HeightComment == @default.HeightComment))
                    AdvancedWindowSettingDictionary.Remove(pair.Key);
            }

            keys = new string[AuthorWindowSettingDictionary.Keys.Count];
            AuthorWindowSettingDictionary.Keys.CopyTo(keys, 0);
            foreach (string key in keys)
            {
                if ((key != "Default") && (authors.FindAuthor(key) == null))
                    AuthorWindowSettingDictionary.Remove(key);
            }
            var copy1 =
                new Dictionary<string, AuthorWindowSetting>(AuthorWindowSettingDictionary);
            AuthorWindowSetting @default1 = AuthorWindowSettingDictionary["Default"];
            foreach (var pair in copy1)
            {
                if ((pair.Key != "Default") && (pair.Value.Size == @default1.Size) &&
                    (pair.Value.Location == @default1.Location) && (pair.Value.HeightComment == @default1.HeightComment))
                    AuthorWindowSettingDictionary.Remove(pair.Key);
            }
        }