public static uint FromDateTime(DateTime dateTime) { PscxArgumentOutOfRangeException.ThrowIf("dateTime", (dateTime < UnixEraBegin), "DateTime too small for unix time"); PscxArgumentOutOfRangeException.ThrowIf("dateTime", (dateTime > UnixEraEnd), "DateTime too big for unix time"); return((uint)(dateTime - UnixEraBegin).TotalSeconds); }
public VersionFieldAttribute(uint componentCount, TypeCode componentType) { PscxArgumentOutOfRangeException.ThrowIf("componentCount", componentCount < 1 || componentCount > 4); PscxArgumentOutOfRangeException.ThrowIf("componentType", componentType <TypeCode.SByte || componentType> TypeCode.UInt64); this.type = componentType; this.count = componentCount; }