Exemplo n.º 1
0
        internal static void LoadAndDrawBookmarks(EM_UI_MainForm mainForm)
        {
            try
            {
                foreach (string bookmark in EM_AppContext.Instance.GetUserSettingsAdministrator().GetBookmarks())
                {
                    string[] parts = bookmark.Split(';');

                    if (bookmark.StartsWith(mainForm.GetCountryShortName()))
                    {
                        TreeListNode node = mainForm.GetTreeListManager().GetSpecifiedNode(parts[1]);
                        if (node != null)
                        {
                            mainForm.DrawBookmark(parts[2], parts[1], node);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                DeleteBookmarks(mainForm.GetCountryShortName()); //try to delete the bookmarks, so that they do not cause further problems in e.g. adding new ones
                //do nothing (does not seem important enough to jeopardise loading of the whole country or any other relevant action)
                Tools.UserInfoHandler.RecordIgnoredException("BookmarkAndColorManager.LoadAndDrawBookmarks", exception);
            }
        }