Source

Camino / src / Empi.Camino / Prototyping.cs

Full commit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Empi.Camino.Web.Data;
using Microsoft.Practices.Unity;

namespace Empi.Camino.Web
{
    interface IFileResource
    {
        string AbsoluteUrl
        { get; }

        string Id
        { get; }
    }

    internal class FileResource : IFileResource
    {
        internal FileResource(string id, IFileResourceProvider fileResourceProvider)
        {
            _fileResourceProvider = fileResourceProvider;
        }

        private IFileResourceProvider _fileResourceProvider;


        #region IFileResource Members

        public string AbsoluteUrl
        {
            get { throw new NotImplementedException(); }
        }

        public string Id
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }

    interface IFileResourceProvider
    {
        string GetAbsoluteUrl(string id);
    }

    //internal class S3ResourceProvider : IFileResourceProvider
    //{ 


    //}

    internal class LocalResourceProvider : IFileResourceProvider
    {


        #region IFileResourceProvider Members

        public string GetAbsoluteUrl(string id)
        {
            throw new NotImplementedException();
        }

        #endregion
    }



    internal class FileResourceFactory
    {

        private FileResourceFactory()
        { }

        internal static FileResourceFactory GetFileResourceFactory()
        {
            return new FileResourceFactory();
        }



        //MP: {FileRessourceId,FileRessourceProviderName}



        private IFileResourceProvider GetFileRessourceProvider(string providerName)
        {
            return DIContainer.GetDIContainer().Resolve<IFileResourceProvider>(providerName);
        }


        internal IFileResource GetFileRessource(string id)
        {
            return null;
        }

        internal IFileResource SaveFileRessource(string id, Stream fileStream)
        {
            return null;
        }








    }

}