Init() public method

public Init ( string path ) : void
path string
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Creates a basic repository
        /// </summary>
        public static Repository Create()
        {
            Repository result = null;

            string path = FindRepository();

            if (Directory.Exists(path))
            {
                result = new Repository();
                result.Init(path);

                //Assign default instance
                if (_instance == null)
                {
                    _instance = result;
                }
            }
            if (result == null)
            {
                throw new Exception(string.Format("Unable to find or create a Repository from '{0}'. Please check your configuration file or copy your repository files in '{1}'.", RepositoryConfigurationPath, Repository.DefaultRepository));
            }

            return(result);
        }
Ejemplo n.º 2
0
        public static Repository Create()
        {
            Repository result = null;

            string path = FindRepository();
            if (Directory.Exists(path))
            {
                result = new Repository();
                result.Init(path);
            }
            if (result == null) throw new Exception(string.Format("Unable to find or create a Repository from '{0}'. Please check your configuration file", Properties.Settings.Default.RepositoryPath));

            return result;
        }