Exemple #1
0
 internal void UpdateActiveContext()
 {
     for (int n = contexts.Count - 1; n >= 0; n--)
     {
         StatusBarContextImpl ctx = contexts [n];
         if (ctx.StatusChanged)
         {
             if (ctx != activeContext)
             {
                 activeContext = ctx;
                 activeContext.Update();
             }
             return;
         }
     }
     throw new InvalidOperationException();              // There must be at least the main context
 }
Exemple #2
0
        internal void Remove(StatusBarContextImpl ctx)
        {
            if (ctx == mainContext)
            {
                return;
            }

            StatusBarContextImpl oldActive = activeContext;

            contexts.Remove(ctx);
            UpdateActiveContext();
            if (oldActive != activeContext)
            {
                // Removed the active context. Update the status bar.
                activeContext.Update();
            }
        }