private SolutionRepositoryItemInfo <T> GetSolutionRepositoryItemInfo <T>() { SolutionRepositoryItemInfoBase SRIIBase = GetSolutionRepositoryItemInfo(typeof(T)); SolutionRepositoryItemInfo <T> SRII = (SolutionRepositoryItemInfo <T>)SRIIBase; return(SRII); }
/// <summary> /// Get Repository Item by it GUID /// </summary> /// <typeparam name="T"></typeparam> /// <param name="repositoryItemGuid"></param> /// <returns></returns> public T GetRepositoryItemByGuid <T>(Guid repositoryItemGuid) { SolutionRepositoryItemInfo <T> SRII = GetSolutionRepositoryItemInfo <T>(); T RI = SRII.GetItemByGuid(repositoryItemGuid); return(RI); }
// ------------------------------------------------------------------------------------------------ // private functions // ------------------------------------------------------------------------------------------------ public void AddItemInfo <T>(string pattern, string rootFolder, bool containRepositoryItems, string displayName, string PropertyNameForFileName) { SolutionRepositoryItemInfo <T> SRII = new SolutionRepositoryItemInfo <T>(); SRII.ItemFileSystemRootFolder = rootFolder; SRII.PropertyForFileName = PropertyNameForFileName; SRII.Pattern = pattern; SRII.ItemRootReposiotryfolder = new RepositoryFolder <T>(this, SRII, pattern, rootFolder, containRepositoryItems, displayName, true); mSolutionRepositoryItemInfoDictionary.Add(typeof(T), SRII); mSolutionRootFolders.Add((RepositoryFolderBase)SRII.ItemRootRepositoryFolder); }
public RepositoryFolder(SolutionRepository SolutionRepository, SolutionRepositoryItemInfo <T> solutionRepositoryItemInfo, string pattern, string FolderRelativePath, bool ContainsRepositoryItems = true, string DisplayName = null, bool isRootFolder = false) { this.SolutionRepository = SolutionRepository; mSolutionRepositoryItemInfo = solutionRepositoryItemInfo; this.FolderRelativePath = FolderRelativePath; //this.FolderFullPath = SolutionRepository.GetFolderFullPath(FolderRelativePath); this.DisplayName = DisplayName; this.ContainsRepositoryItems = ContainsRepositoryItems; this.ItemFilePattern = pattern; base.ItemType = typeof(T); IsRootFolder = isRootFolder; }
/// <summary> /// Get first cached Repository Item from provided Repository Item Type (if list is empty then null will be returned) /// </summary> /// <typeparam name="T">Repository Item Type</typeparam> /// <returns></returns> public dynamic GetFirstRepositoryItem <T>() { SolutionRepositoryItemInfo <T> SRII = GetSolutionRepositoryItemInfo <T>(); if (SRII.GetAllItemsCache().Count > 0) { return(SRII.GetAllItemsCache()[0]); } else { return(null); } }
/// <summary> /// Get list of All cached Repository Items from provided Repository Item Type /// </summary> /// <typeparam name="T">Repository Item Type</typeparam> /// <returns></returns> public ObservableList <T> GetAllRepositoryItems <T>() { SolutionRepositoryItemInfo <T> SRII = GetSolutionRepositoryItemInfo <T>(); return(SRII.GetAllItemsCache()); }
/// <summary> /// Get the root RepositoryFolder of the provided Repository Item Type /// </summary> /// <typeparam name="T">Repository Item Type</typeparam> /// <returns></returns> public RepositoryFolder <T> GetRepositoryItemRootFolder <T>() { SolutionRepositoryItemInfo <T> SRII = GetSolutionRepositoryItemInfo <T>(); return(SRII.ItemRootReposiotryfolder); }