/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.cs
57 строк
2 KB
Steve Lee
Update copyright notice to latest guidance (#12190)
24 мар 2020, 21:08
Не верифицирован
24 мар 2020, 21:08
b7cb335
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using System.Windows; using System.Windows.Controls; namespace Microsoft.Management.UI.Internal { /// <content> /// Partial class implementation for MessageTextBox control. /// </content> [SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")] public partial class MessageTextBox : TextBox { static partial void StaticConstructorImplementation() { TextProperty.OverrideMetadata( typeof(MessageTextBox), new FrameworkPropertyMetadata( string.Empty, null, new CoerceValueCallback(OnTextBoxTextCoerce))); } #region Non-Public Methods private void UpdateIsBackgroundTextShown(string text) { if (string.IsNullOrEmpty(text) == false && this.IsBackgroundTextShown) { this.IsBackgroundTextShown = false; } else if (string.IsNullOrEmpty(text) && this.IsBackgroundTextShown == false) { this.IsBackgroundTextShown = true; } } private static object OnTextBoxTextCoerce(DependencyObject o, object baseValue) { MessageTextBox mtb = (MessageTextBox)o; mtb.UpdateIsBackgroundTextShown((string)baseValue); if (baseValue == null) { return string.Empty; } return baseValue; } #endregion Non-Public Methods } }