Пример #1
0
 /// <summary> Share a class with other clients to use for remote code execution </summary>
 /// <param name="ClassType">The Class object to share with others</param>
 /// <param name="RemoteInitialize">False: The class will be initialized locally using the "ClassArgs" objects,
 ///                                True: The remote client will give the ClassArgs to use for initializing the object and will ignore the local argument objects</param>
 /// <param name="ClassArgs">The objects to initialize the class with</param>
 /// <param name="MaxInitializations">The maximum count that the class can be shared </param>
 public void ShareClass(Type ClassType, bool RemoteInitialize = false, int MaxInitializations = 100, params object[] ClassArgs)
 {
     lock (SharedClasses)
     {
         if (SharedClasses.ContainsKey(ClassType.Name))
         {
             throw new Exception("A class with this name is already shared");
         }
         SharedClasses.Add(ClassType.Name, new SharedClass(ClassType.Name, ClassType, this, RemoteInitialize, MaxInitializations, ClassArgs));
     }
 }