Пример #1
0
 /// <summary>
 /// Generates a RevisionId based on the "yyyyddMM.HHmmss.fffffff" formated
 /// string representation of a DateTime object and the given SystemId.
 /// </summary>
 /// <param name="DateTimeString">A DateTime object as "yyyyddMM.HHmmss.fffffff"-formated string</param>
 /// <param name="SystemId">An unique identificator for the generating system, process or thread</param>
 /// <exception cref="System.FormatException"></exception>
 public RevisionId(String DateTimeString, System_Id SystemId)
 {
     try
     {
         this.Timestamp = (UInt64)(DateTime.ParseExact(DateTimeString, "yyyyddMM.HHmmss.fffffff", null)).Ticks;
         this.SystemId  = SystemId;
     }
     catch
     {
         throw new FormatException("The given string could not be parsed!");
     }
 }
Пример #2
0
        /// <summary>
        /// Generates a RevisionId based on the "yyyyddMM.HHmmss.fffffff(SystemId)"
        /// formated string representation of a RevId.
        /// </summary>
        /// <param name="RevIdString">A RevId object as "yyyyddMM.HHmmss.fffffff(SystemId)"-formated string</param>
        /// <exception cref="System.FormatException"></exception>
        public RevisionId(String RevIdString)
        {
            try
            {
                var __Timestamp = RevIdString.Remove(RevIdString.IndexOf("("));
                var __SystemId  = RevIdString.Substring(__Timestamp.Length + 1, RevIdString.Length - __Timestamp.Length - 2);

                this.Timestamp = (UInt64)(DateTime.ParseExact(__Timestamp, "yyyyddMM.HHmmss.fffffff", null)).Ticks;
                this.SystemId  = System_Id.Parse(__SystemId);
            }
            catch
            {
                throw new FormatException("The given string could not be parsed!");
            }
        }
Пример #3
0
 /// <summary>
 /// Generates a RevisionId based on the given DateTime object and the given SystemId.
 /// </summary>
 /// <param name="DateTime">A DateTime object</param>
 /// <param name="SystemId">An unique identificator for the generating system, process or thread</param>
 public RevisionId(DateTime DateTime, System_Id SystemId)
 {
     this.Timestamp = (UInt64)DateTime.Ticks;
     this.SystemId  = SystemId;
 }
Пример #4
0
 /// <summary>
 /// Generates a RevisionId based on the given UInt64 timestamp and the given SystemId.
 /// </summary>
 /// <param name="Timestamp">A timestamp</param>
 /// <param name="SystemId">An unique identificator for the generating system, process or thread</param>
 public RevisionId(UInt64 Timestamp, System_Id SystemId)
 {
     this.Timestamp = Timestamp;
     this.SystemId  = SystemId;
 }
Пример #5
0
 /// <summary>
 /// Generates a RevisionId based on the actual timestamp and the given SystemId.
 /// </summary>
 /// <param name="SystemId">An unique identificator for the generating system, process or thread</param>
 public RevisionId(System_Id SystemId)
 {
     this.Timestamp = (UInt64)UniqueTimestamp.Ticks;
     this.SystemId  = SystemId;
 }