示例#1
0
文件: action.cpp 项目: bagdxk/openafs
void Actions_OnNotify (WPARAM wp, LPARAM lp)
{
   LPASACTION pAction = (LPASACTION)lp;
   BOOL fFinished = (BOOL)wp;

   if (pAction)
      {
      // We've just been told something happened;
      //
      switch (pAction->Action)
         {
         case ACTION_REFRESH:
            // If we get a Finished Refreshing notification, it's a safe bet
            // that the admin server has done a significant refresh to its
            // cache; so, we'll use that as a trigger to repopulate the lists
            // on the main dialog.
            //
            if (fFinished)
               Display_PopulateList();
            break;
         }

      // If the Actions window is being displayed, use this notification
      // to update our stored list-of-actions.
      //
      if (IsWindow (l.hAction))
         {
         if (!fFinished)
            FixActionTime (&pAction->csecActive);

         if (!l.pActionList)
            asc_ActionListCreate (&l.pActionList);

         if (l.pActionList)
            {
            if (fFinished)
               asc_ActionListRemoveEntry (&l.pActionList, pAction->idAction);
            else if (!asc_ActionListTest (&l.pActionList, pAction->idAction))
               asc_ActionListAddEntry (&l.pActionList, pAction);
            }

         Actions_Refresh();
         }

      Delete (pAction);
      }
}
示例#2
0
EXPORTED BOOL ADMINAPI AfsAppLib_asc_ActionListTest (LPASACTIONLIST *ppList, DWORD idAction, LPASACTION pAction)
{
   return asc_ActionListTest (ppList, idAction, pAction);
}