/******************************/ /* Other Functions */ /******************************/ #region Other Functions /// <summary> /// SetMessageBoxAColor /// </summary> /// <param name="messageBoxColor"></param> private void SetMessageBoxAColor(MessageBoxAColor messageBoxColor) { switch (messageBoxColor) { case MessageBoxAColor.RED: Color1 = StringToColor("#FFFF3F3F"); Color2 = StringToColor("#FFFF8A8A"); break; case MessageBoxAColor.BLUE: Color1 = StringToColor("#FF3F50FF"); Color2 = StringToColor("#FF8A8AFF"); break; case MessageBoxAColor.YELLOW: Color1 = StringToColor("#FFEEFF3F"); Color2 = StringToColor("#FFFAFF8A"); break; case MessageBoxAColor.GREEN: Color1 = StringToColor("#FF007E1D"); Color2 = StringToColor("#FFAAFF8A"); break; case MessageBoxAColor.GRAY: Color1 = StringToColor("#FF9C9A9A"); Color2 = StringToColor("#FFCFCFCF"); break; } Backgrount1 = new SolidColorBrush(Color1); Backgrount2 = new SolidColorBrush(Color2); }
/******************************/ /* Public Functions */ /******************************/ #region Public Functions /// <summary> /// ShowMessageBoaA /// </summary> public void ShowMyMessageBox(string message, uint characteristics, MessageBoxAColor messageBoxAColor = MessageBoxAColor.RED) { SetMessageBoxAColor(messageBoxAColor); Message = message; Transparents = 1; if ((CENTER_WINDOW & characteristics) != NOTHING) { CenterWindow(this, _desktopWorkingAreaRight, _desktopWorkingAreaBottom); } if ((ACTIVATE & characteristics) != NOTHING) { Activate(); } if ((TOPMOST & characteristics) != NOTHING) { Topmost = true; } else { Topmost = false; } if ((CLOSABLE & characteristics) != NOTHING) { _closable = true; } else { _closable = false; } if ((MOVABLE & characteristics) != NOTHING) { _movable = true; } else { _movable = false; } if ((HIDEABLE & characteristics) != NOTHING) { _hideable = true; } else { _hideable = false; } if ((MODAL & characteristics) != NOTHING) { if (IsVisible) { Hide(); } ShowDialog(); } else { Show(); } }