예제 #1
0
 /// <summary>
 /// Attach this object as a LogMsgObserver and GlowCommandObserver if applicable
 /// </summary>
 /// <param name="extension"></param>
 private void ObserveCmdsAndLog(GlowExtension extension)
 {
     if(extension is Loggable) {
         Loggable log = (Loggable)extension;
         log.AttachObserver(this);
     }
     if(extension is GlowCommandSender) {
         GlowCommandSender sender = (GlowCommandSender)extension;
         sender.AttachObserver(this);
     }
 }
 //TODO make a utility / static function / move elsewhere?
 private void AttemptToAttachSelfToExt(GlowExtension ext)
 {
     if(ext is ToolbarNotificationSource) {
         ToolbarNotificationSource src = (ToolbarNotificationSource)ext;
         src.AttachObserver(this);
     }
     if(ext is GlowCommandSender) {
         GlowCommandSender sender = (GlowCommandSender)ext;
         sender.AttachObserver(this);
     }
 }