webdav portal Dependency resolver added

This commit is contained in:
vfedosevich 2015-01-10 00:49:29 -08:00
parent 6e6b2abd8a
commit 2244ce5add
16 changed files with 210 additions and 35 deletions

View file

@ -11,12 +11,15 @@ using WebsitePanel.Portal;
using WebsitePanel.Providers.OS;
using Ninject;
using WebsitePanel.WebDavPortal.DependencyInjection;
using System.Web.Mvc;
namespace WebsitePanel.WebDavPortal.Models
{
public class WebDavManager : IWebDavManager
{
private readonly WebDavSession _webDavSession = new WebDavSession();
private readonly AccountModel _accountModel;
private IList<SystemFile> _rootFolders;
private int _itemId;
private IFolder _currentFolder;
@ -36,11 +39,11 @@ namespace WebsitePanel.WebDavPortal.Models
public WebDavManager(NetworkCredential credential, int itemId)
{
_accountModel = DependencyResolver.Current.GetService<AccountModel>();
_webDavSession.Credentials = credential;
_itemId = itemId;
IKernel _kernel = new StandardKernel(new NinjectSettings { AllowNullInjection = true }, new WebDavExplorerAppModule());
var accountModel = _kernel.Get<AccountModel>();
_rootFolders = ConnectToWebDavServer(accountModel);
_rootFolders = ConnectToWebDavServer(_accountModel);
if (_rootFolders.Any())
{