Beispiel #1
0
        //--------------------------------------------------------Attributes:-----------------------------------------------------------------\\
        #region --Attributes--


        #endregion
        //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
        #region --Constructors--


        #endregion
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is MucState state)
            {
                switch (state)
                {
                case MucState.ENTERING:
                case MucState.DISCONNECTING:
                    return(UiUtils.GetPresenceBrush(Presence.Chat));

                case MucState.ENTERD:
                    return(UiUtils.GetPresenceBrush(Presence.Online));

                case MucState.ERROR:
                case MucState.KICKED:
                case MucState.BANED:
                    return(UiUtils.GetPresenceBrush(Presence.Xa));

                case MucState.DISCONNECTED:
                default:
                    return(UiUtils.GetPresenceBrush(Presence.Unavailable));
                }
            }
            return(UiUtils.GetPresenceBrush(Presence.Unavailable));
        }
        //--------------------------------------------------------Attributes:-----------------------------------------------------------------\\
        #region --Attributes--


        #endregion
        //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
        #region --Constructors--


        #endregion
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is Presence p)
            {
                return(UiUtils.GetPresenceBrush(p));
            }
            return(UiUtils.GetPresenceBrush(Presence.Unavailable));
        }
        //--------------------------------------------------------Attributes:-----------------------------------------------------------------\\
        #region --Attributes--


        #endregion
        //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
        #region --Constructors--


        #endregion
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is MUCState state)
            {
                switch (state)
                {
                case MUCState.ENTERING:
                case MUCState.DISCONNECTING:
                case MUCState.ERROR:
                case MUCState.KICKED:
                case MUCState.BANED:
                    return(new SolidColorBrush(Colors.Black));

                case MUCState.DISCONNECTED:
                default:
                    return(new SolidColorBrush(Colors.White));
                }
            }
            return(UiUtils.GetPresenceBrush(Presence.Unavailable));
        }