SenseNet.ContentRepository.RepositoryInstance.Start C# (CSharp) Method

Start() static private method

static private Start ( RepositoryStartSettings settings ) : RepositoryInstance
settings RepositoryStartSettings
return RepositoryInstance
        internal static RepositoryInstance Start(RepositoryStartSettings settings)
        {
            if (!_started)
            {
                lock (_startupSync)
                {
                    if (!_started)
                    {
                        var instance = new RepositoryInstance();
                        instance._settings = new RepositoryStartSettings.ImmutableRepositoryStartSettings(settings);
                        _instance = instance;
                        try
                        {
                            instance.DoStart();
                        }
                        catch (SqlException) //Workaround for VPN connectivity problem in LR office
                        {
                            Thread.Sleep(5000);
                            try
                            {
                                instance.DoStart();
                            }
                            catch (Exception)
                            {
                                _instance = null;
                                throw;
                            }
                        }
                        catch (Exception)
                        {
                            _instance = null;
                            throw;
                        }
                        _started = true;
                    }
                }
            }
            return _instance;
        }
        internal void DoStart()

Usage Example

コード例 #1
0
        /// <summary>
        /// Executes the boot sequence of the Repository by the passed <see cref="RepositoryStartSettings"/>.
        /// </summary>
        /// <example>
        /// Use the following code in your tool or other outer application:
        /// <code>
        /// var startSettings = new RepositoryStartSettings
        /// {
        ///     PluginsPath = pluginsPath, // Local directory path of plugins if it is different from your tool's path.
        ///     Console = Console.Out      // Startup sequence will be traced to given writer.
        /// };
        /// using (SenseNet.ContentRepository.Repository.Start(startSettings))
        /// {
        ///     // your code
        /// }
        /// </code>
        /// </example>
        /// <remarks>
        /// Repository will be stopped if the returned <see cref="RepositoryStartSettings"/> instance is disposed.
        /// </remarks>
        /// <returns>A new IDisposable <see cref="RepositoryInstance"/> instance.</returns>
        /// <returns></returns>
        public static RepositoryInstance Start(RepositoryStartSettings settings)
        {
            var instance = RepositoryInstance.Start(settings);

            SystemAccount.Execute(() => Root);
            return(instance);
        }
All Usage Examples Of SenseNet.ContentRepository.RepositoryInstance::Start