public string GetName(TypeDefinition type) { if (type.IsArray) { return($"{GetName(type.GetElementType())}[]"); } return(Aliases.ContainsKey(type.FullName) ? Aliases[type.FullName] : type.FullName); }
public static String ToZid(String zid) { if (Aliases.ContainsKey(zid)) { return(Aliases[zid]); } return(zid); }
private KumaScope GetAlias(string name) { if (Aliases.ContainsKey(name)) { return(this); } if (ParentScope != null) { return(ParentScope.GetAlias(name)); } return(null); }
private bool CheckAliases(string name) { if (Aliases.ContainsKey(name)) { return(true); } if (ParentScope != null) { return(ParentScope.CheckAliases(name)); } return(false); }
private Variable findVariable(ParameterInfo param, IGenerationModel chain) { var type = param.ParameterType; if (Aliases.ContainsKey(type)) { var actualType = Aliases[type]; var inner = chain.FindVariable(actualType); return(new CastVariable(inner, type)); } return(chain.FindVariable(type)); }
static void Main(string[] args) { bool ok = false; while (!ok) { Console.Write("Enter company name: "); string company_name = Console.ReadLine(); Regex company_name_pattern = new Regex("^[A-Za-z][-A-Za-z ,.\"\"]*$"); if (company_name_pattern.IsMatch(company_name)) { Manager = new CompanyManager(new Company(company_name)); ok = true; } else { Console.WriteLine("Wrong company name format!"); } } while (!ShouldClose) { Console.WriteLine(); string[] command = Console.ReadLine().Split(" "); if (command[0] == "") { continue; } if (Aliases.ContainsKey(command[0])) { command[0] = Aliases[command[0]]; } if (Commands.ContainsKey(command[0])) { try { Commands[command[0]].Method(command); } catch (Exception e) { Console.WriteLine(e.Message); } } else { Console.WriteLine("Unknown command. Please, try again or type \"help\" to get full list of commands."); } } }
/// <summary> /// Разрешает коммит по имени или по псевдониму /// </summary> /// <param name="hashOrAlias"></param> /// <returns></returns> public Commit Resolve(string hashOrAlias) { var hash = hashOrAlias; if (Aliases.ContainsKey(hashOrAlias)) { hash = Aliases[hashOrAlias]; } if (Commits.ContainsKey(hash)) { return(Commits[hash]); } return(null); }
public DynamicSpriteFont this[string idx] { get { if (idx != null) { if (Aliases.ContainsKey(idx)) { idx = Aliases[idx]; } return(m_fontRegistered.TryGetValue(idx, out DynamicSpriteFont value) ? value : null); } return(null); } }
private void UpdateAliasesAndExtras() { Aliases.Clear(); Extras.Clear(); foreach (var a in AliasesOrdered) { if (Aliases.ContainsKey(a.Alias)) //deal with repeated aliases. { //Logger.Log("Repeated Alias\t" + t.Alias); if (!Extras.ContainsKey(a.Alias)) //initialize if needed. { Extras.Add(a.Alias, new List <OtoAlias>()); } Extras[a.Alias].Add(a); } else //normal case { Aliases.Add(a.Alias, a); } } }
public static String ToZid(String zid, Locale locale) { String mzone = ZidToMzone[zid]; if (mzone == null && Aliases.ContainsKey(zid)) { zid = Aliases[zid]; mzone = ZidToMzone[zid]; } if (mzone != null) { IDictionary <String, String> map = MzoneToZidL[mzone]; if (map != null && map.ContainsKey(locale.Country)) { zid = map[locale.Country]; } else { zid = MzoneToZid[mzone]; } } return(ToZid(zid)); }
// Alias|Reference: Bible[alias|reference] public string this[string value] { get { var alias = value.ToUpper(); if (Aliases.ContainsKey(alias)) { return(Aliases[alias]); } var reference = ParseReference(value); var toBook = reference.ToBook != null ? reference.ToBook : reference.Book; var toChapter = reference.ToChapter > 0 ? reference.ToChapter : Chapters(toBook); return(Passage( reference.Book, reference.Chapter > 0 ? reference.Chapter : 1, reference.Verse > 0 ? reference.Verse : 1, toBook, toChapter, reference.ToVerse > 0 ? reference.ToVerse : Verses(toBook, toChapter) )); } }
internal static string GetTypeName(Type T) { return(Aliases.ContainsKey(T) ? Aliases[T] : T.Name); }
/// <summary> /// Determines whether the specified parser identifier has an alias. /// </summary> /// <param name="parserId">The parser identifier.</param> /// <returns><c>true</c> if the specified parser identifier has an alias; otherwise, <c>false</c>.</returns> public virtual bool HasAlias(string parserId) => Aliases.ContainsKey(parserId);