public ResourceManager(IResourceFolderLocations resourceFolderLocations, string indexFileName = @"index.txt")
 {
     if (resourceFolderLocations == null)
     {
         throw new ArgumentNullException("resourceFolderLocations");
     }
     if (indexFileName == null)
     {
         throw new ArgumentNullException("indexFileName");
     }
     _resourceFolderLocations = resourceFolderLocations;
     _index = new Index(_resourceFolderLocations, indexFileName);
 }
Ejemplo n.º 2
0
 internal Resource(IResourceFolderLocations resourceFolderLocations, ResourceInfo localResourceInfo, ResourceInfo remoteResourceInfo)
 {
     if (resourceFolderLocations == null)
     {
         throw new ArgumentNullException("resourceFolderLocations");
     }
     if (localResourceInfo == null)
     {
         throw new ArgumentNullException("localResourceInfo");
     }
     if (remoteResourceInfo == null)
     {
         throw new ArgumentNullException("remoteResourceInfo");
     }
     _resourceFolderLocations = resourceFolderLocations;
     _localResourceInfo       = localResourceInfo;
     _remoteResourceInfo      = remoteResourceInfo;
 }
        internal static Resource CreateResource(IResourceFolderLocations resourceFolderLocations, ResourceInfo localResourceInfo, ResourceInfo remoteResourceInfo)
        {
            if (localResourceInfo == null && remoteResourceInfo == null)
            {
                throw new ArgumentException("Local and remote resource infos are null");
            }

            if (localResourceInfo == null)
            {
                localResourceInfo = new ResourceInfo(remoteResourceInfo)
                {
                    Version = int.MinValue,
                };
            }
            else if (remoteResourceInfo == null)
            {
                remoteResourceInfo = localResourceInfo;
            }

            return(new Resource(resourceFolderLocations, localResourceInfo, remoteResourceInfo));
        }
Ejemplo n.º 4
0
 internal Index(IResourceFolderLocations resourceFolderLocations, string indexFileName)
 {
     _resourceFolderLocations = resourceFolderLocations;
     _indexFileName           = indexFileName;
 }