示例#1
0
        /// <summary>
        /// Add a class to the service for the given class type annotated with the KRPCClass attribute.
        /// Returns the name of the class.
        /// </summary>
        public string AddClass(Type classType)
        {
            TypeUtils.ValidateKRPCClass(classType);
            var name = classType.Name;

            if (Classes.ContainsKey(name))
            {
                throw new ServiceException("Service " + Name + " contains duplicate classes " + name);
            }
            Classes [name] = new ClassSignature(Name, name, classType.GetDocumentation());
            return(name);
        }
示例#2
0
 /// <summary>
 /// Add a class to the service for the given class type annotated with the KRPCClass attribute.
 /// Returns the name of the class.
 /// </summary>
 public string AddClass(Type classType)
 {
     TypeUtils.ValidateKRPCClass (classType);
     var name = classType.Name;
     if (Classes.ContainsKey (name))
         throw new ServiceException ("Service " + Name + " contains duplicate classes " + name);
     Classes [name] = new ClassSignature (Name, name, classType.GetDocumentation ());
     return name;
 }
示例#3
0
 void CheckDocumentation (ClassSignature cls)
 {
     CheckDocumentation (cls.FullyQualifiedName, cls.Documentation);
 }