Exemplo n.º 1
0
        protected virtual void RegisterCommandNotifications()
        {
            // cvar value changed
            m_notificationCenter.Register(CCommandNotifications.CVarValueChanged, delegate(CNotification n)
            {
                bool manual = n.Get <bool>(CCommandNotifications.KeyManualMode);

                CVar cvar = n.Get <CVar>(CCommandNotifications.CVarValueChangedKeyVar);
                CAssert.IsNotNull(cvar);

                OnCVarValueChanged(cvar, manual);
            });

            // binding changed
            m_notificationCenter.Register(CCommandNotifications.CBindingsChanged, delegate(CNotification n)
            {
                bool manual = n.Get <bool>(CCommandNotifications.KeyManualMode);
                OnCBindingsChanged(manual);
            });

            // alias changed
            m_notificationCenter.Register(CCommandNotifications.CAliasesChanged, delegate(CNotification n)
            {
                bool manual = n.Get <bool>(CCommandNotifications.KeyManualMode);
                OnCAliasesChanged(manual);
            });
        }
 public static void RegisterNotification(string name, CNotificationDelegate del)
 {
     s_sharedInstance.Register(name, del);
 }