示例#1
0
 // We assume that Set() is called inside the transaction, as soon
 // as any write work has been done on the catalog.
 internal void Set()
 {
     try
     {
         if (!_set && ContextUtil.IsInTransaction)
         {
             _set = true;
             RegistryKey key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Classes\\CLSID");
             _version = (int)(key.GetValue("CLBVersion", 0));
             DBG.Info(DBG.Registration, "Old version: " + _version);
         }
     }
     catch (Exception)
     {
         // We don't need to watch if the key isn't there, or if
         // other things failed.
         _set     = false;
         _version = 0;
         DBG.Warning(DBG.Registration, "Failed to retreive original catalog version.");
     }
 }