/// <summary>
        /// This is used to load a resource item file's content into the
        /// dictionaries used by the editor.
        /// </summary>
        /// <param name="filename">The file to load</param>
        /// <param name="containsOverrides">True if this file contains overrides
        /// for the Sandcastle items</param>
        private void LoadItemFile(string filename, bool containsOverrides)
        {
            ResourceItem r;
            XmlReaderSettings settings = new XmlReaderSettings();
            XmlReader xr = null;

            try
            {
                settings.CloseInput = true;

                xr = XmlReader.Create(filename, settings);
                xr.MoveToContent();

                while(!xr.EOF)
                {
                    if(xr.NodeType == XmlNodeType.Element && xr.Name == "item")
                    {
                        r = new ResourceItem(filename, xr.GetAttribute("id"),
                            xr.ReadInnerXml(), containsOverrides);

                        allItems[r.Id] = r;

                        // Create a clone of the original for Sandcastle items
                        if(!containsOverrides)
                        {
                            r = new ResourceItem(filename, r.Id, r.Value, false);
                            sandcastleItems[r.Id] = r;
                        }
                    }

                    xr.Read();
                }
            }
            finally
            {
                if(xr != null)
                    xr.Close();
            }
        }
        /// <summary>
        /// This is used to load a resource item file's content into the dictionaries used by the editor
        /// </summary>
        /// <param name="filename">The file to load</param>
        /// <param name="containsOverrides">True if this file contains overrides for the Sandcastle items</param>
        private void LoadItemFile(string filename, bool containsOverrides)
        {
            ResourceItem r;
            XmlReaderSettings settings = new XmlReaderSettings { CloseInput = true };

            try
            {
                using(var xr = XmlReader.Create(filename, settings))
                {
                    xr.MoveToContent();

                    while(!xr.EOF)
                    {
                        if(xr.NodeType == XmlNodeType.Element && xr.Name == "item")
                        {
                            r = new ResourceItem(filename, xr.GetAttribute("id"), xr.ReadInnerXml(), containsOverrides);

                            allItems[r.Id] = r;

                            // Create a clone of the original for Sandcastle items
                            if(!containsOverrides)
                            {
                                r = new ResourceItem(filename, r.Id, r.Value, false);
                                sandcastleItems[r.Id] = r;
                            }
                        }

                        xr.Read();
                    }
                }
            }
            catch(Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);

                MessageBox.Show("Unable to save resource item file: " + ex.Message, "Resource Item Editor",
                    MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }