Example #1
0
        /**
         * Adds a TimeReference instance for the specified name.
         */
        public TimeReference Add(string name)
        {
            TimeReference newTimeReference = new TimeReference(name);

            instanceMap[name] = newTimeReference;
            return(newTimeReference);
        }
        /**
         * Returns a default instance that can be used by any class.
         */
        public static TimeReference GetDefaultInstance()
        {
            if (DEFAULT_INSTANCE == null)
            {
                DEFAULT_INSTANCE = new TimeReference("Default");
            }

            return(DEFAULT_INSTANCE);
        }
Example #3
0
        /**
         * Retrieves the TimeReference instance for this specified name.
         */
        public TimeReference Get(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(TimeReference.GetDefaultInstance());
            }

            Assertion.Assert(instanceMap.ContainsKey(name));
            return(instanceMap[name]);
        }
Example #4
0
 /**
  * Returns the default TimeReference instance.
  */
 public TimeReference GetDefault()
 {
     return(TimeReference.GetDefaultInstance());
 }