private void CreateContainedFiles() { foreach (var vm in _fileSystem.Root.Files.Select(d => new FileTreeNodeViewModel(d, _search, _subFileFactories))) { RootItems.Add(vm); } }
//----------------------------------------------------------------------- public void SetRootItem(DataItem item) { RootItems.Clear(); RootItems.Add(item); m_storedRootItems.Add(item); GraphNodeItems.Clear(); foreach (var i in Descendants) { i.DataModel = this; if (item is GraphNodeItem && !GraphNodeItems.Contains(item)) { if (!GraphNodeItems.Contains(item as GraphNodeItem)) { GraphNodeItems.Add(item as GraphNodeItem); } } } if (RootItems.Any(e => !(e is GraphNodeItem))) { ShowAsGraph = false; ShowAsDataModel = true; } else { ShowAsGraph = true; ShowAsDataModel = false; } RaisePropertyChangedEvent("ShowAsGraph"); RaisePropertyChangedEvent("ShowAsDataModel"); }
bool AddTreeViewItemToRootItems(IDebugState content) { var parentID = content.ParentID.GetValueOrDefault(); if (content.StateType == StateType.Message && parentID == Guid.Empty) { RootItems.Add(new DebugStringTreeViewItemViewModel { Content = content.Message, ActivityTypeName = content.ActualType }); } else { var isRootItem = parentID == Guid.Empty || content.ID == parentID; var child = CreateChildTreeViewItem(content); if (!_contentItemMap.ContainsKey(content.ID)) { _contentItemMap.Add(content.ID, child); } if (isRootItem) { RootItems.Add(child); } else { var parent = CreateParentTreeViewItem(content, child); if (AddErrorToParent(content, child, parent)) { return(true); } } } return(false); }
private void CreateContainedDirectories() { foreach (var vm in _fileSystem.Root.Directories.Select(d => new DirectoryViewModel(d, null))) { RootItems.Add(vm); } }
private void CreateContainedFiles() { foreach (var vm in _fileSystem.Root.Files.Select(d => new FileViewModel(d, null))) { RootItems.Add(vm); } }
private void CreateContainedDirectories() { var rootDirectories = _fileSystem.Root.Directories.Select(d => new DirectoryTreeNodeViewModel(d, _search, _searchOptions, _uiDispatch, _subFileFactories)); foreach (var directory in rootDirectories) { RootItems.Add(directory); } }
public ContentViewModel(IItem rootItem, IServiceProvider serviceProvider) { rootItem = rootItem ?? throw new ArgumentNullException(nameof(rootItem)); ServiceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); _selectedItemService = serviceProvider.GetRequiredService <ISelectedItemService>(); var itemViewModelBuilder = ServiceProvider.GetRequiredService <IItemViewModelBuilder>(); RootItems.Add(itemViewModelBuilder.Build(rootItem)); }
public BookmarkPage(Bookmarks.BookmarkPage bookmarkPage) { Core = bookmarkPage; if (bookmarkPage.RootItems != null) { foreach (var rootItem in bookmarkPage.RootItems) { RootItems.Add(new BookmarkItem(rootItem, 0)); } } }
//----------------------------------------------------------------------- public void SetRootItem(DataItem item) { RootItems.Clear(); RootItems.Add(item); m_storedRootItems.Add(item); GraphNodeItems.Clear(); foreach (var i in Descendants) { i.DataModel = this; if (item is GraphNodeItem && !GraphNodeItems.Contains(item)) { if (!GraphNodeItems.Contains(item as GraphNodeItem)) { GraphNodeItems.Add(item as GraphNodeItem); } } } UpdateEditorType(); }
public SideBarViewModel() { RootItems.Add(new ConnectedEntitiesViewModel()); RootItems.Add(new MicrosoftAzure()); RootItems.Add(new AmazonAws()); }
//############################################################################################################## //----------------------------------------------------------------------- public void FocusItem(DataItem item) { if (item == m_proxyRootItem) { m_focusedItemsPath.Clear(); RootItems.Clear(); foreach (var child in m_storedRootItems) { RootItems.Add(child); } } else if (RootItems.Contains(item)) { return; } else { item.Focus(); m_focusedItemsPath.Clear(); DataItem current = null; if (item is GraphNodeItem) { current = (item as GraphNodeItem).LinkParents.FirstOrDefault(); } else { current = item.Parent; } while (current != null) { if (current is CollectionChildItem || current is GraphNodeItem || !(current.Parent is CollectionChildItem)) { m_focusedItemsPath.Add(current); } if (current is GraphNodeItem) { current = (current as GraphNodeItem).LinkParents.FirstOrDefault(); } else { current = current.Parent; } } m_focusedItemsPath.Remove(m_focusedItemsPath.Last()); m_focusedItemsPath.Add(m_proxyRootItem); for (int i = 0; i < m_focusedItemsPath.Count; i++) { m_focusedItemsPath[i].ZIndex = i; m_focusedItemsPath[i].FirstItem = Visibility.Visible; } for (int i = 0; i < m_focusedItemsPath.Count; i++) { m_focusedItemsPath.Move(m_focusedItemsPath.Count - 1, i); } m_focusedItemsPath[0].FirstItem = Visibility.Hidden; RootItems.Clear(); RootItems.Add(item); item.IsExpanded = true; if (m_lastFocusedItem != null) { if (m_lastFocusedItem is CollectionItem) { CollectionItem collectionItem = m_lastFocusedItem as CollectionItem; //collectionItem.IsFocused = false; } } m_lastFocusedItem = item; if (m_lastFocusedItem != null) { if (m_lastFocusedItem is CollectionItem) { CollectionItem collectionItem = m_lastFocusedItem as CollectionItem; //collectionItem.IsFocused = true; } } } IsFocusing = m_focusedItemsPath.Count > 0; RaisePropertyChangedEvent("RootItems"); }
void AddItemToTreeImpl(IDebugState content) { if ((DebugStatus == DebugStatus.Stopping || DebugStatus == DebugStatus.Finished || _allDebugReceived) && string.IsNullOrEmpty(content.Message) && !_continueDebugDispatch && !_dispatchLastDebugState) { return; } Dev2Logger.Log.Debug(string.Format("Debug content to be added ID: {0}" + Environment.NewLine + "Parent ID: {1}" + Environment.NewLine + "Name: {2}", content.ID, content.ParentID, content.DisplayName)); if (_lastStep != null && DebugStatus == DebugStatus.Finished && content.StateType == StateType.Message) { var lastDebugStateProcessed = _lastStep; _lastStep = null; _dispatchLastDebugState = true; AddItemToTreeImpl(new DebugState { StateType = StateType.Message, Message = Resources.CompilerMessage_ExecutionInterrupted, ParentID = lastDebugStateProcessed.ParentID }); AddItemToTreeImpl(lastDebugStateProcessed); _dispatchLastDebugState = false; } if (!string.IsNullOrWhiteSpace(SearchText) && !_debugOutputFilterStrategy.Filter(content, SearchText)) { return; } if (content.StateType == StateType.Message && content.ParentID == Guid.Empty) { RootItems.Add(new DebugStringTreeViewItemViewModel { Content = content.Message }); } else { var isRootItem = content.ParentID == Guid.Empty || content.ID == content.ParentID; IDebugTreeViewItemViewModel child; if (content.StateType == StateType.Message) { child = new DebugStringTreeViewItemViewModel { Content = content.Message }; } else { child = new DebugStateTreeViewItemViewModel(EnvironmentRepository) { Content = content }; } if (!_contentItemMap.ContainsKey(content.ID)) { _contentItemMap.Add(content.ID, child); } if (isRootItem) { RootItems.Add(child); } else { IDebugTreeViewItemViewModel parent; if (!_contentItemMap.TryGetValue(content.ParentID, out parent)) { parent = new DebugStateTreeViewItemViewModel(EnvironmentRepository); _contentItemMap.Add(content.ParentID, parent); } child.Parent = parent; parent.Children.Add(child); if (child.HasError.GetValueOrDefault(false)) { var theParent = parent as DebugStateTreeViewItemViewModel; if (theParent == null) { return; } theParent.AppendError(content.ErrorMessage); theParent.HasError = true; } } } if (content.IsFinalStep()) { DebugStatus = DebugStatus.Finished; } }
public void AddHierarchyItemToRoot(IUSHierarchyItem hierarchyItem) { RootItems.Add(hierarchyItem); RootItems.Sort(IUSHierarchyItem.Sorter); }