public Session(GlobalConfiguration globalConfiguration, IAccountManager accountManager, IZoneManager zoneManager, ICustomDictionary customDictionary, Socket socket, Func <string, Command> commandFactory, RequestHandlerFactory <IRequest> requestHandlerFactory, RequestHandlerFactory <IZoneRequest> zoneRequestHandlerFactory) { Id = SessionID.New(); _connection = new SessionConnection(socket) { RsaKeyReceived = OnRsaKeyReceived }; _connection.Disconnected += OnDisconnected; _connection.Received += OnDataReceived; _globalConfiguration = globalConfiguration; _accountManager = accountManager; _zoneManager = zoneManager; _customDictionary = customDictionary; _commandFactory = commandFactory; _requestHandlerFactory = requestHandlerFactory; _zoneRequestHandlerFactory = zoneRequestHandlerFactory; _accessLevel = AccessLevel.notDefined; }
public bool AddWordByDictionary(Word word, ICustomDictionary customDictionary = null) { if (customDictionary != null) { return(customDictionary.AddWord(word)); } return(dictionary.AddWord(word)); }
public bool RemoveWordByDictionary(string word, ICustomDictionary customDictionary = null) { if (customDictionary != null) { return(customDictionary.RemoveWord(word)); } return(dictionary.RemoveWord(word)); }
public bool FindWordByDictionary(string word, out Word wordOut, ICustomDictionary customDictionary = null) { if (customDictionary != null) { wordOut = customDictionary.Find(word); } wordOut = dictionary.Find(word); if (wordOut == null) { return(false); } else { return(true); } }