/// Gets the <see cref="IWebDavStore" /> this <see cref="WebDavServer" /> is hosting.
/// </summary>
/// <value>
/// The store.
/// </value>
publicIWebDavStoreStore{
get{
return_store;
}
}
publicstringServiceUrl{get;set;}
/// <summary>
/// Releases unmanaged and - optionally - managed resources
/// </summary>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protectedoverridevoidDispose(booldisposing){
lock(_threadLock){
if(_thread!=null)
Stop();
}
if(_ownsListener)
_listener.Dispose();
}
///// <summary>
///// Starts this
///// <see cref="WebDavServer" /> and returns once it has
///// been started successfully.
///// </summary>
///// <exception cref="System.InvalidOperationException">This WebDAVServer instance is already running, call to Start is invalid at this point</exception>
///// <exception cref="ObjectDisposedException">This <see cref="WebDavServer" /> instance has been disposed of.</exception>
///// <exception cref="InvalidOperationException">The server is already running.</exception>
//public void Start(String Url)
// {
// Listener.Prefixes.Add(Url);
// EnsureNotDisposed();
// lock (_threadLock)
// {
// if (_thread != null)
// {
// throw new InvalidOperationException(
// "This WebDAVServer instance is already running, call to Start is invalid at this point");
// }
// _stopEvent = new ManualResetEvent(false);
// _thread = new Thread(BackgroundThreadMethod)
// {
// Name = "WebDAVServer.Thread",
// Priority = ThreadPriority.Highest
// };
// _thread.Start();
// }
//}
/// <summary>
/// Starts this
/// <see cref="WebDavServer" /> and returns once it has
/// been stopped successfully.
/// </summary>
/// <exception cref="System.InvalidOperationException">This WebDAVServer instance is not running, call to Stop is invalid at this point</exception>
/// <exception cref="ObjectDisposedException">This <see cref="WebDavServer" /> instance has been disposed of.</exception>
/// <exception cref="InvalidOperationException">The server is not running.</exception>
publicvoidStop(){
EnsureNotDisposed();
lock(_threadLock){
if(_thread==null){
thrownewInvalidOperationException(
"This WebDAVServer instance is not running, call to Stop is invalid at this point");
}
_stopEvent.Set();
_thread.Join();
_stopEvent.Close();
_stopEvent=null;
_thread=null;
}
}
///// <summary>
///// The background thread method.
///// </summary>
//private void BackgroundThreadMethod()
//{
// _log.Info("WebDAVServer background thread has started");