public virtual bool Set(string key, DateTime value) { if (NSJSDateTime.Invalid(value)) { throw new ArgumentNullException("Parameter cannot be an invalid time"); } long time = NSJSDateTime.DateTimeToLocalDate(value); return(this.Set(key, (name) => nsjs_localvalue_object_property_set_datetime(this.Isolate, this.Handle, name, time))); }
public static NSJSDateTime New(NSJSVirtualMachine machine, DateTime value) { if (NSJSDateTime.Invalid(value)) { throw new ArgumentOutOfRangeException("Parameter cannot be an invalid time"); } if (machine == null) { throw new ArgumentNullException("machine"); } IntPtr isolate = machine.Isolate; if (isolate == NULL) { throw new InvalidOperationException("machine"); } long time = NSJSDateTime.DateTimeToLocalDate(value); IntPtr handle = nsjs_localvalue_datetime_new(isolate, time); if (handle == NULL) { throw new InvalidOperationException("machine"); } return new NSJSDateTime(handle, machine); }