-
Notifications
You must be signed in to change notification settings - Fork 13
/
ClassicEditWithNppExplorerCommandHandler.cpp
39 lines (29 loc) · 1.35 KB
/
ClassicEditWithNppExplorerCommandHandler.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "pch.h"
#include "ClassicEditWithNppExplorerCommandHandler.h"
#include "LoggingHelper.h"
#include "SharedState.h"
using namespace NppShell::CommandHandlers;
using namespace NppShell::Helpers;
extern LoggingHelper g_loggingHelper;
ClassicEditWithNppExplorerCommandHandler::ClassicEditWithNppExplorerCommandHandler()
{
g_loggingHelper.LogMessage(L"ClassicEditWithNppExplorerCommandHandler::ctor", L"Creating object");
}
ClassicEditWithNppExplorerCommandHandler::~ClassicEditWithNppExplorerCommandHandler()
{
g_loggingHelper.LogMessage(L"ClassicEditWithNppExplorerCommandHandler::~tor", L"Destroying object");
}
const EXPCMDSTATE ClassicEditWithNppExplorerCommandHandler::State(IShellItemArray* psiItemArray)
{
UNREFERENCED_PARAMETER(psiItemArray);
// First we get the current state, before we clear it.
CounterState currentState = state->GetState(L"ClassicEditWithNppExplorerCommandHandler");
state->SetState(L"ClassicEditWithNppExplorerCommandHandler", NotSet);
g_loggingHelper.LogMessage(L"ClassicEditWithNppExplorerCommandHandler::State", L"Current state: " + std::to_wstring(currentState));
// If it is set, it means the State function has been called in the Modern command handler last, which means we should hide this one.
if (currentState == CounterState::Set)
{
return ECS_HIDDEN;
}
return ECS_ENABLED;
}