Пример #1
0
 internal static DdeContext GetDefault()
 {
     lock (_InstanceLock)
     {
         if (_Instance == null)
         {
             _Instance = new DdeContext();
         }
         return _Instance;
     }
 }
Пример #2
0
 internal static DdeContext GetDefault(ISynchronizeInvoke synchronizingObject)
 {
     if (synchronizingObject != null)
     {
         lock (_Instances)
         {
             DdeContext context = _Instances[synchronizingObject];
             if (context == null)
             {
                 if (synchronizingObject is DdeContext)
                 {
                     context = synchronizingObject as DdeContext;
                 }
                 else
                 {
                     context = new DdeContext(synchronizingObject);
                 }
                 _Instances.Add(synchronizingObject, context);
             }
             return context;
         }
     }
     return GetDefault();
 }