Exemplo n.º 1
0
 public ProtocolDefinition(
     ProtocolKey key,
     string nickname)
 {
     this.Key      = key;
     this.Nickname = nickname;
 }
        public void AddTypeAssociation <T>(StringCaseAgnostic key, bool overrideExisting = false)
            where T : TypeGeneration
        {
            if (!overrideExisting && typeDict.ContainsKey(key))
            {
                throw new ArgumentException("Cannot add two type associations on the same key: " + key);
            }

            typeDict[key] = typeof(T);
        }
        public bool TryGetTypeGeneration(StringCaseAgnostic name, out TypeGeneration gen)
        {
            Type t;

            if (!typeDict.TryGetValue(name, out t))
            {
                gen = null;
                return(false);
            }

            gen = Activator.CreateInstance(t) as TypeGeneration;
            return(true);
        }
 ushort?ILoquiRegistration.GetNameIndex(StringCaseAgnostic name) => throw new NotImplementedException();
Exemplo n.º 5
0
 public bool Equals(StringCaseAgnostic other)
 {
     return(string.Equals(Upper, other.Upper));
 }
Exemplo n.º 6
0
 public StringCaseAgnostic(StringCaseAgnostic rhs)
 {
     Value = rhs.Value;
     Upper = rhs.Upper;
 }
Exemplo n.º 7
0
 public static bool HasFieldWithName(this INoggolloquyObjectGetter obj, StringCaseAgnostic name)
 {
     return(-1 != obj.GetNameIndex(name));
 }