Exemplo n.º 1
0
        public static IDocumentRepository Create(string mode, string url, string path, bool autoLogon)
        {
            IDocumentRepository repo = null;

            if (mode.Equals("local", StringComparison.OrdinalIgnoreCase))
            {
                repo = new LocalDocumentRepository(url, path, autoLogon);
            }
            else if (mode.Equals("remote", StringComparison.OrdinalIgnoreCase))
            {
                repo = new RemoteDocumentRepository(url, autoLogon);
            }
            else if (mode.Equals("remoteWithCache", StringComparison.OrdinalIgnoreCase))
            {
                repo = new RemoteDocumentRepository(url, path, autoLogon);
            }
            else if (mode.Equals("hybrid", StringComparison.OrdinalIgnoreCase))
            {
                repo = new HybridDocumentRepository(url, path, autoLogon);
            }
            else
            {
                throw new ArgumentException("Invalid mode value", "mode");
            }

            return(repo);
        }
Exemplo n.º 2
0
        public HybridDocumentRepository(string url, string cacheLocation, bool useOneTimeSession) : base(url, cacheLocation, useOneTimeSession)
        {
            if (String.IsNullOrEmpty(cacheLocation))
            {
                throw new ArgumentNullException("cacheLocation");
            }

            this.LocalRepository = new LocalDocumentRepository(url, cacheLocation, false);
        }