Beispiel #1
0
 public DirectLogger(LogLevel minLogLevel, LogMessageRouter messageRouter, IFallbackLogger fallbackLogger,
                     MessageLayout layout)
     : this(minLogLevel, messageRouter)
 {
     _fallbackLogger = fallbackLogger;
     _layout         = layout;
 }
 private void ChoseMessage(MessageLayout chosenMessage)
 {
     if (ChosenMessage != null)
     {
         ChosenMessage.MessageBorder.Background = Brushes.White;
     }
     ChosenMessage = chosenMessage;
     ChosenMessage.MessageBorder.Background = Brushes.Salmon;
 }
        private void DeleteMessageLine_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var menuItem    = sender as MenuItem;;
            var contextMenu = menuItem.Parent as ContextMenu;

            MessagesPanel.Children.Remove(ChosenMessage);
            CurrentWorkSpace.Session.DeleteMessage(ChosenMessage.message.Id);
            listOfCachedMessages.Remove(ChosenMessage.message);
            ChosenMessage = null;
        }
 private void ParseListenerOptions(StringDictionary attributes)
 {
     SystemType           = attributes["systemType"];
     SkipPercentage       = attributes["skipPercentage"];
     FallbackLogDirectory = attributes["fallbackLogDirectory"];
     if (int.TryParse(attributes["daysToKeepFallbackLogs"], out var days))
     {
         DaysToKeepFallbackLogs = days;
     }
     Layout = attributes["layout"];
     if (!string.IsNullOrWhiteSpace(Layout))
     {
         _layout = new MessageLayout(Layout);
     }
 }
Beispiel #5
0
 public override void Arrange()
 {
     Sut = new MessageLayout(TestPattern);
 }
Beispiel #6
0
    /// <summary>
    /// Show the message box. The appearance and behaviour of the message box is defined by setting
    /// a series of parameters. All parameters are optional except the 'message' string. The optional parameters
    ///  can also be set in any order using named arguments. For example: EasyMessageBox.Show("Level complete!", layout: ContentLayouts.Vertical, messageBoxTitle:"Congratulations!");
    /// </summary>
    /// <param name="message">The message text to show in the message box. The UI element itself will hide if set to null or an empty string.</param>
    /// <param name="messageIcon">The icon for the message. The UI element itself will hide if set to null. It will be to the left of the message in horizontal layout and above the message in vertical layout.</param>
    /// <param name="messageTitle">An additiontial title for the main message itself (not the title of the message box). It will be above the message text in horizontal layout and above the message icon in vertical layout. The UI element itself will hide if set to null or an empty string.</param>
    /// <param name="messageBoxTitle">The title for the message box. The title bar will hide if set to null or an empty string.</param>
    /// <param name="showCloseButtonInTitleBar">Indicates whether the title bar will show a close button if the title bar is displayed.</param>
    /// <param name="button1Icon">The icon for button 1. To hide this button, set both its icon and text to null(or an empty string).</param>
    /// <param name="button1Text">The text for button 1. To hide this button, set both its icon and text to null(or an empty string).</param>
    /// <param name="button1Action">The action to take when button 1 is pressed.</param>
    /// <param name="button2Icon">The icon for button 2. To hide this button, set both its icon and text to null(or an empty string).</param>
    /// <param name="button2Text">The text for button 2. To hide this button, set both its icon and text to null(or an empty string).</param>
    /// <param name="button2Action">The action to take when button 2 is pressed.</param>
    /// <param name="button3Icon">The icon for button 3. To hide this button, set both its icon and text to null(or an empty string).</param>
    /// <param name="button3Text">The text for button 3. To hide this button, set both its icon and text to null(or an empty string).</param>
    /// <param name="button3Action">The action to take when button 3 is pressed.</param>
    /// <param name="toggleText">The text for the toggle. Will hide the toggle if set to null or an empty string.</param>
    /// <param name="toggleAction">The action to take when the toggle's state is changed. Setting this to null will hide the toggle.</param>
    /// <param name="defaultToggleState">Decides whether the toggle is on when first displayed.</param>
    /// <param name="inputField1Label">The label text for the optional input field 1. Will hide the input field if set to null or an empty string.</param>
    /// <param name="inputField1Text">Optional text to show in input field 1 when it's first displayed</param>
    /// <param name="inputField2Label">The label text for the optional input field 2. Will hide the input field if set to null or an empty string.</param>
    /// <param name="inputField2Text">Optional text to show in input field 2 when it's first displayed</param>
    /// <param name="inputFieldAction">The action to take if any of the input field is displayed. The action requires two strings for each input field.</param>
    /// <param name="inputFieldActionsFireOnButton">Controls which button will fire the input field action. The default is button 1.</param>
    /// <param name="inAnimation">The animation type to use for animating in.</param>
    /// <param name="inAnimationStartSound">The audio clip to play when the message box begins to animate in.</param>
    /// <param name="inAnimationEndSound">The audio clip to play when the message box finishes its in-animation. This is useful when you want to emphasize when the message box is fully present, e.g. when telling the player that an achievement has be achieved.</param>
    /// <param name="outAnimation">The animation type to use for animating out.</param>
    /// <param name="outAnimationStartSound">The audio clip to play when the message box begins to animate out.</param>
    /// <param name="layout">Controls which layout to use for the message box.</param>
    /// <param name="multipleCallBehaviour">Controls the behaviour when a new call is made to show a message box while there is already a message box displaying on the screen. When set to Queue, the new calls is automatically queued and will show based on a first-in, first-out rule when an existing message box is closed. When set to ShowNewInstance, a new message box instance will show immediately.</param>
    /// <param name="dragType">Controls how the message box can be dragged.</param>
    /// <param name="templateId">Controls which template to use when displaying a message box. This is the index of the Templates list and can be found in the inspector of EasyMessageBox component.</param>
    public static void Show(string message,
                            Sprite messageIcon             = null,
                            string messageTitle            = null,
                            string messageBoxTitle         = null,
                            bool showCloseButtonInTitleBar = false,
                            Sprite button1Icon             = null,
                            string button1Text             = "OK",
                            UnityAction button1Action      = null,
                            Sprite button2Icon             = null,
                            string button2Text             = null,
                            UnityAction button2Action      = null,
                            Sprite button3Icon             = null,
                            string button3Text             = null,
                            string toggleText               = null,
                            UnityAction button3Action       = null,
                            UnityAction <bool> toggleAction = null,
                            bool defaultToggleState         = false,
                            string inputField1Label         = null,
                            string inputField1Text          = null,
                            string inputField2Label         = null,
                            string inputField2Text          = null,
                            UnityAction <string, string> inputFieldAction = null,
                            Buttons inputFieldActionsFireOnButton         = Buttons.Button1,
                            InAnimationTypes inAnimation                 = InAnimationTypes.Popup,
                            AudioClip inAnimationStartSound              = null,
                            AudioClip inAnimationEndSound                = null,
                            OutAnimationTypes outAnimation               = OutAnimationTypes.None,
                            AudioClip outAnimationStartSound             = null,
                            MessageLayout layout                         = MessageLayout.Horizontal,
                            MultipleCallBehaviours multipleCallBehaviour = MultipleCallBehaviours.ShowNewInstance,
                            DragTypes dragType = DragTypes.TitleOnly,
                            int templateId     = 0
                            )
    {
        var param = new MessageBoxParams()
        {
            Message                       = message,
            MessageIcon                   = messageIcon,
            MessageTitle                  = messageTitle,
            MessageBoxTitle               = messageBoxTitle,
            ShowTitleBarCloseButton       = showCloseButtonInTitleBar,
            Button1Icon                   = button1Icon,
            Button1Text                   = button1Text,
            Button1Action                 = button1Action,
            Button2Icon                   = button2Icon,
            Button2Text                   = button2Text,
            Button2Action                 = button2Action,
            Button3Icon                   = button3Icon,
            Button3Text                   = button3Text,
            Button3Action                 = button3Action,
            ToggleText                    = toggleText,
            ToggleValueChangedAction      = toggleAction,
            InputField1Label              = inputField1Label,
            InputField1Text               = inputField1Text,
            InputField2Label              = inputField2Label,
            InputField2Text               = inputField2Text,
            InputFieldAction              = inputFieldAction,
            InputFieldActionsFireOnButton = inputFieldActionsFireOnButton,
            DefaultToggleState            = defaultToggleState,
            InAnimation                   = inAnimation,
            InAnimationStartSound         = inAnimationStartSound,
            InAnimationEndSound           = inAnimationEndSound,
            OutAnimation                  = outAnimation,
            OutAnimationStartSound        = outAnimationStartSound,
            MessageLayout                 = layout,
            MultipleCallBehaviour         = multipleCallBehaviour,
            DragType                      = dragType,
            TemplateId                    = templateId,
        };

        Show(param);
    }
 public override void Act()
 {
     Sut = new MessageLayout("{threadId}");
     base.Act();
 }