From 36e108aafac41268a99243988310e79477f1f5af Mon Sep 17 00:00:00 2001 From: hanzhang54 Date: Mon, 12 Apr 2021 11:07:11 +0800 Subject: [PATCH] Updated CalcViewModel and missing files (#10) * Updated CalcViewModel and WinMeta * Added Calculator.rc * Resolved comment for InitializeLocalizationSettings --- .../Automation/NarratorAnnouncement.cpp | 2 +- .../Common/LocalizationSettings.h | 208 +++++++++--------- src/CalcViewModel/Common/NavCategory.cpp | 15 +- src/CalcViewModel/Common/NavCategory.h | 5 +- src/CalcViewModel/HistoryViewModel.h | 2 +- src/Calculator/App.xaml.cs | 2 +- src/Calculator/Calculator.csproj | 4 +- src/Calculator/Calculator.rc | 11 + .../GraphingCalculator.xaml.cs | 8 +- src/Calculator/WinMeta.cs | 152 +++++++++++++ 10 files changed, 289 insertions(+), 120 deletions(-) create mode 100644 src/Calculator/Calculator.rc create mode 100644 src/Calculator/WinMeta.cs diff --git a/src/CalcViewModel/Common/Automation/NarratorAnnouncement.cpp b/src/CalcViewModel/Common/Automation/NarratorAnnouncement.cpp index 5365937d..271a4c24 100644 --- a/src/CalcViewModel/Common/Automation/NarratorAnnouncement.cpp +++ b/src/CalcViewModel/Common/Automation/NarratorAnnouncement.cpp @@ -178,7 +178,7 @@ NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphViewChangedAnnouncement(S NarratorAnnouncement ^ CalculatorAnnouncement::GetFunctionRemovedAnnouncement(String ^ announcement) { return ref new NarratorAnnouncement( - announcement, CalculatorActivityIds::FunctionRemoved, AutomationNotificationKind::ItemRemoved, AutomationNotificationProcessing::MostRecent); + announcement, CalculatorActivityIds::FunctionRemoved, AutomationNotificationKind::ItemRemoved, AutomationNotificationProcessing::ImportantMostRecent); } NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphViewBestFitChangedAnnouncement(Platform::String ^ announcement) diff --git a/src/CalcViewModel/Common/LocalizationSettings.h b/src/CalcViewModel/Common/LocalizationSettings.h index fe0625d2..16b02b51 100644 --- a/src/CalcViewModel/Common/LocalizationSettings.h +++ b/src/CalcViewModel/Common/LocalizationSettings.h @@ -15,115 +15,17 @@ namespace CalculatorApp private: LocalizationSettings() // Use DecimalFormatter as it respects the locale and the user setting + // CSHARP_MIGRATION: TODO: //: LocalizationSettings(LocalizationService::GetInstance()->GetRegionalSettingsAwareDecimalFormatter()) { - LocalizationSettings(LocalizationService::GetInstance()->GetRegionalSettingsAwareDecimalFormatter()); + InitializeLocalizationSettings(LocalizationService::GetInstance()->GetRegionalSettingsAwareDecimalFormatter()); } public: // This is only public for unit testing purposes. LocalizationSettings(Windows::Globalization::NumberFormatting::DecimalFormatter ^ formatter) { - formatter->FractionDigits = 0; - formatter->IsDecimalPointAlwaysDisplayed = false; - - for (unsigned int i = 0; i < m_digitSymbols.size(); i++) - { - m_digitSymbols[i] = formatter->FormatUInt(i)->Data()[0]; - } - - wchar_t resolvedName[LOCALE_NAME_MAX_LENGTH]; - int result = ResolveLocaleName(formatter->ResolvedLanguage->Data(), resolvedName, LOCALE_NAME_MAX_LENGTH); - if (result == 0) - { - throw std::runtime_error("Unexpected error resolving locale name"); - } - else - { - m_resolvedName = ref new Platform::String(resolvedName); - wchar_t decimalString[LocaleSettingBufferSize] = L""; - result = GetLocaleInfoEx(m_resolvedName->Data(), LOCALE_SDECIMAL, decimalString, static_cast(std::size(decimalString))); - if (result == 0) - { - throw std::runtime_error("Unexpected error while getting locale info"); - } - - wchar_t groupingSymbolString[LocaleSettingBufferSize] = L""; - result = GetLocaleInfoEx(m_resolvedName->Data(), LOCALE_STHOUSAND, groupingSymbolString, static_cast(std::size(groupingSymbolString))); - if (result == 0) - { - throw std::runtime_error("Unexpected error while getting locale info"); - } - - wchar_t numberGroupingString[LocaleSettingBufferSize] = L""; - result = GetLocaleInfoEx(m_resolvedName->Data(), LOCALE_SGROUPING, numberGroupingString, static_cast(std::size(numberGroupingString))); - if (result == 0) - { - throw std::runtime_error("Unexpected error while getting locale info"); - } - - // Get locale info for List Separator, eg. comma is used in many locales - wchar_t listSeparatorString[4] = L""; - result = ::GetLocaleInfoEx( - m_resolvedName->Data(), - LOCALE_SLIST, - listSeparatorString, - static_cast(std::size(listSeparatorString))); // Max length of the expected return value is 4 - if (result == 0) - { - throw std::runtime_error("Unexpected error while getting locale info"); - } - - int currencyTrailingDigits = 0; - result = GetLocaleInfoEx( - m_resolvedName->Data(), - LOCALE_ICURRDIGITS | LOCALE_RETURN_NUMBER, - (LPWSTR)¤cyTrailingDigits, - sizeof(currencyTrailingDigits) / sizeof(WCHAR)); - if (result == 0) - { - throw std::runtime_error("Unexpected error while getting locale info"); - } - - // Currency symbol precedence is either 0 or 1. - // A value of 0 indicates the symbol follows the currency value. - int currencySymbolPrecedence = 1; - result = GetLocaleInfoEx( - m_resolvedName->Data(), - LOCALE_IPOSSYMPRECEDES | LOCALE_RETURN_NUMBER, - (LPWSTR)¤cySymbolPrecedence, - sizeof(currencySymbolPrecedence) / sizeof(WCHAR)); - - // As CalcEngine only supports the first character of the decimal separator, - // Only first character of the decimal separator string is supported. - m_decimalSeparator = decimalString[0]; - m_numberGroupSeparator = groupingSymbolString[0]; - m_numberGrouping = numberGroupingString; - m_listSeparator = listSeparatorString; - m_currencyTrailingDigits = currencyTrailingDigits; - m_currencySymbolPrecedence = currencySymbolPrecedence; - } - - // Get the system calendar type - // Note: This function returns 0 on failure. - // We'll ignore the failure in that case and the CalendarIdentifier would get set to GregorianCalendar. - CALID calId; - ::GetLocaleInfoEx(m_resolvedName->Data(), LOCALE_ICALENDARTYPE | LOCALE_RETURN_NUMBER, reinterpret_cast(&calId), sizeof(calId)); - - m_calendarIdentifier = GetCalendarIdentifierFromCalid(calId); - - // Get FirstDayOfWeek Date and Time setting - wchar_t day[80] = L""; - ::GetLocaleInfoEx( - m_resolvedName->Data(), - LOCALE_IFIRSTDAYOFWEEK, // The first day in a week - reinterpret_cast(day), // Argument is of type PWSTR - static_cast(std::size(day))); // Max return size are 80 characters - - // The LOCALE_IFIRSTDAYOFWEEK integer value varies from 0, 1, .. 6 for Monday, Tuesday, ... Sunday - // DayOfWeek enum value varies from 0, 1, .. 6 for Sunday, Monday, ... Saturday - // Hence, DayOfWeek = (valueof(LOCALE_IFIRSTDAYOFWEEK) + 1) % 7 - m_firstDayOfWeek = static_cast((_wtoi(day) + 1) % 7); // static cast int to DayOfWeek enum + InitializeLocalizationSettings(formatter); } // A LocalizationSettings object is not copyable. @@ -300,6 +202,110 @@ namespace CalculatorApp private: + void InitializeLocalizationSettings(Windows::Globalization::NumberFormatting::DecimalFormatter ^ formatter) + { + formatter->FractionDigits = 0; + formatter->IsDecimalPointAlwaysDisplayed = false; + + for (unsigned int i = 0; i < m_digitSymbols.size(); i++) + { + m_digitSymbols[i] = formatter->FormatUInt(i)->Data()[0]; + } + + wchar_t resolvedName[LOCALE_NAME_MAX_LENGTH]; + int result = ResolveLocaleName(formatter->ResolvedLanguage->Data(), resolvedName, LOCALE_NAME_MAX_LENGTH); + if (result == 0) + { + throw std::runtime_error("Unexpected error resolving locale name"); + } + else + { + m_resolvedName = ref new Platform::String(resolvedName); + wchar_t decimalString[LocaleSettingBufferSize] = L""; + result = GetLocaleInfoEx(m_resolvedName->Data(), LOCALE_SDECIMAL, decimalString, static_cast(std::size(decimalString))); + if (result == 0) + { + throw std::runtime_error("Unexpected error while getting locale info"); + } + + wchar_t groupingSymbolString[LocaleSettingBufferSize] = L""; + result = GetLocaleInfoEx(m_resolvedName->Data(), LOCALE_STHOUSAND, groupingSymbolString, static_cast(std::size(groupingSymbolString))); + if (result == 0) + { + throw std::runtime_error("Unexpected error while getting locale info"); + } + + wchar_t numberGroupingString[LocaleSettingBufferSize] = L""; + result = GetLocaleInfoEx(m_resolvedName->Data(), LOCALE_SGROUPING, numberGroupingString, static_cast(std::size(numberGroupingString))); + if (result == 0) + { + throw std::runtime_error("Unexpected error while getting locale info"); + } + + // Get locale info for List Separator, eg. comma is used in many locales + wchar_t listSeparatorString[4] = L""; + result = ::GetLocaleInfoEx( + m_resolvedName->Data(), + LOCALE_SLIST, + listSeparatorString, + static_cast(std::size(listSeparatorString))); // Max length of the expected return value is 4 + if (result == 0) + { + throw std::runtime_error("Unexpected error while getting locale info"); + } + + int currencyTrailingDigits = 0; + result = GetLocaleInfoEx( + m_resolvedName->Data(), + LOCALE_ICURRDIGITS | LOCALE_RETURN_NUMBER, + (LPWSTR)¤cyTrailingDigits, + sizeof(currencyTrailingDigits) / sizeof(WCHAR)); + if (result == 0) + { + throw std::runtime_error("Unexpected error while getting locale info"); + } + + // Currency symbol precedence is either 0 or 1. + // A value of 0 indicates the symbol follows the currency value. + int currencySymbolPrecedence = 1; + result = GetLocaleInfoEx( + m_resolvedName->Data(), + LOCALE_IPOSSYMPRECEDES | LOCALE_RETURN_NUMBER, + (LPWSTR)¤cySymbolPrecedence, + sizeof(currencySymbolPrecedence) / sizeof(WCHAR)); + + // As CalcEngine only supports the first character of the decimal separator, + // Only first character of the decimal separator string is supported. + m_decimalSeparator = decimalString[0]; + m_numberGroupSeparator = groupingSymbolString[0]; + m_numberGrouping = numberGroupingString; + m_listSeparator = listSeparatorString; + m_currencyTrailingDigits = currencyTrailingDigits; + m_currencySymbolPrecedence = currencySymbolPrecedence; + } + + // Get the system calendar type + // Note: This function returns 0 on failure. + // We'll ignore the failure in that case and the CalendarIdentifier would get set to GregorianCalendar. + CALID calId; + ::GetLocaleInfoEx(m_resolvedName->Data(), LOCALE_ICALENDARTYPE | LOCALE_RETURN_NUMBER, reinterpret_cast(&calId), sizeof(calId)); + + m_calendarIdentifier = GetCalendarIdentifierFromCalid(calId); + + // Get FirstDayOfWeek Date and Time setting + wchar_t day[80] = L""; + ::GetLocaleInfoEx( + m_resolvedName->Data(), + LOCALE_IFIRSTDAYOFWEEK, // The first day in a week + reinterpret_cast(day), // Argument is of type PWSTR + static_cast(std::size(day))); // Max return size are 80 characters + + // The LOCALE_IFIRSTDAYOFWEEK integer value varies from 0, 1, .. 6 for Monday, Tuesday, ... Sunday + // DayOfWeek enum value varies from 0, 1, .. 6 for Sunday, Monday, ... Saturday + // Hence, DayOfWeek = (valueof(LOCALE_IFIRSTDAYOFWEEK) + 1) % 7 + m_firstDayOfWeek = static_cast((_wtoi(day) + 1) % 7); // static cast int to DayOfWeek enum + } + static Platform::String^ GetCalendarIdentifierFromCalid(CALID calId) { switch (calId) diff --git a/src/CalcViewModel/Common/NavCategory.cpp b/src/CalcViewModel/Common/NavCategory.cpp index f61f6830..e8a93cec 100644 --- a/src/CalcViewModel/Common/NavCategory.cpp +++ b/src/CalcViewModel/Common/NavCategory.cpp @@ -449,18 +449,19 @@ ViewMode NavCategory::GetViewModeForVirtualKey(MyVirtualKey virtualKey) return (iter != s_categoryManifest.end()) ? iter->viewMode : ViewMode::None; } -vector NavCategory::GetCategoryAcceleratorKeys() +void NavCategory::GetCategoryAcceleratorKeys(IVector ^ accelerators) { - vector accelerators{}; - for (auto category : s_categoryManifest) + if (accelerators != nullptr) { - if (category.virtualKey != MyVirtualKey::None) + accelerators->Clear(); + for (auto category : s_categoryManifest) { - accelerators.push_back(category.virtualKey); + if (category.virtualKey != MyVirtualKey::None) + { + accelerators->Append(category.virtualKey); + } } } - - return accelerators; } NavCategoryGroup::NavCategoryGroup(const NavCategoryGroupInitializer& groupInitializer) diff --git a/src/CalcViewModel/Common/NavCategory.h b/src/CalcViewModel/Common/NavCategory.h index b7c46057..d786b5a2 100644 --- a/src/CalcViewModel/Common/NavCategory.h +++ b/src/CalcViewModel/Common/NavCategory.h @@ -151,6 +151,7 @@ namespace CalculatorApp static int GetPosition(ViewMode mode); static ViewMode GetViewModeForVirtualKey(MyVirtualKey virtualKey); + static void GetCategoryAcceleratorKeys(Windows::Foundation::Collections::IVector ^ resutls); internal : NavCategory( Platform::String ^ name, @@ -172,8 +173,6 @@ namespace CalculatorApp { } - static std::vector GetCategoryAcceleratorKeys(); - private: static bool IsModeInCategoryGroup(ViewMode mode, CategoryGroupType groupType); @@ -191,7 +190,7 @@ namespace CalculatorApp static Windows::Foundation::Collections::IObservableVector ^ CreateMenuOptions(); - internal : static NavCategoryGroup ^ CreateCalculatorCategory(); + static NavCategoryGroup ^ CreateCalculatorCategory(); static NavCategoryGroup ^ CreateConverterCategory(); private: diff --git a/src/CalcViewModel/HistoryViewModel.h b/src/CalcViewModel/HistoryViewModel.h index f340c58d..da1c4026 100644 --- a/src/CalcViewModel/HistoryViewModel.h +++ b/src/CalcViewModel/HistoryViewModel.h @@ -49,10 +49,10 @@ namespace CalculatorApp event HistoryItemClickedHandler ^ HistoryItemClicked; void ShowItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel ^ e); void DeleteItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel ^ e); + void ReloadHistory(_In_ CalculatorApp::Common::ViewMode currentMode); internal : HistoryViewModel(_In_ CalculationManager::CalculatorManager* calculatorManager); void SetCalculatorDisplay(CalculatorDisplay& calculatorDisplay); - void ReloadHistory(_In_ CalculatorApp::Common::ViewMode currentMode); unsigned long long GetMaxItemSize(); diff --git a/src/Calculator/App.xaml.cs b/src/Calculator/App.xaml.cs index b682beac..942a1ee2 100644 --- a/src/Calculator/App.xaml.cs +++ b/src/Calculator/App.xaml.cs @@ -457,7 +457,7 @@ namespace CalculatorApp try { m_secondaryWindows[frameService.GetViewId()] = frameService; - TraceLogger.GetInstance().UpdateWindowCount(m_secondaryWindows.size()); + TraceLogger.GetInstance().UpdateWindowCount(Convert.ToUInt64(m_secondaryWindows.Count)); } finally { diff --git a/src/Calculator/Calculator.csproj b/src/Calculator/Calculator.csproj index 6e80c349..40a0b03b 100644 --- a/src/Calculator/Calculator.csproj +++ b/src/Calculator/Calculator.csproj @@ -120,9 +120,6 @@ 0.0.0.0 - - - AboutFlyout.xaml @@ -462,6 +459,7 @@ + diff --git a/src/Calculator/Calculator.rc b/src/Calculator/Calculator.rc new file mode 100644 index 00000000..48f7d2a1 --- /dev/null +++ b/src/Calculator/Calculator.rc @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// CSHARP_MIGRATION: TODO: +#define APP_FILE_NAME "Calculator" +#define APP_FILE_IS_EXE +#define APP_PRODUCT_NAME "Microsoft Calculator" +#define APP_COMPANY_NAME "Microsoft Corporation" +#define APP_COPYRIGHT "\251 Microsoft Corporation. All rights reserved." + +#include "../build/appversion.rc" diff --git a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.cs b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.cs index 9c5a4aa2..27fe4406 100644 --- a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.cs +++ b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml.cs @@ -348,7 +348,8 @@ namespace CalculatorApp if (ex.HResult == unchecked(rpc_e_servercall_retrylater)) { ShowShareError(); - TraceLogger.GetInstance().LogPlatformException(ViewMode.Graphing, System.Reflection.MethodBase.GetCurrentMethod().Name, ex); + // CSHARP_MIGRATION: TODO: + //TraceLogger.GetInstance().LogPlatformException(ViewMode.Graphing, System.Reflection.MethodBase.GetCurrentMethod().Name, ex); } else { @@ -495,8 +496,9 @@ namespace CalculatorApp { ShowShareError(); - TraceLogger.GetInstance().LogPlatformException(ViewMode.Graphing, - System.Reflection.MethodBase.GetCurrentMethod().Name, ex); + // CSHARP_MIGRATION: TODO: + //TraceLogger.GetInstance().LogPlatformException(ViewMode.Graphing, + // System.Reflection.MethodBase.GetCurrentMethod().Name, ex); } } diff --git a/src/Calculator/WinMeta.cs b/src/Calculator/WinMeta.cs new file mode 100644 index 00000000..152b969e --- /dev/null +++ b/src/Calculator/WinMeta.cs @@ -0,0 +1,152 @@ +// CSHARP_MIGRATION: TODO: +// this is a temporary solution to use the constants defined in winmeta.h file + +namespace CalculatorApp +{ + static class WinMeta + { + public const int WINEVENT_CHANNEL_CLASSIC_TRACE = 0x0; + public const int WINEVENT_CHANNEL_GLOBAL_SYSTEM = 0x8; + public const int WINEVENT_CHANNEL_GLOBAL_APPLICATION = 0x9; + public const int WINEVENT_CHANNEL_GLOBAL_SECURITY = 0xa; + public const int WINEVENT_CHANNEL_TRACELOGGING = 0xb; + public const int WINEVENT_CHANNEL_PROVIDERMETADATA = 0xc; + public const int WINEVENT_LEVEL_LOG_ALWAYS = 0x0; + public const int WINEVENT_LEVEL_CRITICAL = 0x1; + public const int WINEVENT_LEVEL_ERROR = 0x2; + public const int WINEVENT_LEVEL_WARNING = 0x3; + public const int WINEVENT_LEVEL_INFO = 0x4; + public const int WINEVENT_LEVEL_VERBOSE = 0x5; + public const int WINEVENT_LEVEL_RESERVED_6 = 0x6; + public const int WINEVENT_LEVEL_RESERVED_7 = 0x7; + public const int WINEVENT_LEVEL_RESERVED_8 = 0x8; + public const int WINEVENT_LEVEL_RESERVED_9 = 0x9; + public const int WINEVENT_LEVEL_RESERVED_10 = 0xa; + public const int WINEVENT_LEVEL_RESERVED_11 = 0xb; + public const int WINEVENT_LEVEL_RESERVED_12 = 0xc; + public const int WINEVENT_LEVEL_RESERVED_13 = 0xd; + public const int WINEVENT_LEVEL_RESERVED_14 = 0xe; + public const int WINEVENT_LEVEL_RESERVED_15 = 0xf; + public const int WINEVENT_OPCODE_INFO = 0x0; + public const int WINEVENT_OPCODE_START = 0x1; + public const int WINEVENT_OPCODE_STOP = 0x2; + public const int WINEVENT_OPCODE_DC_START = 0x3; + public const int WINEVENT_OPCODE_DC_STOP = 0x4; + public const int WINEVENT_OPCODE_EXTENSION = 0x5; + public const int WINEVENT_OPCODE_REPLY = 0x6; + public const int WINEVENT_OPCODE_RESUME = 0x7; + public const int WINEVENT_OPCODE_SUSPEND = 0x8; + public const int WINEVENT_OPCODE_SEND = 0x9; + public const int WINEVENT_OPCODE_RECEIVE = 0xf0; + public const int WINEVENT_OPCODE_RESERVED_241 = 0xf1; + public const int WINEVENT_OPCODE_RESERVED_242 = 0xf2; + public const int WINEVENT_OPCODE_RESERVED_243 = 0xf3; + public const int WINEVENT_OPCODE_RESERVED_244 = 0xf4; + public const int WINEVENT_OPCODE_RESERVED_245 = 0xf5; + public const int WINEVENT_OPCODE_RESERVED_246 = 0xf6; + public const int WINEVENT_OPCODE_RESERVED_247 = 0xf7; + public const int WINEVENT_OPCODE_RESERVED_248 = 0xf8; + public const int WINEVENT_OPCODE_RESERVED_249 = 0xf9; + public const int WINEVENT_OPCODE_RESERVED_250 = 0xfa; + public const int WINEVENT_OPCODE_RESERVED_251 = 0xfb; + public const int WINEVENT_OPCODE_RESERVED_252 = 0xfc; + public const int WINEVENT_OPCODE_RESERVED_253 = 0xfd; + public const int WINEVENT_OPCODE_RESERVED_254 = 0xfe; + public const int WINEVENT_OPCODE_RESERVED_255 = 0xff; + public const int WINEVENT_TASK_NONE = 0x0; + public const int WINEVT_KEYWORD_ANY = 0x0; + public const long WINEVENT_KEYWORD_RESPONSE_TIME = 0x1000000000000; + public const long WINEVENT_KEYWORD_RESERVED_49 = 0x2000000000000; + public const long WINEVENT_KEYWORD_WDI_DIAG = 0x4000000000000; + public const long WINEVENT_KEYWORD_SQM = 0x8000000000000; + public const long WINEVENT_KEYWORD_AUDIT_FAILURE = 0x10000000000000; + public const long WINEVENT_KEYWORD_AUDIT_SUCCESS = 0x20000000000000; + public const long WINEVENT_KEYWORD_CORRELATION_HINT = 0x40000000000000; + public const long WINEVENT_KEYWORD_EVENTLOG_CLASSIC = 0x80000000000000; + public const long WINEVENT_KEYWORD_RESERVED_56 = 0x100000000000000; + public const long WINEVENT_KEYWORD_RESERVED_57 = 0x200000000000000; + public const long WINEVENT_KEYWORD_RESERVED_58 = 0x400000000000000; + public const long WINEVENT_KEYWORD_RESERVED_59 = 0x800000000000000; + public const long WINEVENT_KEYWORD_RESERVED_60 = 0x1000000000000000; + public const long WINEVENT_KEYWORD_RESERVED_61 = 0x2000000000000000; + public const long WINEVENT_KEYWORD_RESERVED_62 = 0x4000000000000000; + public const ulong WINEVENT_KEYWORD_RESERVED_63 = 0x8000000000000000; + public const long MSG_category_Devices = 0x00000001L; + + public const long MSG_category_Disk = 0x00000002L; + + public const long MSG_category_Network = 0x00000007L; + + public const long MSG_category_Printers = 0x00000003L; + + public const long MSG_category_Services = 0x00000004L; + + public const long MSG_category_Shell = 0x00000005L; + + public const long MSG_category_SystemEvent = 0x00000006L; + + public const long MSG_channel_Application = 0x00000100L; + + public const long MSG_channel_ProviderMetadata = 0x90000003L; + + public const long MSG_channel_Security = 0x00000101L; + + public const long MSG_channel_System = 0x00000102L; + + public const long MSG_channel_TraceClassic = 0x90000001L; + + public const long MSG_channel_TraceLogging = 0x90000002L; + + public const long MSG_keyword_AnyKeyword = 0x10000000L; + + public const long MSG_keyword_AuditFailure = 0x10000035L; + + public const long MSG_keyword_AuditSuccess = 0x10000036L; + + public const long MSG_keyword_Classic = 0x10000038L; + + public const long MSG_keyword_CorrelationHint = 0x10000037L; + + public const long MSG_keyword_ResponseTime = 0x10000031L; + + public const long MSG_keyword_SQM = 0x10000034L; + + public const long MSG_keyword_WDIDiag = 0x10000033L; + + public const long MSG_level_Critical = 0x50000001L; + + public const long MSG_level_Error = 0x50000002L; + + public const long MSG_level_Informational = 0x50000004L; + + public const long MSG_level_LogAlways = 0x50000000L; + + public const long MSG_level_Verbose = 0x50000005L; + + public const long MSG_level_Warning = 0x50000003L; + + public const long MSG_opcode_DCStart = 0x30030000L; + + public const long MSG_opcode_DCStop = 0x30040000L; + + public const long MSG_opcode_Extension = 0x30050000L; + + public const long MSG_opcode_Info = 0x30000000L; + + public const long MSG_opcode_Receive = 0x30F00000L; + + public const long MSG_opcode_Reply = 0x30060000L; + + public const long MSG_opcode_Resume = 0x30070000L; + + public const long MSG_opcode_Send = 0x30090000L; + + public const long MSG_opcode_Start = 0x30010000L; + + public const long MSG_opcode_Stop = 0x30020000L; + + public const long MSG_opcode_Suspend = 0x30080000L; + + public const long MSG_task_None = 0x70000000L; + } +}