Represents a VSS file.
Inheritance: VssItem
Beispiel #1
0
        public VssItem GetItemPhysical(string physicalName)
        {
            physicalName = physicalName.ToUpper();

            if (physicalName == RootProjectFile)
            {
                return(rootProject);
            }

            var     physicalPath = GetDataPath(physicalName);
            var     itemFile     = new ItemFile(physicalPath, encoding);
            var     isProject    = (itemFile.Header.ItemType == ItemType.Project);
            var     logicalName  = GetFullName(itemFile.Header.Name);
            var     itemName     = new VssItemName(logicalName, physicalName, isProject);
            VssItem item;

            if (isProject)
            {
                var parentFile  = ((ProjectHeaderRecord)itemFile.Header).ParentFile;
                var parent      = (VssProject)GetItemPhysical(parentFile);
                var logicalPath = BuildPath(parent, logicalName);
                item = new VssProject(this, itemName, physicalPath, logicalPath);
            }
            else
            {
                item = new VssFile(this, itemName, physicalPath);
            }
            item.ItemFile = itemFile;
            return(item);
        }
Beispiel #2
0
        public VssItem GetItemPhysical(string physicalName)
        {
            physicalName = physicalName.ToUpper();

            if (physicalName == RootProjectFile)
            {
                return rootProject;
            }

            var physicalPath = GetDataPath(physicalName);
            var itemFile = new ItemFile(physicalPath, encoding);
            var isProject = (itemFile.Header.ItemType == ItemType.Project);
            var logicalName = GetFullName(itemFile.Header.Name);
            var itemName = new VssItemName(logicalName, physicalName, isProject);
            VssItem item;
            if (isProject)
            {
                var parentFile = ((ProjectHeaderRecord)itemFile.Header).ParentFile;
                var parent = (VssProject)GetItemPhysical(parentFile);
                var logicalPath = BuildPath(parent, logicalName);
                item = new VssProject(this, itemName, physicalPath, logicalPath);
            }
            else
            {
                item = new VssFile(this, itemName, physicalPath);
            }
            item.ItemFile = itemFile;
            return item;
        }