Options.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. Copyright 2013-2014 appPlant UG
  3. Licensed to the Apache Software Foundation (ASF) under one
  4. or more contributor license agreements. See the NOTICE file
  5. distributed with this work for additional information
  6. regarding copyright ownership. The ASF licenses this file
  7. to you under the Apache License, Version 2.0 (the
  8. "License"); you may not use this file except in compliance
  9. with the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing,
  12. software distributed under the License is distributed on an
  13. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. KIND, either express or implied. See the License for the
  15. specific language governing permissions and limitations
  16. under the License.
  17. */
  18. using System;
  19. using System.Linq;
  20. using System.Runtime.Serialization;
  21. namespace De.APPPlant.Cordova.Plugin.LocalNotification
  22. {
  23. /// <summary>
  24. /// Represents LiveTile options
  25. /// </summary>
  26. [DataContract]
  27. class Options
  28. {
  29. /// <summary>
  30. /// The Title that is displayed
  31. /// </summary>
  32. [DataMember(IsRequired = false, Name = "title")]
  33. public string Title { get; set; }
  34. /// <summary>
  35. /// The message that is displayed
  36. /// </summary>
  37. [DataMember(IsRequired = false, Name = "message")]
  38. public string Message { get; set; }
  39. /// <summary>
  40. /// Gekürzte Nachricht (alles ab dem Zeilenumbruch entfernt)
  41. /// </summary>
  42. public string ShortMessage
  43. {
  44. get
  45. {
  46. string[] separator = new string[] { "\r\n", "\n" };
  47. return Message.Split(separator, StringSplitOptions.RemoveEmptyEntries).First();
  48. }
  49. }
  50. /// <summary>
  51. /// Displays number badge to notification
  52. /// </summary>
  53. [DataMember(IsRequired = false, Name = "badge")]
  54. public int Badge { get; set; }
  55. /// <summary>
  56. /// Tile count
  57. /// </summary>
  58. [DataMember(IsRequired = false, Name = "Date")]
  59. public int Date { get; set; }
  60. /// <summary>
  61. /// Has the options of daily', 'weekly',''monthly','yearly')
  62. /// </summary>
  63. [DataMember(IsRequired = false, Name = "repeat")]
  64. public string Repeat { get; set; }
  65. /// <summary>
  66. /// Notification specific data
  67. /// </summary>
  68. [DataMember(IsRequired = false, Name = "json")]
  69. public string JSON { get; set; }
  70. /// <summary>
  71. /// Message-ID
  72. /// </summary>
  73. [DataMember(IsRequired = false, Name = "id")]
  74. public string ID { get; set; }
  75. /// <summary>
  76. /// Setting this flag will make it so the notification is automatically canceled when the user clicks it
  77. /// </summary>
  78. [DataMember(IsRequired = false, Name = "autoCancel")]
  79. public bool AutoCancel { get; set; }
  80. /// <summary>
  81. /// The notification small background image to be displayed
  82. /// </summary>
  83. [DataMember(IsRequired = false, Name = "smallImage")]
  84. public string SmallImage { get; set; }
  85. /// <summary>
  86. /// The notification background image to be displayed
  87. /// </summary>
  88. [DataMember(IsRequired = false, Name = "image")]
  89. public string Image { get; set; }
  90. /// <summary>
  91. /// The notification wide background image to be displayed
  92. /// </summary>
  93. [DataMember(IsRequired = false, Name = "wideImage")]
  94. public string WideImage { get; set; }
  95. }
  96. }