public Concept(String id = null, ILocalizedString name = null, ILocalizedString hint = null) { Name = name ?? new LocalizedStringVariable(); ID = id.EnsureIdIsSet(); Hint = hint ?? new LocalizedStringVariable(); Attributes = new HashSet <IAttribute>(); }
public LocalizedString(ILocalizedString source) : this() { var variable = (LocalizedStringVariable)source; foreach (String locale in variable.Locales) { Values.Add(new LocalizedStringValue(locale, variable.GetValue(locale))); } }
public void LoadTo(ILocalizedString destination) { var variable = (LocalizedStringVariable)destination; variable.Clear(); foreach (var value in Values) { variable.SetLocale(value.Locale, value.Value); } }
protected internal virtual string GetLocalizedStringInformation(ILocalizedString localizedString, string resolvedPath) { // ReSharper disable ConvertIfStatementToReturnStatement if (localizedString == null) { return($"Resolved path: {resolvedPath.ToArgumentString()}{Environment.NewLine} - No hit"); } // ReSharper restore ConvertIfStatementToReturnStatement return(string.Format(CultureInfo.InvariantCulture, "Resolved path: {2}{0}{1}Culture: {3}{0}{1}Name: {4}{0}{1}Resource not found: {5}{0}{1}Value: {6}", Environment.NewLine, " - ", resolvedPath.ToArgumentString(), localizedString.Culture.ToArgumentString(), localizedString.Name.ToArgumentString(), localizedString.ResourceNotFound, localizedString.Value.ToArgumentString())); }
public DiseaseName( ILocalizedString primary, ILocalizedString primaryPrefix, ILocalizedString secondary, ILocalizedString subject) { Primary = primary ?? throw new ArgumentNullException(nameof(primary)); PrimaryPrefix = primaryPrefix; Secondary = secondary; Subject = subject; }
public static string GetValueOrDefaultNoname(Language currentLanguage, ILocalizedString localizedString) { switch (currentLanguage) { case Language.English: default: return(localizedString?.En ?? GetUndefined(currentLanguage)); case Language.Russian: return(localizedString?.Ru ?? GetUndefined(currentLanguage)); } }
public static string GetValue(Language currentLanguage, ILocalizedString localizedString) { switch (currentLanguage) { case Language.English: default: return(localizedString?.En); case Language.Russian: return(localizedString?.Ru); } }
public override void Apply(ILocalizedString localizedString) { var variableString = localizedString as Semantics.Localization.LocalizedStringVariable; if (variableString != null) { variableString.Clear(); foreach (var value in Values) { variableString.SetLocale(value.Locale, value.Value); } } }
private static int InternalGenerateErrorCode(Exception e) { StackTrace stackTrace = new StackTrace(e); int hashCode = stackTrace.ToString().GetHashCode(); int hashCode2 = e.GetType().GetHashCode(); int num = 0; ILocalizedString localizedString = e as ILocalizedString; if (localizedString != null) { num = localizedString.LocalizedString.GetHashCode(); } return(num ^ hashCode ^ hashCode2); }
protected Statement(String id, ILocalizedString name, ILocalizedString hint = null) { Update(id); if (name != null) { Name = name; } else { throw new ArgumentNullException(nameof(name)); } Hint = hint ?? LocalizedString.Empty; }
public ProfessionPerk(ILocalizedString personEquipmentTemplate, ILocalizedString descriptionEquipmentTemplate) { Scheme = new PersonPerkScheme { Name = new LocalizedStringSubScheme { Ru = personEquipmentTemplate.Ru, En = personEquipmentTemplate.En }, Description = new LocalizedStringSubScheme { Ru = descriptionEquipmentTemplate.Ru, En = descriptionEquipmentTemplate.En } }; }
public static StepCollection AddCommandWithParameter(this Step step, string command, ILocalizedString suggestParameterText) { var commandWithParameter = new CommandStep(command, true); var commandWithoutOfParameter = new CommandStep(command, false); commandWithoutOfParameter.EchoReply(suggestParameterText, EchoOptions.EchoForceReply()); var commandAwaitParameter = commandWithoutOfParameter.AddAnyInput(); step.AddChildStep(commandWithParameter); step.AddChildStep(commandWithoutOfParameter); return(new StepCollection(new[] { commandWithParameter, commandAwaitParameter })); }
public virtual bool ContentEquals(ILocalizedString another) { return(another != null && another.Language == Language && another.Value == Value); }
public EntryName(TEntry entry, ILocalizedString localizedString) : base(localizedString.Value, localizedString.Language) { Entry = entry; }
public VenueName(Venue venue, ILocalizedString localizedString) : base(venue, localizedString) { }
public static LocalizedString From(ILocalizedString value) { return(value is Semantics.Localization.LocalizedStringVariable ? new LocalizedStringVariable(value as Semantics.Localization.LocalizedStringVariable) as LocalizedString : new LocalizedStringConstant(value as Semantics.Localization.LocalizedStringConstant)); }
public EventName(ReleaseEvent song, ILocalizedString localizedString) : base(song, localizedString) { }
public IDisease Create() { var roll = _dice.RollD6(); if (roll <= 1) { var nameGenerationAttempt = 0; do { var primaryName = _dice.RollFromList(DiseaseNames.Primary); ILocalizedString prefix = null; var rollPrefix = _dice.RollD6(); if (rollPrefix >= 4) { prefix = _dice.RollFromList(DiseaseNames.PrimaryPreffix); } ILocalizedString secondary = null; var rollSecondary = _dice.RollD6(); if (rollSecondary >= 4) { secondary = _dice.RollFromList(DiseaseNames.Secondary); } ILocalizedString subject = null; var rollSubject = _dice.RollD6(); if (rollSubject >= 6) { subject = _dice.RollFromList(DiseaseNames.Subject); } var diseaseName = new DiseaseName(primaryName, prefix, secondary, subject); // Проверяем, была ли уже такая болезнь. var isDuplicate = CheckDuplicates(diseaseName); if (isDuplicate) { nameGenerationAttempt++; continue; } var rolledSymptoms = RolledSymptoms(); var progressSpeed = RollDiseaseProgressSpeed(); var disease = new Disease(diseaseName, rolledSymptoms, progressSpeed); _usedDiseases.Add(diseaseName); return(disease); } while (nameGenerationAttempt < 10); // Не удалось сгенерировать уникальное имя. Значит вообще не генерируем болезнь. return(null); } else { return(null); } }
public TestStatement(string id, ILocalizedString name, ILocalizedString hint) : base(id, name, hint) { }
public EventSeriesName(ReleaseEventSeries series, ILocalizedString localizedString) : base(series, localizedString) { }
public override void Apply(ILocalizedString localizedString) { }
public abstract void Apply(ILocalizedString localizedString);
public EchoExecutor(ILocalizedString echoText, EchoOptions echoOptions) { _echoText = echoText; _echoOptions = echoOptions; }
public static Step EchoReply(this Step step, ILocalizedString localizedString, EchoOptions echoOptions = null) { step.AppendExecutor(new EchoExecutor(localizedString, echoOptions)); return(step); }
public EntryName(TEntry song, ILocalizedString localizedString) : base(localizedString.Value, localizedString.Language) { Entry = song; }