Esempio n. 1
0
 /// <summary>
 ///   Returns the single instance of the DNManager class.
 ///   In case this instance does not exist it creates that instance.
 /// </summary>
 /// <returns> DNManager instance</returns>
 public static DNManager getInstance()
 {
     if (_instance == null)
     {
         lock (typeof(DNManager))
         {
             if (_instance == null)
             {
                 _instance = new DNManager();
             }
         }
     }
     return(_instance);
 }
Esempio n. 2
0
        /// <summary>
        /// Converts Magic 'DotNet' Type to 'dotNetType'
        /// </summary>
        /// <param name="magicVal"></param>
        /// <param name="dotNetType"></param>
        /// <returns></returns>
        private static object convertDotNetMagicToDotNet(string magicVal, Type dotNetType)
        {
            if (dotNetType == typeof(Object))
            {
                // From blobstr, get the key. Then get object from DNObjectsCollection, clone it and return it.
                int    key = BlobType.getKey(magicVal);
                Object obj = DNManager.getInstance().DNObjectsCollection.GetDNObj(key);

                return(obj);
            }
            else
            {
                return(null);
            }
        }