• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MessageType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CreateResponseMessages

        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;
        }
开发者ID:Lampart071,项目名称:DHub.CQRS,代码行数:7,代码来源:ApiControllerBase.cs


示例2: Add

 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 );
 }
开发者ID:Retatta,项目名称:ClassicalSharp,代码行数:26,代码来源:ChatLog.cs


示例3: show

 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;
 }
开发者ID:xmalmorthen,项目名称:DashBoard,代码行数:7,代码来源:dlg.cs


示例4: Init

        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);
            }
        }
开发者ID:afyles,项目名称:NServiceBus,代码行数:29,代码来源:SubscriptionStorage.cs


示例5: IconImageForMessageType

        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);
        }
开发者ID:modulexcite,项目名称:userdialogs,代码行数:7,代码来源:AcrMessageBarStyleSheet.cs


示例6: ShowMessageBox

        // 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;
        }
开发者ID:Orochimarufan,项目名称:MultiMC,代码行数:27,代码来源:MessageUtils.cs


示例7: UnexpectedMessageException

 public UnexpectedMessageException(
     MessageType messageType,
     MessageType expectedMessageType)
 {
     MessageType = messageType;
     ExpectedMessageType = expectedMessageType;
 }
开发者ID:John-Leitch,项目名称:GenomeDotNet,代码行数:7,代码来源:UnexpectedMessageException.cs


示例8: ReceiveMessage

        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;
        }
开发者ID:eaglezhao,项目名称:tracnghiemweb,代码行数:29,代码来源:Messenger.cs


示例9: Append

 public override void Append(MessageType messageType, string message)
 {
     using (var sw = new StreamWriter(this.FilePath, true))
     {
         sw.WriteLine($"{messageType}: {message}");
     }
 }
开发者ID:ikolev94,项目名称:Exercises,代码行数:7,代码来源:TextFileAppender.cs


示例10: SessionMessage

 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;
 }
开发者ID:jmptrader,项目名称:WebFrameworkMVC,代码行数:35,代码来源:SessionMessage.cs


示例11: Message

 public Message(MessageType type, uint id, string route, JsonObject data)
 {
     this.type = type;
     this.id = id;
     this.route = route;
     this.data = data;
 }
开发者ID:GodSky,项目名称:pomelo-unityclient-socket,代码行数:7,代码来源:Message.cs


示例12: Deserialize

        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.");
        }
开发者ID:ikvm,项目名称:cloudb,代码行数:35,代码来源:BinaryRpcMessageSerializer.cs


示例13: Reset

		public override void Reset()
		{
			gameObject = null;
			delivery = MessageType.SendMessage;
			options = SendMessageOptions.DontRequireReceiver;
			functionCall = null;
		}
开发者ID:RosalieChang,项目名称:hello,代码行数:7,代码来源:SendMessage.cs


示例14: MakeMessage

 /// <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);
     }
 }
开发者ID:shunobaka,项目名称:HQC-Teamwork-Project,代码行数:35,代码来源:MessageFactory.cs


示例15: OnInspectorGUI

	/// <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);
		
	}
开发者ID:Barthuc,项目名称:ProjectLevelDesign,代码行数:35,代码来源:vp_MovingPlatformEditor.cs


示例16: LogEventArgs

 public LogEventArgs(string message, MessageType messageType, StackTrace st)
 {
     this.message = message;
     this.dateTime = DateTime.Now;
     this.messageType = messageType;
     this.stackTrace = st;
 }
开发者ID:erynet,项目名称:SensorMonitor,代码行数:7,代码来源:LogEventArgs.cs


示例17: ResultDTO

 private ResultDTO(MessageType messageType)
 {
     this.messageType = messageType;
     levelCount = Application.levelCount;
     loadedLevel = Application.loadedLevel;
     loadedLevelName = Application.loadedLevelName;
 }
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:7,代码来源:ResultDTO.cs


示例18: ShowMessage

 public void ShowMessage(string message, MessageType status)
 {
     MessageTextBlock.Text = message;
     RootBorder.Background = (status == MessageType.Successful) ? _successfulColor : _failedColor;
     RootBorder.BringIntoView();
     AnimatePopup();
 }
开发者ID:syatin003,项目名称:Wpf,代码行数:7,代码来源:PopupControl.xaml.cs


示例19: ChatMessageValues

 public ChatMessageValues(MessageType type, string message, bool hasLanguage = false, bool hasRealmId = false)
 {
     ChatType = type;
     Message = message;
     HasLanguage = hasLanguage;
     HasRealmId = hasRealmId;
 }
开发者ID:australopitheque,项目名称:Arctium,代码行数:7,代码来源:ChatMessageValues.cs


示例20: ReceiveEmail

        //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.");
        }
开发者ID:mahdiz,项目名称:torbricks,代码行数:38,代码来源:User.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MessageTypes类代码示例发布时间:2022-05-24
下一篇:
C# MessageSummaryItems类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap