Exemple #1
0
        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);
        }
Exemple #2
0
        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;
        }