Exemple #1
0
 public virtual bool Set(string name, ExtensionObjectTemplate value, PropertyAttribute attributes = PropertyAttribute.None)
 {
     if (value == null)
     {
         throw new ArgumentNullException("object_template");
     }
     return(Handling <bool>(name, (s) => nsjs_virtualmachine_extension_object_template_set_object(this.Handle, s, value.Handle, attributes)));
 }
Exemple #2
0
 public virtual ExtensionObjectTemplate GetExtension()
 {
     lock (this)
     {
         if (extension == null)
         {
             IntPtr owner = nsjs_virtualmachine_get_extension_object_template(this.Handle);
             if (owner != NULL)
             {
                 extension = new ExtensionObjectTemplate(owner);
             }
         }
     }
     if (extension == null)
     {
         throw new InvalidOperationException("There is currently no way to get the extension");
     }
     return(extension);
 }