示例#1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="endPointIP">Sender IPAddress</param>
        /// <param name="endPointPort">Sender Port</param>
        /// <param name="messageType">Message Type:
        /// ISO8583.
        /// XML.
        /// EXCEL.</param>
        public DotNetPosMain(string endPointIP, int endPointPort, MessageType messageType)
        {
            _msgType = messageType;

            destinationEndPoint =
               new System.Net.IPEndPoint(System.Net.IPAddress.Parse(endPointIP), endPointPort);
        }
 ///////////////////////////////////////////
 public CustomMessagesClientNetworkService()
     : base("CustomMessages", 2)
 {
     //register message types
     transferMessageType = RegisterMessageType( "transferMessage", 1,
         ReceiveMessage_TransferMessageToClient );
 }
示例#3
0
 public ChatMessage(MessageType type, CommandType command, string channel, string message)
 {
     this.message = message;
     this.type = (int)type;
     this.channel = channel;
     this.command = (int)command;
 }
示例#4
0
        protected virtual IEnumerable<Message> CreateResponseMessages(MessageType messageType, string fieldName = "", params string[] messages)
        {
            var messageList = new List<Message>();
            messages.ForEach(m => messageList.Add(new Message(m, fieldName, messageType)));

            return messageList;
        }
示例#5
0
 public static ResponseType show(Window parent_window, DialogFlags dialogFlags, MessageType messageType, ButtonsType buttonsType,string  message)
 {
     _dlg = new MessageDialog (parent_window, dialogFlags,messageType, buttonsType, message);
     ResponseType response = (ResponseType) _dlg.Run ();
     _dlg.Destroy ();
     return response;
 }
 public MessageEventArgs(MessageType messtype, ServerType servertype, String arguments, String message)
 {
     messagetype = messtype;
     type = servertype;
     args = arguments;
     Message = message;
 }
示例#7
0
 public void Add( string text, MessageType type )
 {
     if( type == MessageType.Normal ) {
         Log.Add( text );
         LogChatToFile( text );
     } else if( type == MessageType.Status1 ) {
         Status1 = text;
     } else if( type == MessageType.Status2 ) {
         Status2 = text;
     } else if( type == MessageType.Status3 ) {
         Status3 = text;
     } else if( type == MessageType.BottomRight1 ) {
         BottomRight1 = text;
     } else if( type == MessageType.BottomRight2 ) {
         BottomRight2 = text;
     } else if( type == MessageType.BottomRight3 ) {
         BottomRight3 = text;
     } else if( type == MessageType.Announcement ) {
         Announcement = text;
     } else if( type >= MessageType.ClientStatus1 && type <= MessageType.ClientStatus6 ) {
         ClientStatus[(int)(type - MessageType.ClientStatus1)] = text;
     } else if( type == MessageType.ClientClock ) {
         ClientClock = text;
     }
     game.Events.RaiseChatReceived( text, type );
 }
示例#8
0
        public void Write(MessageType type, object msg)
        {
            switch (type)
            {
                case MessageType.Debug:
                    logger.Debug(msg);
                    break;
                case MessageType.Error:
                    logger.Error(msg);
                    break;
                case MessageType.Fatal:
                    logger.Fatal(msg);
                    break;
                case MessageType.Info:
                    logger.Info(msg);
                    break;
                case MessageType.Warning:
                    logger.Warn(msg);
                    break;
                default:
                    logger.Info(msg);
                    break;

            }
        }
        public override UIImage IconImageForMessageType(MessageType type) {
            if (this.config.Icon != null)
                return this.config.Icon.ToNative();

            var msgType = (MessageType)Enum.Parse(typeof(MessageType), config.Event.ToString());
            return base.IconImageForMessageType(msgType);
        }
 public ChatMessageValues(MessageType type, string message, bool hasLanguage = false, bool hasRealmId = false)
 {
     ChatType = type;
     Message = message;
     HasLanguage = hasLanguage;
     HasRealmId = hasRealmId;
 }
示例#11
0
        public void Init()
        {
            using (var transaction = new TransactionScope(TransactionScopeOption.Suppress))
            using (var session = subscriptionStorageSessionProvider.OpenStatelessSession())
            using (var tx = session.BeginTransaction(System.Data.IsolationLevel.ReadCommitted))
            {
                var v2XSubscriptions = session.QueryOver<Subscription>()
                    .Where(s => s.TypeName == null)
                    .List();
                if (v2XSubscriptions.Count == 0)
                    return;

                Logger.DebugFormat("Found {0} v2X subscriptions going to upgrade", v2XSubscriptions.Count);

                foreach (var v2XSubscription in v2XSubscriptions)
                {
                    var mt = new MessageType(v2XSubscription.MessageType);
                    v2XSubscription.Version = mt.Version.ToString();
                    v2XSubscription.TypeName = mt.TypeName;

                    session.Update(v2XSubscription);
                }

                tx.Commit();
                transaction.Complete();

                Logger.InfoFormat("{0} v2X subscriptions upgraded", v2XSubscriptions.Count);
            }
        }
示例#12
0
 public static void ShowMessageBox(MessageType mtype, 
     string title,
     string message,
     params string[] args)
 {
     ShowMessageBox(null, mtype, title, message, args);
 }
 public UnexpectedMessageException(
     MessageType messageType,
     MessageType expectedMessageType)
 {
     MessageType = messageType;
     ExpectedMessageType = expectedMessageType;
 }
示例#14
0
 private ResultDTO(MessageType messageType)
 {
     this.messageType = messageType;
     levelCount = Application.levelCount;
     loadedLevel = Application.loadedLevel;
     loadedLevelName = Application.loadedLevelName;
 }
示例#15
0
        // Message box
        public static ResponseType ShowMessageBox(Window parent,
            MessageType mtype,
            ButtonsType buttons,
            string title,
            string message,
            params string[] args)
        {
            MessageDialog msgDlg =
                new MessageDialog(parent,
                                  DialogFlags.Modal,
                                  mtype,
                                  buttons,
                                  message,
                                  args);
            msgDlg.Title = title;
            msgDlg.UseMarkup = false;

            ResponseType response = ResponseType.None;
            msgDlg.Response += (object o, ResponseArgs args2) =>
            {
                msgDlg.Destroy();
                response = args2.ResponseId;
            };
            msgDlg.Run();
            return response;
        }
示例#16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Message"/> class.
 /// Message constructor with initializers
 /// </summary>
 /// <param name="messageType">Message type</param>
 /// <param name="ruleName">Name of business rule</param>
 /// <param name="text">Message text</param>
 public Message(MessageType messageType, string ruleName, string text)
     : this()
 {
     this.MessageType = messageType;
     this.ruleNameField = ruleName;
     this.Text = text ?? string.Empty;
 }
	/// <summary>
	/// 
	/// </summary>
	public override void OnInspectorGUI()
	{

		if (m_PathFoldout || m_MovementFoldout || m_PhysicsFoldout || m_RotationFoldout || m_SoundFoldout)
		{

			if (m_Component.PathWaypoints != null)
				m_WaypointCount = m_Component.PathWaypoints.transform.childCount;
			else
				m_WaypointCount = 0;

			if (m_WaypointCount < 2)
			{
				PathMessageType = MessageType.Warning;
				PathInfo = NoWaypointsMessage;
			}

		}

		GUI.color = Color.white;
		
		DoPathFoldout();
		DoMovementFoldout();
		DoRotationFoldout();
		DoPhysicsFoldout();
		DoSoundFoldout();

		// update
		if (GUI.changed)
			EditorUtility.SetDirty(target);
		
	}
示例#18
0
 public usrc_Error_Response(MessageType xm_messageType, string ErrorMessage)
 {
     InitializeComponent();
     //m_messageType = xm_messageType;
     lbl_MessageType.Text = messageType_SetString(xm_messageType);
     txt_ErrorMessage.Text = ErrorMessage;
 }
示例#19
0
 public void ShowStatusMessage(string shortMessage, string msgDetails, MessageType Mode)
 {
     //StatusInformation1.Message = shortMessage;
     //StatusInformation1.MessageDetails = msgDetails;
     //StatusInformation1.Mode = Mode;
     //StatusInformation1.ShowMessge();
 }
示例#20
0
 public void ShowMessage(string message, MessageType status)
 {
     MessageTextBlock.Text = message;
     RootBorder.Background = (status == MessageType.Successful) ? _successfulColor : _failedColor;
     RootBorder.BringIntoView();
     AnimatePopup();
 }
示例#21
0
文件: User.cs 项目: mahdiz/torbricks
        //public override void Receive<BrideAssignment>(int fromNode, BrideAssignment message, MessageType type)
        //{
        //    throw new NotImplementedException();
        //}
        public override void ReceiveEmail(long fromPseudonym, object message, MessageType type)
        {
            if (type == MessageType.UserAssignments)   // From a distributor: Here's a list of bridge id share for you.
            {
                var assignments = message as List<UserAssignment>;
                if (distributorPseudonyms.Count == 1)
                {
                    foreach (var a in assignments)
                        Bridges.Add(Simulator.GetNode<Bridge>((int)a.BridgeShare.Value));
                }
                else
                {
                    foreach (var a in assignments)
                    {
                        if (!BridgeShares.ContainsKey(a.BridgePseudonym))
                            BridgeShares[a.BridgePseudonym] = new List<Zp>();

                        BridgeShares[a.BridgePseudonym].Add(a.BridgeShare);

                        if (BridgeShares[a.BridgePseudonym].Count == distributorPseudonyms.Count)
                        {
                            // We have enough number of shares to reconstruct the bridge ID
                            int bridgeId = (int)ShamirSharing.Reconstruct(BridgeShares[a.BridgePseudonym],
                                Simulator.PolynomialDegree, Simulator.Prime).Value;

                            Debug.Assert(Simulator.GetNodes<Bridge>().Any(b => b.Id == bridgeId), "Invalid bridge ID reconstructed from shares.");
                            Bridges.Add(Simulator.GetNode<Bridge>(bridgeId));
                            BridgeShares[a.BridgePseudonym] = null;
                        }
                    }
                }
            }
            else throw new Exception("Invalid message received.");
        }
示例#22
0
 public LogEventArgs(string message, MessageType messageType, StackTrace st)
 {
     this.message = message;
     this.dateTime = DateTime.Now;
     this.messageType = messageType;
     this.stackTrace = st;
 }
示例#23
0
        public byte[] ReceiveMessage(out MessageType type)
        {
            if (_disposed)
                throw new ObjectDisposedException(GetType().FullName);

            // Read the fixed length string that tells the message size and type
            byte[] byteBuffer = new byte[11];
            int bytesRead = _networkStream.Read(byteBuffer, 0, 11);
            if (bytesRead != 11)
                throw new ConnectionException(bytesRead.ToString());

            string header = Encoding.ASCII.GetString(byteBuffer);
            int bytesComing = Convert.ToInt32(header.Substring(1));
            type = (MessageType)Convert.ToInt32(header.Substring(0, 1));
            byteBuffer = new byte[bytesComing];

            // Read the message
            int offset = 0;
            do
            {
                bytesRead = _networkStream.Read(byteBuffer, offset, bytesComing - offset);
                if (bytesRead != 0)
                    offset += bytesRead;
                else
                    throw new ConnectionException(header);
            } while (offset != bytesComing);

            return byteBuffer;
        }
示例#24
0
 public SessionMessage(MessageType messageType, MessageBehaviors behavior, string message, string key,string caption, MessageButton? messageButtons, MessageIcon? messageIcon)
 {
     if (behavior == MessageBehaviors.Modal && (!messageButtons.HasValue || !messageIcon.HasValue))
     {
         messageButtons = messageButtons ?? MessageButton.Ok;
         if(!messageIcon.HasValue)
         {
             switch(messageType)
             {
                 case MessageType.Error:
                     messageIcon = MessageIcon.Error;
                     break;
                 case MessageType.Info:
                     messageIcon = MessageIcon.Information;
                     break;
                 case MessageType.Success:
                     messageIcon = MessageIcon.Success;
                     break;
                 case MessageType.Warning:
                     messageIcon = MessageIcon.Warning;
                     break;
                 default:
                     messageIcon = MessageIcon.Information;
                     break;
             }
         }
     }
     Key = key;
     Message = message;
     Caption = caption;
     Type = messageType;
     Behavior = behavior;
     Buttons = messageButtons;
     Icon = messageIcon;
 }
示例#25
0
 public Message(MessageType type, uint id, string route, JsonObject data)
 {
     this.type = type;
     this.id = id;
     this.route = route;
     this.data = data;
 }
示例#26
0
		public override void Reset()
		{
			gameObject = null;
			delivery = MessageType.SendMessage;
			options = SendMessageOptions.DontRequireReceiver;
			functionCall = null;
		}
示例#27
0
        protected override Message Deserialize(BinaryReader reader, MessageType messageType)
        {
            int type = reader.ReadInt32();
            if (type == 2) {
                MessageStream stream = new MessageStream(messageType);
                int sz = reader.ReadInt32();
                for (int i = 0; i < sz; i++) {
                    stream.AddMessage(Deserialize(reader, messageType));
                }

                return stream as Message;
            }

            if (type == 1) {
                Message message;
                string messageName = reader.ReadString();
                if (messageType == MessageType.Request) {
                    message = new RequestMessage(messageName);
                } else {
                    message = new ResponseMessage(messageName);
                }

                int sz = reader.ReadInt32();
                for (int i = 0; i < sz; i++)
                    message.Arguments.Add(ReadArgument(reader));

                int v = reader.ReadInt32();
                if (v != 8)
                    throw new FormatException();

                return message;
            }

            throw new FormatException("Unable to determine the format of the message.");
        }
示例#28
0
 public override void Append(MessageType messageType, string message)
 {
     using (var sw = new StreamWriter(this.FilePath, true))
     {
         sw.WriteLine($"{messageType}: {message}");
     }
 }
 /// <summary>
 /// Produces Message.
 /// </summary>
 /// <param name="message">Message type.</param>
 /// <param name="parameter">Integer number.</param>
 /// <param name="secondParameter">Second Number.</param>
 /// <returns>Returns new message.</returns>
 public string MakeMessage(MessageType message, int parameter = 0, int secondParameter = 0)
 {
     switch (message)
     {
         case MessageType.Welcome:
             return new SimpleMessage(WelcomeText).Show();
         case MessageType.GameRules:
             return new SimpleMessage(GameRulesText).Show();
         case MessageType.Command:
             return new SimpleMessage(CommandText).Show();
         case MessageType.WrongNumber:
             return new TwoParameterMessage(new SimpleMessage(WrongNumberText), parameter, secondParameter).Show();
         case MessageType.Congratulation:
             return new OneParameterMessage(new SimpleMessage(CongratulationText), parameter).Show();
         case MessageType.CheatCongratulation:
             return new TwoParameterMessage(new SimpleMessage(CheatCongratulationText), parameter, secondParameter).Show();
         case MessageType.EnterName:
             return new SimpleMessage(EnterNameText).Show();
         case MessageType.Exit:
             return new SimpleMessage(ExitText).Show();
         case MessageType.InvalidCommand:
             return new SimpleMessage(InvalidCommandText).Show();
         case MessageType.InvalidNumberLength:
             return new SimpleMessage(InvalidNumberLengthText).Show();
         default:
             throw new ArgumentNullException(NullExceptionText);
     }
 }
示例#30
0
 public override void Reset()
 {
     gameObject = null;
     delivery = MessageType.SendMessage;
     options = SendMessageOptions.DontRequireReceiver;
     MethodName = "";
 }
 public void Log(MessageType type, [NotNull] string message, [CanBeNull] object o = null)
 {
     Services.MyLogger.AddMessage(new LogMessage(type, message, Name, MyStage, o));
 }
 public void ThenThatMessageShouldHaveTheType(MessageType type)
 {
     message.Type.Should().Be(type);
 }
        static bool TryGetHelpInfo(SearchArg arg, out string msg, out MessageType msgType)
        {
            msgType = MessageType.Info;
            if (arg == null)
            {
                msg = default;
                return(false);
            }

            var path = arg.FilePath;

            if (string.IsNullOrEmpty(path))
            {
                msg = default;
                return(false);
            }

            if (SearchUtils.IgnoredPaths(path, out var subPath))
            {
                msg = $"Paths containing '{subPath}' are ignored. You could add or remove it in Settings tab";
                return(true);
            }

            if (SearchUtils.IgnoredNonAssets(path) && !path.Eq("Assets"))
            {
                msg = $"Asset is outside of Assets folder";
                return(true);
            }

            if (IgnoreTypes.Check(path, out var type))
            {
                if (AssetDatabase.IsValidFolder(path))
                {
                    var scenes = arg.UnusedScenesFiltered?.Count;
                    var files  = arg.UnusedAssetsFiltered?.Count;
                    if (scenes == 0 && files == 0)
                    {
                        msg = default;
                        return(false);
                    }

                    var b = new StringBuilder();
                    b.Append("This directory contains: ");
                    var any = false;

                    if (files > 0)
                    {
                        any = true;

                        b.Append($"unused files ({files})");
                    }

                    if (scenes > 0)
                    {
                        if (any)
                        {
                            b.Append(", ");
                        }
                        b.Append($"unused scenes ({scenes})");
                    }

                    b.Append(
                        ".\nYou could delete them pressing corresponding button to the right.\nIf you don't want it to be inspected, please add it to Ignore list in the Settings tab");
                    msg = b.ToString();
                    return(true);
                }

                msg = $"Assets of type '{type.Name}' are ignored. Please contact support if you need to change it";
                return(true);
            }

            // if (Filters.ScenePaths.GetEntitiesCount() == 0 && Filters.FileResultRows.GetEntitiesCount() == 0) {
            if (SearchUtils.IsUnused(path))
            {
                type = AssetDatabase.GetMainAssetTypeAtPath(path);
                var name = type.IsAssignableFromInverse(typeof(SceneAsset)) ? "scene" : "file";
                msg =
                    $"This {name} has no explicit serialized usages and potentially could be removed. If you don't want it to be inspected, please add the containing folder to ignore list";
                return(true);
            }

            msgType = default;
            msg     = default;
            return(false);
        }
示例#34
0
文件: Logger.cs 项目: edkek/FILO
        private static void _log(string message, string formatedMessage, DateTime time, MessageType type)
        {
            var md = new MessageData();

            md.Message         = message;
            md.FormatedMessage = formatedMessage;
            md.Time            = time;
            md.Type            = type;

            Loggers.ForEach((l) => l.OnLog(md));

            LastMessage = message;
        }
示例#35
0
 protected void checkRoot(MessageType expectedType)
 {
   if (this.MessageType != expectedType)
     throw new ArgumentOutOfRangeException("Neznani dokument / Unknown document");
 }
示例#36
0
        public static bool Handle(Mobile from, string text, MessageType type = MessageType.Regular)
        {
            if (!text.StartsWith(Prefix) && type != MessageType.Command)
            {
                return(false);
            }

            if (type != MessageType.Command)
            {
                text = text.Substring(Prefix.Length);
            }

            var indexOf = text.IndexOf(' ');

            string command;

            string[] args;
            string   argString;

            if (indexOf >= 0)
            {
                argString = text.Substring(indexOf + 1);

                command = text.Substring(0, indexOf);
                args    = Split(argString);
            }
            else
            {
                argString = "";
                command   = text.ToLower();
                args      = Array.Empty <string>();
            }

            Entries.TryGetValue(command, out var entry);

            if (entry != null)
            {
                if (from.AccessLevel >= entry.AccessLevel)
                {
                    if (entry.Handler != null)
                    {
                        var e = new CommandEventArgs(from, command, argString, args);
                        entry.Handler(e);
                        EventSink.InvokeCommand(e);
                    }
                }
                else
                {
                    if (from.AccessLevel <= BadCommandIgnoreLevel)
                    {
                        return(false);
                    }

                    from.SendMessage("You do not have access to that command.");
                }
            }
            else
            {
                if (from.AccessLevel <= BadCommandIgnoreLevel)
                {
                    return(false);
                }

                from.SendMessage("That is not a valid command.");
            }

            return(true);
        }
示例#37
0
 protected void ShowMessage(string Message, MessageType type)
 {
     ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "ShowMessage('" + Message + "','" + type + "');", true);
 }
示例#38
0
 public MessageBoard(string text, Color textColor, MessageType type = MessageType.None)
 {
     Text      = text;
     TextColor = textColor;
     Type      = type;
 }
示例#39
0
 public Message(MessageType type, byte[] body, object obj)
 {
     _type   = type;
     _body   = body;
     _object = obj;
 }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// <summary>Send an email notification</summary>
        /// </summary>
        /// <param name="user">The user to whom the message is being sent</param>
        /// <param name="msgType">The type of message being sent</param>
        /// <param name="settings">Portal Settings</param>
        /// <returns></returns>
        /// <remarks></remarks>
        /// <history>
        ///     [cnurse]        09/29/2005  Moved to Mail class
        ///     [sLeupold]      02/07/2008 language used for admin mails corrected
        /// </history>
        /// -----------------------------------------------------------------------------
        public static string SendMail(UserInfo user, MessageType msgType, PortalSettings settings)
        {
            //Send Notification to User
            int       toUser = user.UserID;
            string    locale = user.Profile.PreferredLocale;
            string    subject;
            string    body;
            ArrayList custom = null;

            switch (msgType)
            {
            case MessageType.UserRegistrationAdmin:
                subject = "EMAIL_USER_REGISTRATION_ADMINISTRATOR_SUBJECT";
                body    = "EMAIL_USER_REGISTRATION_ADMINISTRATOR_BODY";
                toUser  = settings.AdministratorId;
                UserInfo admin = UserController.GetUserById(settings.PortalId, settings.AdministratorId);
                locale = admin.Profile.PreferredLocale;
                break;

            case MessageType.UserRegistrationPrivate:
                subject = "EMAIL_USER_REGISTRATION_PRIVATE_SUBJECT";
                body    = "EMAIL_USER_REGISTRATION_PRIVATE_BODY";
                break;

            case MessageType.UserRegistrationPublic:
                subject = "EMAIL_USER_REGISTRATION_PUBLIC_SUBJECT";
                body    = "EMAIL_USER_REGISTRATION_PUBLIC_BODY";
                break;

            case MessageType.UserRegistrationVerified:
                subject = "EMAIL_USER_REGISTRATION_VERIFIED_SUBJECT";
                body    = "EMAIL_USER_REGISTRATION_VERIFIED_BODY";
                var propertyNotFound = false;
                if (HttpContext.Current != null)
                {
                    custom = new ArrayList
                    {
                        HttpContext.Current.Server.HtmlEncode(HttpContext.Current.Server.UrlEncode(user.Username)),
                        HttpContext.Current.Server.UrlEncode(user.GetProperty("verificationcode", String.Empty, null, user, Scope.SystemMessages, ref propertyNotFound))
                    };
                }
                break;

            case MessageType.PasswordReminder:
                subject = "EMAIL_PASSWORD_REMINDER_SUBJECT";
                body    = "EMAIL_PASSWORD_REMINDER_BODY";
                break;

            case MessageType.ProfileUpdated:
                subject = "EMAIL_PROFILE_UPDATED_SUBJECT";
                body    = "EMAIL_PROFILE_UPDATED_BODY";
                break;

            case MessageType.PasswordUpdated:
                subject = "EMAIL_PASSWORD_UPDATED_SUBJECT";
                body    = "EMAIL_PASSWORD_UPDATED_BODY";
                break;

            default:
                subject = "EMAIL_USER_UPDATED_OWN_PASSWORD_SUBJECT";
                body    = "EMAIL_USER_UPDATED_OWN_PASSWORD_BODY";
                break;
            }

            subject = Localize.GetSystemMessage(locale, settings, subject, user, Localize.GlobalResourceFile, custom, "", settings.AdministratorId);
            body    = Localize.GetSystemMessage(locale, settings, body, user, Localize.GlobalResourceFile, custom, "", settings.AdministratorId);

            SendEmail(settings.Email, UserController.GetUserById(settings.PortalId, toUser).Email, subject, body);

            return(Null.NullString);
        }
示例#41
0
 /// <summary>
 /// Instantiates a new empty message.
 /// </summary>
 public EmptyMessage(MessageType type)
     : base(type, CoAP.Code.Empty)
 {
 }
示例#42
0
 public Message(MessageType type, IrcClient client, string contents)
 {
     Type     = type;
     Client   = client;
     Contents = contents;
 }
示例#43
0
 public Message(Jid to, MessageType type, string body, string subject)
     : base(to, type, body, subject)
 {
     Namespace = Uri.ACCEPT;
 }
        public static void SendMenuMessage(MessageType messageType)
        {
            SystemMessage msg = new SystemMessage(messageType);

            ServiceRegistration.Get <IMessageBroker>().Send(CHANNEL, msg);
        }
示例#45
0
 public Message(Jid to, Jid from, MessageType type, string body, string subject, string thread)
     : base(to, from, type, body, subject, thread)
 {
     Namespace = Uri.ACCEPT;
 }
示例#46
0
        public static void ShowMessage(
            EffectiveField field,
            MessageType type,
            string message,
            bool showDetailedErrorInfo,
            Exception exception = null)
        {
            ShowErrorDelegate showErrorHandler;

            switch (field)
            {
            case EffectiveField.Global:
                showErrorHandler =
                    (string[] messages) =>
                {
                    Console.Clear();
                    Console.SetCursorPosition(0, 0);
                };
                break;

            case EffectiveField.local:

                showErrorHandler =
                    (string[] messages) =>
                {
                    throw new NotImplementedException();
                };
                break;

            case EffectiveField.Toast:

                showErrorHandler =
                    (string[] messages) =>
                {
                    throw new NotImplementedException();
                };
                break;

            case EffectiveField.Hint:

                showErrorHandler =
                    (string[] messages) =>
                {
                    throw new NotImplementedException();
                };
                break;

            default:
                showErrorHandler = null;
                ShowMessage(EffectiveField.Global, MessageType.Error, "Invalid Command", false);
                break;
            }

            switch (type)
            {
            case MessageType.Error:
                Console.ForegroundColor = ConsoleColor.Red;
                Console.BackgroundColor = ConsoleColor.White;

                if (showDetailedErrorInfo)
                {
                    try
                    {
                        showErrorHandler += Console.WriteLine;

                        showErrorHandler(
                            message,
                            exception?.Message,
                            exception?.InnerException.Message,
                            exception?.TargetSite.ToString(),
                            exception?.StackTrace,
                            exception?.Source,
                            exception?.HResult.ToString(),
                            exception?.HelpLink);
                    }
                    catch (ArgumentNullException argumentNullException)
                    {
                        ShowMessage(
                            EffectiveField.Global,
                            MessageType.Error,
                            "",
                            true,
                            argumentNullException);
                    }
                }

                break;

            case MessageType.Warning:
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.BackgroundColor = ConsoleColor.White;
                break;

            case MessageType.Information:
                Console.ForegroundColor = ConsoleColor.Blue;
                Console.BackgroundColor = ConsoleColor.White;
                break;

            default:
                ShowMessage(EffectiveField.Global, MessageType.Error, "Invalid Command", false);
                break;
            }

            Console.Write(message);

            Console.ForegroundColor = ConsoleColor.Black;
            Console.BackgroundColor = ConsoleColor.White;
        }
示例#47
0
        public override void Receive(MessageType messageType)
        {
            var response = Responses[messageType];

            Console.WriteLine($"ProductManager: {response}");
        }
示例#48
0
 public Message(string to, MessageType type, string body)
     : base(to, type, body)
 {
     Namespace = Uri.ACCEPT;
 }
示例#49
0
        public void TestDropMessageWithFalseId()
        {
            MessageType mesType = messageTypeService.GetMessageTypeByName(validMesType);

            messageService.DropMessage(1000, mesType);
        }
示例#50
0
 public Message(Jid to, Jid from, MessageType type, string body)
     : base(to, from, type, body)
 {
     Namespace = Uri.ACCEPT;
 }
示例#51
0
 public Category(String product, MessageType type, MessageTopic topic)
 {
     this.product = product;
     this.type    = type;
     this.topic   = topic;
 }
示例#52
0
        private void OnGUI()
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(position.width), GUILayout.Height(position.height));
            {
                GUILayout.Space(5f);
                EditorGUILayout.LabelField("Environment Information", EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical("box");
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Product Name", GUILayout.Width(160f));
                        EditorGUILayout.LabelField(m_Controller.ProductName);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Company Name", GUILayout.Width(160f));
                        EditorGUILayout.LabelField(m_Controller.CompanyName);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Game Identifier", GUILayout.Width(160f));
                        EditorGUILayout.LabelField(m_Controller.GameIdentifier);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Applicable Game Version", GUILayout.Width(160f));
                        EditorGUILayout.LabelField(m_Controller.ApplicableGameVersion);
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndVertical();
                GUILayout.Space(5f);
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.BeginVertical();
                    {
                        EditorGUILayout.LabelField("Platforms", EditorStyles.boldLabel);
                        EditorGUILayout.BeginHorizontal("box");
                        {
                            EditorGUILayout.BeginVertical();
                            {
                                DrawPlatform(Platform.Windows, "Windows (x86)");
                                DrawPlatform(Platform.Windows64, "Windows (x64)");
                                DrawPlatform(Platform.MacOS, "macOS");
                                DrawPlatform(Platform.Linux, "Linux");
                                DrawPlatform(Platform.IOS, "iOS");
                                DrawPlatform(Platform.Android, "Android");
                            }
                            EditorGUILayout.EndVertical();
                            EditorGUILayout.BeginVertical();
                            {
                                DrawPlatform(Platform.WindowsStore, "Windows Store");
                                DrawPlatform(Platform.WebGL, "WebGL");
                            }
                            EditorGUILayout.EndVertical();
                        }
                        EditorGUILayout.EndHorizontal();
                        EditorGUILayout.BeginVertical();
                        {
                            m_Controller.ZipSelected = EditorGUILayout.ToggleLeft("Zip All AssetBundles", m_Controller.ZipSelected);
                            //m_Controller.RecordScatteredDependencyAssetsSelected = EditorGUILayout.ToggleLeft("Record Scattered Dependency Assets", m_Controller.RecordScatteredDependencyAssetsSelected);
                        }
                        EditorGUILayout.EndVertical();
                    }
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.BeginVertical();
                    {
                        EditorGUILayout.LabelField("AssetBundle Options", EditorStyles.boldLabel);
                        EditorGUILayout.BeginVertical("box");
                        {
                            bool uncompressedAssetBundleSelected = EditorGUILayout.ToggleLeft("Uncompressed AssetBundle", m_Controller.UncompressedAssetBundleSelected);
                            if (m_Controller.UncompressedAssetBundleSelected != uncompressedAssetBundleSelected)
                            {
                                m_Controller.UncompressedAssetBundleSelected = uncompressedAssetBundleSelected;
                                if (m_Controller.UncompressedAssetBundleSelected)
                                {
                                    m_Controller.ChunkBasedCompressionSelected = false;
                                }
                            }

                            bool disableWriteTypeTreeSelected = EditorGUILayout.ToggleLeft("Disable Write TypeTree", m_Controller.DisableWriteTypeTreeSelected);
                            if (m_Controller.DisableWriteTypeTreeSelected != disableWriteTypeTreeSelected)
                            {
                                m_Controller.DisableWriteTypeTreeSelected = disableWriteTypeTreeSelected;
                                if (m_Controller.DisableWriteTypeTreeSelected)
                                {
                                    m_Controller.IgnoreTypeTreeChangesSelected = false;
                                }
                            }

                            m_Controller.DeterministicAssetBundleSelected = EditorGUILayout.ToggleLeft("Deterministic AssetBundle", m_Controller.DeterministicAssetBundleSelected);
                            m_Controller.ForceRebuildAssetBundleSelected  = EditorGUILayout.ToggleLeft("Force Rebuild AssetBundle", m_Controller.ForceRebuildAssetBundleSelected);

                            bool ignoreTypeTreeChangesSelected = EditorGUILayout.ToggleLeft("Ignore TypeTree Changes", m_Controller.IgnoreTypeTreeChangesSelected);
                            if (m_Controller.IgnoreTypeTreeChangesSelected != ignoreTypeTreeChangesSelected)
                            {
                                m_Controller.IgnoreTypeTreeChangesSelected = ignoreTypeTreeChangesSelected;
                                if (m_Controller.IgnoreTypeTreeChangesSelected)
                                {
                                    m_Controller.DisableWriteTypeTreeSelected = false;
                                }
                            }

                            EditorGUI.BeginDisabledGroup(true);
                            {
                                m_Controller.AppendHashToAssetBundleNameSelected = EditorGUILayout.ToggleLeft("Append Hash To AssetBundle Name", m_Controller.AppendHashToAssetBundleNameSelected);
                            }
                            EditorGUI.EndDisabledGroup();

                            bool chunkBasedCompressionSelected = EditorGUILayout.ToggleLeft("Chunk Based Compression", m_Controller.ChunkBasedCompressionSelected);
                            if (m_Controller.ChunkBasedCompressionSelected != chunkBasedCompressionSelected)
                            {
                                m_Controller.ChunkBasedCompressionSelected = chunkBasedCompressionSelected;
                                if (m_Controller.ChunkBasedCompressionSelected)
                                {
                                    m_Controller.UncompressedAssetBundleSelected = false;
                                }
                            }
                        }
                        EditorGUILayout.EndVertical();
                    }
                    EditorGUILayout.EndVertical();
                }
                EditorGUILayout.EndHorizontal();
                string      compressMessage     = string.Empty;
                MessageType compressMessageType = MessageType.None;
                GetCompressMessage(out compressMessage, out compressMessageType);
                EditorGUILayout.HelpBox(compressMessage, compressMessageType);
                GUILayout.Space(5f);
                EditorGUILayout.LabelField("Build", EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical("box");
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Build Event Handler", GUILayout.Width(160f));
                        string[] names         = m_Controller.GetBuildEventHandlerTypeNames();
                        int      selectedIndex = EditorGUILayout.Popup(m_BuildEventHandlerTypeNameIndex, names);
                        if (selectedIndex != m_BuildEventHandlerTypeNameIndex)
                        {
                            m_BuildEventHandlerTypeNameIndex       = selectedIndex;
                            m_Controller.BuildEventHandlerTypeName = (selectedIndex <= 0 ? string.Empty : names[selectedIndex]);
                            if (m_Controller.RefreshBuildEventHandler())
                            {
                                Debug.Log("Set build event success.");
                            }
                            else
                            {
                                Debug.LogWarning("Set build event failure.");
                            }
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Internal Resource Version", GUILayout.Width(160f));
                        m_Controller.InternalResourceVersion = EditorGUILayout.IntField(m_Controller.InternalResourceVersion);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Resource Version", GUILayout.Width(160f));
                        GUILayout.Label(Utility.Text.Format("{0} ({1})", m_Controller.ApplicableGameVersion, m_Controller.InternalResourceVersion.ToString()));
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Output Directory", GUILayout.Width(160f));
                        m_Controller.OutputDirectory = EditorGUILayout.TextField(m_Controller.OutputDirectory);
                        if (GUILayout.Button("Browse...", GUILayout.Width(80f)))
                        {
                            BrowseOutputDirectory();
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Working Path", GUILayout.Width(160f));
                        GUILayout.Label(m_Controller.WorkingPath);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUI.BeginDisabledGroup(!m_Controller.OutputPackageSelected);
                        EditorGUILayout.LabelField("Output Package Path", GUILayout.Width(160f));
                        GUILayout.Label(m_Controller.OutputPackagePath);
                        EditorGUI.EndDisabledGroup();
                        m_Controller.OutputPackageSelected = EditorGUILayout.ToggleLeft("Generate", m_Controller.OutputPackageSelected, GUILayout.Width(70f));
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUI.BeginDisabledGroup(!m_Controller.OutputFullSelected);
                        EditorGUILayout.LabelField("Output Full Path", GUILayout.Width(160f));
                        GUILayout.Label(m_Controller.OutputFullPath);
                        EditorGUI.EndDisabledGroup();
                        m_Controller.OutputFullSelected = EditorGUILayout.ToggleLeft("Generate", m_Controller.OutputFullSelected, GUILayout.Width(70f));
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUI.BeginDisabledGroup(!m_Controller.OutputPackedSelected);
                        EditorGUILayout.LabelField("Output Packed Path", GUILayout.Width(160f));
                        GUILayout.Label(m_Controller.OutputPackedPath);
                        EditorGUI.EndDisabledGroup();
                        m_Controller.OutputPackedSelected = EditorGUILayout.ToggleLeft("Generate", m_Controller.OutputPackedSelected, GUILayout.Width(70f));
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Build Report Path", GUILayout.Width(160f));
                        GUILayout.Label(m_Controller.BuildReportPath);
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndVertical();
                string      buildMessage     = string.Empty;
                MessageType buildMessageType = MessageType.None;
                GetBuildMessage(out buildMessage, out buildMessageType);
                EditorGUILayout.HelpBox(buildMessage, buildMessageType);
                GUILayout.Space(2f);
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUI.BeginDisabledGroup(m_Controller.Platforms == Platform.Undefined || !m_Controller.IsValidOutputDirectory);
                    {
                        if (GUILayout.Button("Start Build AssetBundles"))
                        {
                            m_OrderBuildAssetBundles = true;
                        }
                    }
                    EditorGUI.EndDisabledGroup();
                    if (GUILayout.Button("Save", GUILayout.Width(80f)))
                    {
                        SaveConfiguration();
                    }
                }
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();
        }
示例#53
0
 public MessageEntity(EventEntity eventEntity, DateTime time, string contents, MessageType type)
     : base(
         DefaultPartitionKey,
         GetRowKey(eventEntity, time),
         eventEntity)
 {
     Time     = time;
     Contents = contents;
     Type     = (int)type;
 }
示例#54
0
 public void TestGetMessageByEmptyID()
 {
     MessageType mesType = messageTypeService.GetMessageTypeByName(validMesType);
     Message     message = messageService.GetMessageById(0, mesType);
 }
示例#55
0
 public NetworkMessage(MessageType type, System.Object[] arguments, int networkOrder = -1)
 {
     Type         = type;
     NetworkOrder = networkOrder;
     Arguments    = arguments;
 }
示例#56
0
 public Message(MessageType messageType)
 {
     _type = messageType;
 }
示例#57
0
 void IUserServiceCallback.OnMessageReceived(SignatureDate signatureDate, string[] userIDs, string message, MessageType messageType)
 {
     throw new NotImplementedException();
 }
示例#58
0
 public BaseMessage(MessageType messageType)
 {
     mMessageType = messageType;
 }
示例#59
0
 public Error OnReceive(MessageType messageType, ReceiveContext context, Dummy layerData)
 {
     State += prefix + ReceiveMessage;
     return(null);
 }
示例#60
0
 public static Noty Noty(string text, MessageType type = MessageType.Alert, bool modal = false, MessageAlignment layout = MessageAlignment.Center, bool dismissQueue = false)
 {
     return(new Noty().Text(text).Type(type).Modal(modal).Layout(layout).DismissQueue(dismissQueue));
 }