Advertisement
Guest User

Untitled

a guest
Dec 10th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.ServiceModel;
  7.  
  8. namespace WcfService2
  9. {
  10. public class Service1Client : ClientBase<IService1>, IService1
  11. {
  12. public List<wpis> json(string id)
  13. {
  14. return base.Channel.json(id);
  15.  
  16. }
  17.  
  18. public void Save(wpis node)
  19. {
  20. base.Channel.Save(node);
  21.  
  22. }
  23.  
  24.  
  25.  
  26. class Program
  27. {
  28.  
  29. public wpis arrange(string str)
  30. {
  31. wpis temp = null;
  32. temp.message = str;
  33. if (temp.message.Contains("#poll"))
  34. temp.Category = "#poll";
  35. else
  36. if (temp.message.Contains("#warn"))
  37. temp.Category = "#warn";
  38. else
  39. if (temp.message.Contains("#update"))
  40. temp.Category = "#update";
  41.  
  42. if (temp.message.Contains("@john"))
  43. temp.Person = "@john";
  44. else
  45. if (temp.message.Contains("@all"))
  46. temp.Person = "@all";
  47. else
  48. if (temp.message.Contains("@all-friends"))
  49. temp.Person = "@all-friends";
  50.  
  51.  
  52. return temp;
  53.  
  54.  
  55.  
  56. }
  57. void Main(string[] args)
  58. {
  59. Service1Client client = new Service1Client();
  60. string[] log = new string[10];
  61. log[0] = "I have won #update @all ";
  62. log[1] = "I like trains #poll @john ";
  63.  
  64. log[2] = "I am sleepy #warn @all-friends ";
  65.  
  66. log[3] = "We are hungry #update @allfriends ";
  67.  
  68. log[4] = "I hate testing apps #poll @john ";
  69.  
  70. log[5] = "Just a sample stream #poll @all ";
  71.  
  72. log[6] = "Dont wanna go back #warn @all-friends";
  73.  
  74. log[7] = "I dont play #update @john";
  75.  
  76. log[8] = "Very sleepy #warn @all-friends ";
  77.  
  78. log[9] = "My name is not John #poll @john ";
  79.  
  80.  
  81. for (int i = 0; i < 10; i++)
  82. {
  83. wpis temp = arrange(log[i]);
  84. Save(arrange(log[i]));
  85. }
  86.  
  87.  
  88.  
  89.  
  90. }
  91. }
  92.  
  93.  
  94. } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement