private bool GeneratePerspective() { //Create Perspective var perspective = new PerspectiveItem() { Id = WorkspaceRoot.Id, ParentId = WorkspaceRoot.Parent, EnumerationId = WorkspaceRootItem.Id }; //if (PerspectiveItemExists(perspective.Id)) return true; if (_existingPerspectives.Select(pers => pers.Id).Contains(perspective.Id)) { return(true); } PerspectiveItem perspectiveItemSaved = ExplorerProviderFactory.CreateProvider(ExplorerProviderFactory.Key.Instance).SavePerspectiveItem(perspective); if (perspectiveItemSaved != null) { if (perspectiveItemSaved.HasErrors) { return(false); } return(true); } return(false); }
/// <summary> /// Exists the perspective item ? /// </summary> /// <param name="id">The id.</param> /// <returns></returns> private static bool PerspectiveItemExists(string id) { if (String.IsNullOrEmpty(id)) { return(false); } var exists = ExplorerProviderFactory.CreateProvider(ExplorerProviderFactory.Key.Instance).GetPerspectiveItem(id) != null; return(exists); }