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


C# HipChatClient.SendMessage方法代码示例

本文整理汇总了C#中HipChat.HipChatClient.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# HipChatClient.SendMessage方法的具体用法?C# HipChatClient.SendMessage怎么用?C# HipChatClient.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HipChat.HipChatClient的用法示例。


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

示例1: TestWindsorInstaller

 public static void TestWindsorInstaller(TestContext context)
 {
     IWindsorContainer container = new WindsorContainer();
     container.Install(new HipChatClientInstaller());
     defaultClient = container.Resolve<HipChatClient>("ChatClient");
     defaultClient.From += defaultClient.GetHashCode().ToString();
     defaultClient.SendMessage("TestWindsorInstaller");
 }
开发者ID:tekmaven,项目名称:HipChat.net,代码行数:8,代码来源:ClientTests.cs

示例2: SendNotification

        public void SendNotification(string sourceName, string notification)
        {
            var client = new HipChatClient(_authToken, _roomId, sourceName)
            {
                Notify = false,
                Color = HipChatClient.BackgroundColor.random
            };

            client.SendMessage(notification);
        }
开发者ID:pimterry,项目名称:hipchat-filterer,代码行数:10,代码来源:HipchatNotificationTarget.cs

示例3: SendMessage

 /// <summary>
 /// Sends a message to a chat room.
 /// </summary>
 public static void SendMessage(string token, int room, string from, string message, bool notify)
 {
     // create a local instance of HipChatClient, as then we get the validation
     var client = new HipChatClient(token, room);
     client.SendMessage(message, from, notify);
 }
开发者ID:stgwilli,项目名称:HipChat.net,代码行数:9,代码来源:HipChatClient.cs

示例4: SendMessage

 /// <summary>
 /// Sends a message to a chat room.
 /// </summary>
 public static void SendMessage(string token, int room, string from, string message, BackgroundColor color)
 {
     // create a local instance of HipChatClient, as then we get the validation
     var client = new HipChatClient(token, room);
     client.SendMessage(message, from, color);
 }
开发者ID:ChrisMissal,项目名称:HipChat.net,代码行数:9,代码来源:HipChatClient.cs

示例5: TestSendMessage_HtmlMessage

		public void TestSendMessage_HtmlMessage()
		{
			var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From);
			client.SendMessage(MethodBase.GetCurrentMethod().Name + " <a href='http://en.wikiquote.org/wiki/Pulp_Fiction#Dialogue'>Quotable &amp; questionable (?) gems from &quot;Pulp Fiction&quot;</a> =)");
		}
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例6: TestSendMessage_Message

 public void TestSendMessage_Message()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From);
     client.SendMessage(MethodBase.GetCurrentMethod().Name);
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例7: TestSendMessageTooLongException

 public void TestSendMessageTooLongException()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token) { AutoTruncate = false };
     client.SendMessage(GetReallyLongMessage(MethodBase.GetCurrentMethod().Name, 5000), defaultClient.RoomId, defaultClient.From);
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例8: TestSendMessageEmptyException

 public void TestSendMessageEmptyException()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token);
     client.SendMessage("", defaultClient.RoomId, defaultClient.From);
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例9: TestSendMessage_Message_green_notify

 public void TestSendMessage_Message_green_notify()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From);
     client.SendMessage(MethodBase.GetCurrentMethod().Name, HipChatClient.BackgroundColor.green, true);
 }
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例10: TestSendMessage_UnicodeAuthorAndMessage

		public void TestSendMessage_UnicodeAuthorAndMessage()
		{
			var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, "lǝʌɐd ツ");
			client.SendMessage(MethodBase.GetCurrentMethod().Name + " ಠ_ಠ");
		}
开发者ID:jfurie,项目名称:HipChat.net,代码行数:5,代码来源:ClientTests.cs

示例11: TestUserAlertingWithTextFormatMessage

 public void TestUserAlertingWithTextFormatMessage()
 {
     var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId.ToString(),HipChatClient.MessageFormat.text);
     client.SendMessage("@all this is a test message notifing all users in the room",
         defaultClient.From);
 }
开发者ID:ByBox,项目名称:HipChat.net,代码行数:6,代码来源:ClientTests.cs

示例12: Run

        public void Run(IIntegrationResult result)
        {
            var displayDuration = false;
            var duration = TimeSpan.Zero;
            if (result.EndTime != DateTime.MinValue)
            {
                duration = result.EndTime - result.StartTime;
                displayDuration = true;
            }
            var link = String.Format(@"<a href=""{0}"">{1}</a>", result.ProjectUrl, result.Status);

            var message = new StringBuilder();
            message.Append(result.ProjectName);
            message.Append(" ");

            if(String.IsNullOrEmpty(Message))
            {
                message.Append("build complete");
            }
            else
            {
                message.Append(Message);
            }

            message.Append(" ");

            if(displayDuration)
            {
                message.AppendFormat("(duration {0})", duration);
            }

            message.Append(". ");

            if(!HideResult)
            {
                message.AppendFormat("Result: {0}.", link);
            }

            var notify = result.Succeeded;
            var color = result.Succeeded ? HipChatClient.BackgroundColor.green : HipChatClient.BackgroundColor.red;

            if(HideResult)
            {
                color = HipChatClient.BackgroundColor.yellow;
            }

            var client = new HipChatClient(AuthToken, RoomId, From);
            client.SendMessage(message.ToString(), color, notify);
        }
开发者ID:tekmaven,项目名称:ccnet-hipchat-plugin,代码行数:49,代码来源:HipChatPublisher.cs


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