public ActionResult RemoveOrRestore(long userId, long id, bool needRemove) { if (IdValidator.IsInvalid(userId) || IdValidator.IsInvalid(id)) { return(JsonResultHelper.Error(INVALID_DATA)); } IUserKnowledgeQuery userKnowledgeQuery = CreateUserKnowledgeQuery(userId); bool isRemoved = needRemove ? userKnowledgeQuery.Remove(id) : userKnowledgeQuery.Restore(id); if (isRemoved) { return(JsonResultHelper.Success(true)); } LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "KnowledgeController.RemoveOrRestore. Для пользователя с идентификатором {0} не удалось {1} данные с идентификатором {2}", userId, needRemove ? "удалить" : "восстановить", id); return(JsonResultHelper.Error()); }
public void LoggerWrapper_InfoLog_MessageExposedTest() { //Arrange var messages = new List <Tuple <LogLevel, string, Exception> >(); var logger = LoggerWrapper.CreateFromILogLikeObject(CreateLoggerMockWithMethods().Object); logger.LogMessageHandler += (x, y, z) => messages.Add(new Tuple <LogLevel, string, Exception>(x, y, z)); var testMessage = "Test message"; var testException = new Exception("Test"); //Act logger.Info(testMessage); logger.Info(testException); logger.Info(testMessage, testException); //Assert Assert.AreEqual(3, messages.Count); Assert.AreEqual(new Tuple <LogLevel, string, Exception>(LogLevel.Info, testMessage, null), messages[0], "Log entry with message was not exposed correctly."); Assert.AreEqual(new Tuple <LogLevel, string, Exception>(LogLevel.Info, string.Empty, testException), messages[1], "Log entry with exception was not exposed correctly."); Assert.AreEqual(new Tuple <LogLevel, string, Exception>(LogLevel.Info, testMessage, testException), messages[2], "Log entry with message and exception was not exposed correctly."); }
private static T DoByContext <T>(Func <StudyLanguageContext, T> func, T defaultValue) { const int MAX_ATTEMPTS = 3; int numberAttempt = 1; do { try { using (var context = new StudyLanguageContext()) { return(func(context)); } } catch (Exception e) { //TODO: возможно отлавливать только определенные исключения LoggerWrapper.LogTo(LoggerName.Errors).ErrorException("DbAdapter.DoByContext исключение {0}", e, e); } } while (++numberAttempt <= MAX_ATTEMPTS); return(defaultValue); }
public static User CreateUser() { XmlSerializer reader = new XmlSerializer(typeof(User)); string fileName = TestContext.Parameters["UserData"]; string filePath = _pathToRootDirectory + fileName; using (FileStream fileStream = new FileStream(filePath, FileMode.OpenOrCreate)) { try { User user = (User)reader.Deserialize(fileStream); LoggerWrapper.LogInfo($"User data was successfully read from file {fileName}"); return(user); } catch { LoggerWrapper.LogError($"{fileName}: unable to read user data from this file."); throw; } } }
private static void SetupRandomizedGroupsByIDs(LG_PopulateArea area, Dictionary <int, float> enemyIDs) { if (enemyIDs == null || enemyIDs.Count < 1) { LoggerWrapper.Log("No enemy population tweaks, aborting setup..."); return; } HashSet <pAvailableEnemyTypes> validTypes; validTypes = GetValidGroups(enemyIDs); Dictionary <pAvailableEnemyTypes, float> weightedGroups = SetupWeighting(validTypes, enemyIDs); pAvailableEnemyTypes dataGroup = weightedGroups.RandomElementByWeight(e => e.Value).Key; LoggerWrapper.Log(dataGroup.ToString(), LogLevel.Debug); if (!enemyIDs.ContainsKey((int)dataGroup.enemyID)) { return; } area.m_groupPlacement.groupData.Difficulty = dataGroup.difficulty; area.m_groupPlacement.groupData.Type = GetValidGroupTypeFromRole(dataGroup.role); foreach (EnemyGroupCompositionData enemyGroupCompositionData in area.m_groupPlacement.groupData.Roles) { eEnemyRole role = dataGroup.role; EnsureValidRole(area.m_groupPlacement.groupData.Type, area.m_groupPlacement.groupData.Difficulty, ref role); enemyGroupCompositionData.Role = role; } LoggerWrapper.Log($"Setting enemyDataGroup: Diff:{area.m_groupPlacement.groupData.Difficulty} Role:{area.m_groupPlacement.groupData.Type} Type:{dataGroup.role}", LogLevel.Debug); }
public TimeSpan Calculate(KnowledgeMark mark, double ratio) { TimeSpan minDate; TimeSpan maxDate; TimeSpan repeatInterval; if (mark == KnowledgeMark.VeryEasy) { minDate = new TimeSpan(10, _random.Next(0, 3), _random.Next(0, 60), _random.Next(0, 60)); maxDate = new TimeSpan(365, _random.Next(0, 3), _random.Next(0, 60), _random.Next(0, 60)); int countDays = GetRepeatInterval(minDate.TotalDays, maxDate.TotalDays, ratio); repeatInterval = new TimeSpan(countDays, 0, 0, 0); } else if (mark == KnowledgeMark.Normal) { minDate = new TimeSpan(2, _random.Next(0, 3), _random.Next(0, 60), _random.Next(0, 60)); maxDate = new TimeSpan(10, _random.Next(20, 23), _random.Next(50, 60), _random.Next(0, 60)); int countHours = GetRepeatInterval(minDate.TotalHours, maxDate.TotalHours, ratio); repeatInterval = new TimeSpan(countHours, 0, 0); } else if (mark == KnowledgeMark.DontRemember) { minDate = new TimeSpan(0, _random.Next(10, 15), _random.Next(0, 60)); maxDate = new TimeSpan(1, _random.Next(20, 23), _random.Next(50, 60), _random.Next(0, 60)); int countMinutes = GetRepeatInterval(minDate.TotalMinutes, maxDate.TotalMinutes, ratio); repeatInterval = new TimeSpan(0, countMinutes, 0); } else { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "UserRepetitionIntervalQuery.SetNextByMark передан некорректная оценка {0}", mark); minDate = new TimeSpan(0, _random.Next(20, 30), _random.Next(0, 60)); maxDate = new TimeSpan(0, _random.Next(50, 60), _random.Next(0, 60)); int countSeconds = GetRepeatInterval(minDate.TotalSeconds, maxDate.TotalSeconds, ratio); repeatInterval = new TimeSpan(0, 0, countSeconds); } return(repeatInterval); }
void RegFuncs() { MethodBase debugBase = MethodBase.GetMethodFromHandle(typeof(TankController).GetMethod("Print").MethodHandle); _luaState.RegisterFunction("DebugLog", debugBase); MethodBase angleDiff = MethodBase.GetMethodFromHandle(typeof(Mathf).GetMethod("DeltaAngle").MethodHandle); _luaState.RegisterFunction("AngleDifference", angleDiff); MethodBase closestAngle = MethodBase.GetMethodFromHandle(typeof(Extensions).GetMethod("GetClosestDirection").MethodHandle); _luaState.RegisterFunction("GetClosestDirection", closestAngle); //GetDirectionCoords MethodBase getDirectionCoords = MethodBase.GetMethodFromHandle(typeof(Extensions).GetMethod("GetDirectionCoords").MethodHandle); _luaState.RegisterFunction("GetDirectionCoords", getDirectionCoords); MethodBase toInt = MethodBase.GetMethodFromHandle(typeof(Extensions).GetMethod("ToInt").MethodHandle); _luaState.RegisterFunction("ToInt", toInt); MethodBase toVec2 = MethodBase.GetMethodFromHandle(typeof(Extensions).GetMethod("ToVector2").MethodHandle); _luaState.RegisterFunction("ToVector2", toVec2); MethodBase toDouble = MethodBase.GetMethodFromHandle(typeof(Extensions).GetMethod("ToDouble").MethodHandle); _luaState.RegisterFunction("ToDouble", toDouble); _luaState["Tank"] = new TankWrapper(_tank, AiDelay); _luaState["BattleGround"] = new BattleGround(_tank); _luaState["Out"] = new LoggerWrapper(_printer); _luaState["Messager"] = new TankMessengerWrapper(GetComponent <TankTextMessenger>()); }
public static async Task Doorbell(IStaticApplicationInfo applicationInfo, Microsoft.Azure.WebJobs.ExecutionContext executionContext, ILogger logger, EventData[] messages) { var stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); var msg = DoorbellMessage.Deserialize(messages[0].Body.Array); var processId = msg.ProcessId; var configuration = applicationInfo.GetHostConfiguration(); var hostlogger = new LoggerWrapper(logger, $"[p{processId:d3} doorbell] "); var lastRing = messages[messages.Length - 1].SystemProperties.SequenceNumber; try { var cloudBlobContainer = await AzureBlobStorageStateManager.GetCloudBlobContainer(configuration.StorageConnectionString, hostlogger); var stateBlob = cloudBlobContainer.GetBlockBlobReference(AzureBlobStorageStateManager.BlobName(processId)); var leaseManager = new LeaseManager(stateBlob); if (await leaseManager.TryGetLease(hostlogger)) { hostlogger.LogInformation($"{DateTime.UtcNow:o} Rings x{messages.Length} on {Environment.MachineName}, through #{lastRing}, lease acquired"); await RunHost(applicationInfo, configuration, processId, hostlogger, logger, leaseManager, stopwatch, executionContext.InvocationId); } else { hostlogger.LogInformation($"{DateTime.UtcNow:o} Rings x{messages.Length} on {Environment.MachineName}, through #{lastRing}, ignored"); } } catch (Exception e) { hostlogger.LogError($"Doorbell failed: {e}"); } }
private static IPayrollArticle[] ResolveArticleDependency(IDictionary <uint, IPayrollArticle[]> initialDict, IPayrollArticle article, SymbolName[] callingArticles, IDictionary <uint, IPayrollArticle[]> pendingDict, IProcessConfigLogger logger) { var relatedArticles = CollectFromRelated(initialDict, article, pendingDict); bool foundInRelated = relatedArticles != null; if (foundInRelated) { LoggerWrapper.LogRelatedArticles(logger, article, relatedArticles, "CollectRelated"); return(relatedArticles); } else { relatedArticles = CollectFromPending(initialDict, article, callingArticles, pendingDict, logger); LoggerWrapper.LogPendingArticles(logger, article, callingArticles, relatedArticles, "CollectRelated"); return(relatedArticles); } }
public void FillFromXml(string fileName, Action <int, string, IEnumerable <string>, bool> callBack) { Load(); XDocument doc = XDocument.Load(fileName); foreach (XElement cardElement in doc.Root.Elements("card")) { XElement wordElement = cardElement.XPathSelectElement("word"); if (wordElement == null) { return; } string word = wordElement.Value.Trim(); if (string.IsNullOrEmpty(word)) { return; } IEnumerable <XElement> translations = cardElement.XPathSelectElements("meanings/meaning/translations/word"); List <string> dirtyTranslationsWords = translations.Where(e => !string.IsNullOrEmpty(e.Value)) .SelectMany(e => _xmlRegex.Split(e.Value)).Select(e => e.Trim()) .Where(e => !string.IsNullOrEmpty(e)).Distinct().ToList(); if (EnumerableValidator.IsEmpty(dirtyTranslationsWords)) { return; } bool isSaved = CreateWordWithTranslation(word, dirtyTranslationsWords, WordType.Default); if (!isSaved) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "WordFiller.FillFromXml can't add word {0}, translations: {1}", word, string.Join(",", dirtyTranslationsWords)); } callBack(++_counter, word, dirtyTranslationsWords, isSaved); } }
private static byte[] GetPronunciation(long id, SpeakerDataType type) { IPronunciationQuery pronunciationQuery = null; if (type == SpeakerDataType.Word) { pronunciationQuery = new WordsQuery(); } else if (type == SpeakerDataType.Sentence) { pronunciationQuery = new SentencesQuery(); } if (pronunciationQuery == null) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "SpeakerController.GetPronunciation передан некорректный тип {0}", type); return(null); } IPronunciation pronunciationEntity = pronunciationQuery.GetById(id); return(pronunciationEntity != null ? pronunciationEntity.Pronunciation : null); }
public T GetJsonGoods <T>(string uniqueDownloadId) where T : class { T result = null; Adapter.Transaction(c => { PurchasedGoods purchasedGoods = GetPurchasedGoods(uniqueDownloadId, c); if (purchasedGoods == null) { LoggerWrapper.RemoteMessage(LoggingType.Error, "PurchasedGoodsQuery.GetGoods. Для уникального идентификатора {0} не удалось найти купленный товар!!!", uniqueDownloadId); return(false); } if (!IsPaidStatus(purchasedGoods)) { LoggerWrapper.RemoteMessage(LoggingType.Error, "PurchasedGoodsQuery.GetGoods. Товар с уникальным идентификатором {0} пытаются скачать не оплатив!!! Статус купленного товара {1}", uniqueDownloadId, purchasedGoods.Status); return(false); } try { result = JsonConvert.DeserializeObject <T>(purchasedGoods.Goods); } catch (Exception e) { LoggerWrapper.RemoteMessage(LoggingType.Error, "PurchasedGoodsQuery.GetGoods. Товар с уникальным идентификатором {0} не удалось десериализовать в тип {1}. JSON-описание товара: {2}. Исключение: {3}", uniqueDownloadId, typeof(T).FullName, purchasedGoods.Goods, e); return(false); } purchasedGoods.PostToCustomerDate = DateTime.Now; purchasedGoods.Status = PurchasedStatus.PostToCustomer; c.SaveChanges(); return(true); }); return(result); }
public static void SetupData(EnemyPopulationDataBlock __instance) { if (enemyTypes == null) { enemyTypes = new List <pAvailableEnemyTypes>(); } foreach (Il2CppSystem.Collections.Generic.List <EnemyRoleData> data in __instance.m_enemyDataPerRoleAndDiff.Values) { foreach (EnemyRoleData data1 in data) { if (!validRoles.Contains(data1.Role)) { continue; } pAvailableEnemyTypes enemyData = new pAvailableEnemyTypes( data1.Enemy, data1.Cost, data1.Difficulty, data1.Role, data1.Weight); enemyTypes.Add(enemyData); LoggerWrapper.Log(enemyData.ToString()); } } }
private static void CheckValidity(Dictionary <int, float> enemies, List <pAvailableEnemyTypes> trueValid) { if (trueValid.Count < 1) { LoggerWrapper.Log("Could not find any groups!"); } foreach (int enemyID in enemies.Keys) { bool enemyIDHandled = false; foreach (pAvailableEnemyTypes type in trueValid) { if (type.enemyID == enemyID) { enemyIDHandled = true; } } if (!enemyIDHandled) { LoggerWrapper.Log($"COULD NOT FIND SPAWN GROUP FOR ENEMY ID {enemyID} !"); } } }
public ActionResult RemoveOrRestore(long userId, string key, bool needRemove) { if (IdValidator.IsInvalid(userId) || string.IsNullOrWhiteSpace(key) || WebSettingsConfig.Instance.IsSectionForbidden(SectionId.UserTasks)) { return(JsonResultHelper.Error()); } RepositoryFactory repositoryFactory = WebSettingsConfig.Instance.GetRepositoryFactory(); UserTasksRepository userTasksRepository = repositoryFactory.CreateUserRepository(userId); bool success = userTasksRepository.RemoveOrRestoreTask(key, needRemove); if (success) { SendMail(string.Format("Пользователь {0} {1} таск {2}.", userId, needRemove ? "удалил" : "восстановил", key)); return(JsonResultHelper.Success(true)); } LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "UserTasksController.RemoveOrRestore. Для пользователя с идентификатором {0} не удалось {1} таск с идентификатором {2}", userId, needRemove ? "удалить" : "восстановить", key); return(JsonResultHelper.Error()); }
private void UpdateRelatedArticles(IDictionary <uint, IPayrollArticle[]> relatedDict, IProcessConfigLogger logger) { foreach (var article in Models) { var articleCode = article.Key; var articleItem = article.Value; IPayrollArticle[] relatedArticles = null; bool existInDictionary = relatedDict.TryGetValue(articleCode, out relatedArticles); if (existInDictionary) { articleItem.UpdateRelatedArticles(relatedArticles); } else { articleItem.UpdateRelatedArticles(EMPTY_ARTICLE_LIST); } LoggerWrapper.LogListArticlesUnderArticle(logger, articleItem, relatedArticles, "UpdateRelatedArticles"); } }
public List <SourceWithTranslation> GetExact(long userId, long sourceId, long translationId) { if (IdValidator.IsValid(userId)) { //пользователя знаем - может быть это его энтити - попробуем найти List <SourceWithTranslation> result = GetUserEntities(userId, sourceId, translationId); if (result.Count > 0) { return(result); } } Tuple <long, byte[], PronunciationEntity, PronunciationEntity> sourceAndTranslationWithId = GetBySourceAndTranslation(sourceId, translationId); long id = sourceAndTranslationWithId.Item1; PronunciationEntity source = sourceAndTranslationWithId.Item3; PronunciationEntity translation = sourceAndTranslationWithId.Item4; if (IdValidator.IsInvalid(id) || source == null || translation == null) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "BaseRandomQuery.GetExact для пользователя {0} не удалось получить данные с идентификаторами {1} и {2}", userId, sourceId, translationId); return(null); } long sourceLanguageId = source.Id == sourceId ? source.LanguageId : translation.LanguageId; SourceWithTranslation sentence = ConverterEntities.ConvertToSourceWithTranslation(id, sourceAndTranslationWithId .Item2, sourceLanguageId, source, translation); sentence.IsCurrent = true; return(new List <SourceWithTranslation> { sentence }); }
private long SaveNormalForms(ParsedWord word) { long result = IdValidator.INVALID_ID; IEnumerable <string> normalForms = word.NormalForms.Where(e => !string.Equals(e, word.Text, StringComparison.InvariantCultureIgnoreCase) && !string.Equals(e, word.FullText, StringComparison.InvariantCultureIgnoreCase)); foreach (string normalForm in normalForms) { long normalFormWordId = _wordsQuery.GetOrCreate(_languageId, normalForm); if (IdValidator.IsValid(normalFormWordId)) { result = normalFormWordId; } else { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "TextProcessor.SaveNormalForms не удалось сохранить нормальную форму слова {0}, для языка {1}", normalForm, _languageId); } } return(result); }
public UserIdAttribute(bool needCreate = false, string uniqueParamName = "userId") { _needCreate = needCreate; _uniqueParamName = uniqueParamName; _usersQuery = new UsersQuery(); _usersQuery.OnChangeLastActivity = userId => Task.Factory.StartNew(() => { try { long languageId = WebSettingsConfig.Instance.GetLanguageFromId(); IUserKnowledgeQuery userKnowledgeQuery = new UserKnowledgeQuery(userId, languageId); userKnowledgeQuery.RemoveDeleted(); var repetitionQuery = new UserRepetitionKnowledgeQuery(userId, languageId, KnowledgeDataType.All); IUserRepetitionIntervalQuery userRepetitionIntervalQuery = new UserRepetitionIntervalQuery(userId, languageId, KnowledgeSourceType.Knowledge, repetitionQuery, RepetitionType.All); userRepetitionIntervalQuery.RemoveWithoutData(); } catch (Exception e) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "UserIdAttribute.Constructor. СЮДА НЕ ДОЛЖНЫ БЫЛИ ПОПАСТЬ! При вызове для пользователя с идентификатором {0} возникло исключение {1}!", userId, e); } }); }
public ActionResult Download(long userId, DocumentType type) { if (IsInvalid(userId)) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "KnowledgeGeneratorController.Download передан некорректный идентификатор пользователя: {0}", userId); return(RedirectToAction("Index")); } string userKey = GetUserKey(userId); var generatedItems = ControllerContext.Controller.TempData[userKey] as Dictionary <KnowledgeDataType, List <GeneratedKnowledgeItem> >; if (EnumerableValidator.IsNullOrEmpty(generatedItems)) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "KnowledgeGeneratorController.Download для пользователя с идентификатором {0} не удалось найти сгенерированные данные во временных данных", userId); return(RedirectToAction("Index")); } //записать данные опять, т.к. они удаляются после считывания WriteItemsToTempData(userKey, generatedItems); string header = WebSettingsConfig.Instance.GetTemplateText(SectionId.KnowledgeGenerator, TemplateId.Header); var downloader = new GeneratedKnowledgeDownloader(WebSettingsConfig.Instance.DomainWithProtocol, CommonConstants.GetFontPath(Server)) { Header = header }; var documentGenerator = downloader.Download(type, header, generatedItems); return(File(documentGenerator.Generate(), documentGenerator.ContentType, documentGenerator.FileName)); }
public static async Task <string> InitializeService(Microsoft.Azure.WebJobs.ExecutionContext executionContext, ILogger logger) { var stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); var applicationInfo = new TStaticApplicationInfo(); logger = new LoggerWrapper(logger, "[initialize] "); try { var configuration = applicationInfo.GetHostConfiguration(); var host = new Host <TStaticApplicationInfo>(applicationInfo, configuration, logger, 0, stopwatch, executionContext.InvocationId); var deploymentTimestamp = DateTime.UtcNow; var deploymentId = applicationInfo.GetDeploymentId(deploymentTimestamp); host.SetDeploymentTimestamp(deploymentTimestamp); // generate blobs var cloudBlobContainer = await AzureBlobStorageStateManager.GetCloudBlobContainer( storageConnectionString : configuration.StorageConnectionString, logger : logger, initialize : true ); // check the current position in all the queues, and start from there var initTasks = new List <Task>(); for (uint i = 0; i < host.NumberProcesses; i++) { StartTask(initTasks, async() => { uint processId = i; var lastEnqueued = await host.GetLastEnqueuedSequenceNumber(processId); await AzureBlobStorageStateManager.Save( cloudBlobContainer, deploymentId, logger, processId, new ProcessState(deploymentTimestamp, lastEnqueued)); }); } await Task.WhenAll(initTasks); // send ping message to process 0 var guid = Guid.NewGuid(); var message = new DoorbellMessage() { ProcessId = 0, Guid = guid }; var messageBytes = DoorbellMessage.Serialize(message); await host.Connections.GetDoorbellSender(0).SendAsync(new EventData(messageBytes)); await host.Cleanup(true); return(deploymentId); } catch (Exception e) { logger.LogError($"Initialize failed: {e}"); throw; } }
public ComparisonForUser GetOrCreate(ComparisonForUser comparisonForUser) { if (!comparisonForUser.IsValid()) { return(null); } bool isSuccess = true; ComparisonForUser result = null; Adapter.ActionByContext(c => { GroupComparison groupComparison = GetOrCreateGroupComparison(comparisonForUser, c); if (IdValidator.IsInvalid(groupComparison.Id)) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "ComparisonsQuery.GetOrCreate не удалось создать! Название: {0}, описание: {1}", comparisonForUser.Title, comparisonForUser.Description); isSuccess = false; return; } result = new ComparisonForUser(groupComparison); int orderItem = 1; foreach (ComparisonItemForUser comparisonItemForUser in comparisonForUser.Items) { ComparisonItem comparisonItem = GetOrCreateComparisonItem(comparisonItemForUser, groupComparison.Id, orderItem++, c); if (IdValidator.IsInvalid(comparisonItem.Id)) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "ComparisonsQuery.GetOrCreate не удалось создать пункт для сравнения! " + "Id сравнения: {0}, название {1}, перевод названия {2}, описание {3}", groupComparison.Id, comparisonItemForUser.Title, comparisonItemForUser.TitleTranslated, comparisonItemForUser.Description); isSuccess = false; continue; } var newComparisonItemForUser = new ComparisonItemForUser(comparisonItem); result.AddItem(newComparisonItemForUser); int orderRule = 1; foreach (ComparisonRuleForUser comparisonRuleForUser in comparisonItemForUser.Rules) { ComparisonRule comparisonRule = GetOrCreateComparisonRule(comparisonRuleForUser, comparisonItem.Id, orderRule++, c); long ruleId = comparisonRule.Id; if (IdValidator.IsInvalid(ruleId)) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "ComparisonsQuery.GetOrCreate не удалось создать правило для сравнения! " + "Id пункта сравнения: {0}, описание {1}", comparisonItem.Id, comparisonRule.Description); isSuccess = false; continue; } var newComparisonRuleForUser = new ComparisonRuleForUser(comparisonRule); newComparisonItemForUser.AddRule(newComparisonRuleForUser); isSuccess = EnumerableValidator.IsNotEmpty(comparisonRuleForUser.Examples) && CreateExamples(comparisonRuleForUser.Examples, newComparisonRuleForUser, c); } } if (isSuccess) { //удалить пункты, правила, примеры, которые не были переданы в этот раз DeleteOldInfos(c, result); } }); return(isSuccess && result != null && result.IsValid() ? result : null); }
protected override void OnOpen() { log_ = LogManager.CreateLogger("User_Name", Log_Collection_, Log_Level_); log_.Debug("{0}, ID = {1}, Session.count = {2},", Log_Collection_.ToString(), ID, Sessions.Count); }
public Build(ILogger logger) { Logger = new LoggerWrapper(logger); }
public YopMailMainPageObject(IWebDriver webDriver) : base(webDriver) { LoggerWrapper.LogInfo("YopMail main page was successfully opened!"); }
public GrainBasedMembershipTable(IServiceProvider serviceProvider, LoggerWrapper <MembershipTableFactory> logger) { this.serviceProvider = serviceProvider; this.logger = logger; }
public LoadedProviderTypeLoaders(LoggerWrapper <LoadedProviderTypeLoaders> logger) { this.Managers = new ConcurrentBag <ProviderTypeLoader>(); AppDomain.CurrentDomain.AssemblyLoad += ProcessNewAssembly; this.logger = logger; }
public CodeGeneratorManager(IServiceProvider serviceProvider, LoggerWrapper <CodeGeneratorManager> logger) { this.serviceProvider = serviceProvider; this.Log = logger; }
public EmailYourEstimateLoginPageObject(IWebDriver webDriver) : base(webDriver) { LoggerWrapper.LogInfo("Email your estimate form was successfully opened!"); }
public HandleErrorExtendedAttribute() { _logger = LoggerWrapper.Create(typeof(HandleErrorExtendedAttribute)); }
public MvcApplication() { _logger = LoggerWrapper.Create(typeof(MvcApplication)); }