/// <summary>
        /// Read the streams file again, adding submenus and items
        /// to the given context menu. The file will be recreated first
        /// when it doesn't exist.
        /// </summary>
        /// <param name="menu">Target context menu.</param>
        /// <param name="onClick">Click event to attach to menu items.</param>
        public void LoadTo(ContextMenuStrip menu, EventHandler onClick)
        {
            // reset so that unhandled exceptions during recreation
            // invalidate the current time:
            lastUpdated = DateTime.MinValue;

            // make a single attempt to recreate the file when needed:
            if (!File.Exists(filepath))
            {
                Util.ResourceCopy(resourcepath, filepath);
            }

            DateTime lastWriteTime = File.GetLastWriteTimeUtc(filepath);

            // we must check the date, the file may be deleted
            // before calling GetLastWriteTimeUtc():
            if (lastWriteTime == Util.FileNotFoundUtc)
            {
                throw new IOException("Unable to access streams file after recreating it.");
            }

            try
            {
                reader.Read(filepath, menu, onClick);
                lastUpdated = lastWriteTime;
            }
            // update time on parsing errors
            // the syntax will still be wrong until the file changes:
            catch (StreamsFileReadError)
            {
                lastUpdated = lastWriteTime;
                throw;
            }
        }