private void RebuildCategories() { this.RootCategory = AssetCategory.CreateRootCategory(); IXamlProject xamlProject = this.ActiveProject as IXamlProject; if (xamlProject != null && xamlProject.ProjectContext != null) { AssetTypeHelper typeHelper = new AssetTypeHelper(xamlProject.ProjectContext, this.Library.DesignerContext.PrototypingService); foreach (PresetAssetCategory category in Enum.GetValues(typeof(PresetAssetCategory))) { AssetCategoryPath path = (AssetCategoryPath)PresetAssetCategoryPath.FromPreset(category); if (this.FilterCategory(path, typeHelper)) { this.RootCategory.CreateCategory(path); } } } this.TreeFlattener.RebuildList(false); if (this.Categories.Count == 1) { this.Categories[0].IsExpanded = true; } this.OnPropertyChanged("Categories"); this.OnPropertyChanged("RootItem"); this.assetLibraryDamages &= ~AssetLibraryDamages.Categories; this.assetLibraryDamages |= AssetLibraryDamages.Assets; this.assetLibraryDamages |= AssetLibraryDamages.AssetCategories; this.assetLibraryDamages |= AssetLibraryDamages.CategoryCounts; }
public AssetCategoryPath Append(string relativePath, bool alwaysShow) { string fullPath = AssetCategoryPath.AssetCategoryPathHelper.CombinePath(this.FullPath, relativePath); if (string.IsNullOrEmpty(fullPath)) { return(AssetCategoryPath.Root); } AssetCategoryPath path = new AssetCategoryPath(fullPath, alwaysShow); return((AssetCategoryPath)PresetAssetCategoryPath.FromPath(path) ?? path); }
public int CompareTo(AssetCategoryPath other) { PresetAssetCategoryPath assetCategoryPath1 = this as PresetAssetCategoryPath; PresetAssetCategoryPath assetCategoryPath2 = other as PresetAssetCategoryPath; if (assetCategoryPath1 != null && assetCategoryPath2 != null) { return(assetCategoryPath1.PresetAssetCategory.CompareTo((object)assetCategoryPath2.PresetAssetCategory)); } int num1 = this.Steps.Length.CompareTo(other.Steps.Length); if (num1 != 0) { return(num1); } int num2 = string.Compare(this.DisplayName, other.DisplayName, StringComparison.OrdinalIgnoreCase); if (num2 != 0) { return(num2); } return(string.Compare(this.LastStep, other.LastStep, StringComparison.OrdinalIgnoreCase)); }