/// <summary> /// Carga los datos del documento /// </summary> private void LoadDocument(FileModel file) { DocumentModel document = new Application.Bussiness.Documents.DocumentBussiness().Load(file); // Inicializa los combos InitCombos(); // Asigna el título inicial Title = file.Title; // Si hay algo en el documento, muestra los datos if (!document.Title.IsEmpty()) { Title = document.Title; } Description = document.Description; KeyWords = document.KeyWords; Content = document.Content; ShowAtRss = document.ShowAtRSS; UrlImageSummary = document.URLImageSummary; ComboModeShowChildItems.SelectedID = (int)document.ModeShow; IsRecursive = document.IsRecursive; ComboDocumentScope.SelectedID = (int)document.IDScope; // Carga los árboles de páginas TreeTags = new Documents.TreeDocumentsViewModel(this, FileModel.DocumentType.Tag, File, document.Tags); TreeTags.PropertyChanged += (sender, evntArgs) => { if (evntArgs.PropertyName.EqualsIgnoreCase(nameof(TreeTags.IsTreeeUpdated))) { IsUpdated = true; } }; // Carga la lista de páginas hija ListChildPages = new Documents.PagesListViewModel(this, document.File.Project, document); ListChildPages.LoadData(); ListChildPages.PropertyChanged += (sender, evntArgs) => { if (evntArgs.PropertyName.EqualsIgnoreCase(nameof(ListChildPages.ItemsUpdated))) { IsUpdated = true; } }; // Inicializa las plantillas Templates = new Documents.TemplateViewModel(this, document.Templates); // Indica que aún no se ha hecho ninguna modificación IsUpdated = false; }
/// <summary> /// Carga los datos del proyecto /// </summary> private void LoadProject(ProjectModel project) { // Inicializa los combos InitCombos(); // Carga los datos del proyecto project = new Application.Bussiness.Solutions.ProjectBussiness().Load(project.Solution, project.File.FullFileName); // Muestra los datos Name = project.Name; if (project.Title.IsEmpty()) { Title = project.Name; } else { Title = project.Title; } ComboWebType.SelectedID = (int)project.WebType; Description = project.Description; KeyWords = project.KeyWords; UrlBase = project.URLBase; PageMain = project.PageMain; ItemsPerCategory = project.ItemsPerCategory; ItemsPerSiteMap = project.ItemsPerSiteMap; MaxWidthImage = project.MaxWidthImage; ThumbsWidth = project.ThumbsWidth; AddWebTitle = project.AddWebTitle; ParagraphsSummaryNumber = project.ParagraphsSummaryNumber; WebMaster = project.WebMaster; Copyright = project.Copyright; Editor = project.Editor; VariablesText = project.VariablesText; PostCompileCommands = project.PostCompileCommands; // Inicializa las plantillas Templates = new Documents.TemplateViewModel(this, project.Templates); // Indica que aún no se ha hecho ninguna modificación IsUpdated = false; }