当前位置: 首页>>代码示例>>C#>>正文


C# MessageTypes类代码示例

本文整理汇总了C#中MessageTypes的典型用法代码示例。如果您正苦于以下问题:C# MessageTypes类的具体用法?C# MessageTypes怎么用?C# MessageTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MessageTypes类属于命名空间,在下文中一共展示了MessageTypes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendMessage

        protected static ResponseType SendMessage(string title, string message, MessageTypes type, Exception ex, bool suppressable) {
            MessageEventArgs e = new MessageEventArgs();
            e.type = type;
            e.exception = ex;
            e.title = title;
            e.message = message;
            e.Suppressable = suppressable;
            ICommunicationReceiver receiver = getReceiver();
            if (receiver == null)
                return ResponseType.Cancel;

			if (receiver.ThreadBridge != null) {
				receiver.ThreadBridge.Send(delegate() {
                    MessageEventHandler handler = receiver.sendMessage;
                    if (handler != null) {
                        handler(e);
                    }
                });
            } else {
                receiver.sendMessage(e);
            }

            waitForResponse(e);

            ProgressHandler.state = ProgressState.Normal;
            return e.response;

        }
开发者ID:sanmadjack,项目名称:MVC.CSharp,代码行数:28,代码来源:MessageHandler.cs

示例2: Message

 public Message(MessageTypes type, string body)
 {
     Content = body;
     Type = type;
     Tag = string.Empty;
     ByteLength = 0;
 }
开发者ID:bluejack2000,项目名称:core,代码行数:7,代码来源:Message.cs

示例3: MessageBox

 public MessageBox(MessageTypes type, string title, string message, Exception e, bool suppressable, AViewWindow owner, IEmailSource email_source)
     : this(title, message, suppressable, owner, email_source) {
     switch (type) {
         case MessageTypes.Error:
             if (e != null) {
                 exceptionExpander.Visibility = System.Windows.Visibility.Visible;
                 exceptionText.Text = recurseExceptions(e);
                 if (e.GetType() == typeof(CommunicatableException)) {
                     submitButton.Visibility = System.Windows.Visibility.Visible;
                 } else {
                     submitButton.Visibility = System.Windows.Visibility.Visible;
                 }
             }
             closeButton.Visibility = System.Windows.Visibility.Visible;
             errorIcon.Visibility = System.Windows.Visibility.Visible;
             break;
         case MessageTypes.Info:
             okButton.Visibility = System.Windows.Visibility.Visible;
             infoIcon.Visibility = System.Windows.Visibility.Visible;
             break;
         case MessageTypes.Warning:
             okButton.Visibility = System.Windows.Visibility.Visible;
             warningIcon.Visibility = System.Windows.Visibility.Visible;
             break;
     }
 }
开发者ID:sanmadjack,项目名称:MVC.WPF.CSharp,代码行数:26,代码来源:MessageBox.xaml.cs

示例4: tl_newUnknownRequest

 long tl_newUnknownRequest(MessageTypes t, string msg)
 {
     v("message: " + t.ToString() + " data: " + msg);
     switch (t)
     {
         case MessageTypes.DOMREQUEST:
             {
                 string client = string.Empty;
                 int depth = 0;
                 if (Book.ParseDOMRequest(msg, ref depth, ref client))
                 {
                     debug("depth set to: " + depth + " by client: " + client);
                     tickdepth = depth;
                 }
                 break;
             }
         case MessageTypes.DAYHIGH:
             {
                 decimal price = 0;
                 highs.TryGetValue(msg, out price);
                 return WMUtil.pack(price);
             }
         case MessageTypes.DAYLOW:
             {
                 decimal price = 0;
                 lows.TryGetValue(msg, out price);
                 return WMUtil.pack(price);
             }
     }
     return (long)MessageTypes.UNKNOWN_MESSAGE;
 }
开发者ID:bluejack2000,项目名称:core,代码行数:31,代码来源:Replay.cs

示例5: MessageModel

        public MessageModel(MessageTypes messageType, string text)
        {
            if (String.IsNullOrWhiteSpace(text)) throw new ArgumentException(nameof(text));

            MessageType = messageType;
            Text = text;
        }
开发者ID:dyatlov-a,项目名称:cEditor,代码行数:7,代码来源:MessageModel.cs

示例6: sendmessage

 public static byte[] sendmessage(MessageTypes type, string msg)
 {
     byte[] data = new byte[SIZE];
     if (sendmessage(type, msg, ref data))
         return data;
     return new byte[0];
 }
开发者ID:bluejack2000,项目名称:core,代码行数:7,代码来源:Message.cs

示例7: SendMessage

        public static ResponseType SendMessage(string title, string message, MessageTypes type, Exception ex)
        {
            MessageEventArgs e = new MessageEventArgs();
            e.title = title;
            e.message = message;
            e.type = type;
            if(ex!=null)
                e.exception = ex;
            else
                e.exception = null;

            ICommunicationReceiver receiver = getReceiver();
            if(receiver==null)
                return ResponseType.Cancel;

            if(receiver.context!=null) {
                receiver.context.Send(new SendOrPostCallback(delegate(object state) {
                    MessageEventHandler handler = receiver.sendMessage;
                    if(handler!=null) {
                        handler(e);
                    }
                }),null);
            } else {
                receiver.sendMessage(e);
            }

            waitForResponse(e);

            ProgressHandler.progress_state = ProgressState.Normal;
            return e.response;
        }
开发者ID:elkine,项目名称:MASGAU,代码行数:31,代码来源:MessageHandler.cs

示例8: SupportedMessage

			public SupportedMessage(ConnectorSupportedMessagesPanel parent, IMessageAdapter adapter, MessageTypes type)
			{
				_parent = parent;
				_adapter = adapter;
				Type = type;
				Name = type.GetDisplayName();
			}
开发者ID:RakotVT,项目名称:StockSharp,代码行数:7,代码来源:ConnectorSupportedMessagesPanel.xaml.cs

示例9: Packet

 public Packet(int source, int dest, MessageTypes type, string msg)
 {
     From = source;
     To = dest;
     Intention = type;
     Data = msg;
 }
开发者ID:bluejack2000,项目名称:core,代码行数:7,代码来源:Packet.cs

示例10: displayMessage

        internal void displayMessage(string message, MessageTypes type = MessageTypes.Default)
        {
            int oldText = outputBox.TextLength;
            outputBox.AppendText("\n" + message);

            if (type != MessageTypes.Default)
            {
                outputBox.SelectionStart = oldText;
                outputBox.SelectionLength = message.Length;
            }

            switch (type)
            {
                case MessageTypes.Error:
                    outputBox.SelectionColor = Color.Red;
                    break;
                case MessageTypes.Alert:
                    outputBox.SelectionColor = Color.Blue;
                    break;
                case MessageTypes.Complete:
                    outputBox.SelectionColor = Color.Green;
                    break;
                default:
                    break;
            }
        }
开发者ID:Daynil,项目名称:stanfordalgodesign,代码行数:26,代码来源:MergeSort.cs

示例11: ConnectAsync

        public Task<ClientConnectionResult> ConnectAsync(Target target, MessageTypes messageTypes)
        {
            if (target == null)
                throw new ArgumentNullException ("target");

            var tcs = new TaskCompletionSource<ClientConnectionResult>();

            this.connected = true;
            if (this.provider.IsRunning)
            {
                this.provider.Connect (this);

                if (this.connected)
                {
                    OnConnected (new ClientConnectionEventArgs (this));
                    tcs.SetResult (new ClientConnectionResult (ConnectionResult.Success, null));
                }
            }
            else
            {
                OnDisconnected (new DisconnectedEventArgs (this, ConnectionResult.ConnectionFailed));
                tcs.SetResult (new ClientConnectionResult (ConnectionResult.ConnectionFailed, null));
            }

            return tcs.Task;
        }
开发者ID:ermau,项目名称:Tempest,代码行数:26,代码来源:MockClientConnection.cs

示例12: Send

 public override void Send(MessageTypes type, byte[] data, object messageBag)
 {
     var local = CurrentSocket();
     if (local != null)
     {
         try
         {
             byte[] msg = null;
             if (messageBag != null)
             {
                 var msgTrack = new MessageTrackingObject(messageBag);
                 messageTracker.TryAdd(msgTrack.MessageGuid, msgTrack);
                 msg = Message.CreateMessageByte(data, type, msgTrack.MessageGuid);
             }
             else
             {
                 msg = Message.CreateMessageByte(data, type);
             }
             local.BeginSend(msg, 0, msg.Length, SocketFlags.None, new AsyncCallback(this.EndSend), local);
         }
         catch (SocketException)
         {
             Close();
         }
     }
 }
开发者ID:simonkang,项目名称:NAppProfiler,代码行数:26,代码来源:NAppProfilerClientSocket.cs

示例13: Log

 /// <summary>
 /// Add the given message to the log.
 /// </summary>
 private void Log(MessageTypes type, string member, IMetadataScope scope, string msg)
 {
     if (IsDisposed) return;
     if (InvokeRequired)
     {
         Invoke(new Action<MessageTypes, string, IMetadataScope, string>(Log), type, member, scope, msg);
     }
     else
     {
         if ((type >= MessageTypes.MissingFirst) && (type <= MessageTypes.MissingLast))
         {
             MemberNode node;
             if (!nodes.TryGetValue(member, out node))
             {
                 node = new MemberNode(member, scope, type);
                 node.ImageIndex = (int) type;
                 nodes.Add(member, node);
                 tvList.Nodes.Add(node);
             }
             node.Messages.Add(msg);
             if (node == tvList.SelectedNode)
             {
                 tvUsedIn.Nodes.Add(new TreeNode(msg));
             }
         }
         else
         {
             tvLog.Nodes.Add(new TreeNode(msg) { ImageIndex = (int) type });
         }
         miCopy.Enabled = (tvList.Nodes.Count > 0);
     }
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:35,代码来源:MainForm.cs

示例14: Telegram

 ///<summary>
 ///constructor
 ///</summary>
 ///<param name="dispatchTime"></param>
 ///<param name="sender"></param>
 ///<param name="receiver"></param>
 ///<param name="msg"></param>
 public Telegram(
     float dispatchTime,
     uint sender,
     uint receiver,
     MessageTypes msg)
     : this(dispatchTime, sender, receiver, msg, null)
 {
 }
开发者ID:funkjunky,项目名称:Raven,代码行数:15,代码来源:Telegram.cs

示例15: s_newUnknownRequest

 long s_newUnknownRequest(MessageTypes t, string msg)
 {
     if (t == MessageTypes.LOOPBACKSERVER)
     {
         return SPECIAL;
     }
     return 0;
 }
开发者ID:antonywu,项目名称:tradelink,代码行数:8,代码来源:TestTradeLink_WM.cs


注:本文中的MessageTypes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。