private void AddAreaCommand_Execute(object parameter)
 {
     AreaDefinitionViewModel area = new AreaDefinitionViewModel(this);
     Areas.Add(area);
 }
        /// <summary>
        /// Loads the parser definition from a file.
        /// </summary>
        /// <param name="fileName">The file to load the parser definition from.</param>
        public void Load(string fileName)
        {
            Assertions.AssertNotEmpty(fileName, "fileName");

            ControlInformation ci = ControlInformation.Load(fileName);

            // Clear all data
            this.Sections.Clear();
            this.SelectedNode = null;

            // Fill in from the control file...
            this.ParserName = ci.FaxName;

            foreach (SectionDefinition sd in ci.Sections)
            {
                SectionDefinitionViewModel sdvm = new SectionDefinitionViewModel(this);
                sdvm.Name = sd.SectionString.String;

                foreach (SectionParserDefinition spd in sd.Parsers)
                {
                    ISectionParser sectionParser = SectionParserCache.Create(spd.Type);
                    sectionParser.OnLoad(spd.Options);

                    SectionParserDefinitionViewModel spdvm = new SectionParserDefinitionViewModel(sdvm, sectionParser);

                    sdvm.Aspects.Add(spdvm);
                }
                foreach (AreaDefinition ad in sd.Areas)
                {
                    AreaDefinitionViewModel advm = new AreaDefinitionViewModel(sdvm);
                    advm.Name = ad.AreaString.String;
                    advm.MapToPropertyExpression = ad.MapToPropertyExpression;

                    sdvm.Areas.Add(advm);
                }

                this.Sections.Add(sdvm);
            }
        }