StockSharp

Форк
0
184 строки · 4.7 Кб
1
#region S# License
2
/******************************************************************************************
3
NOTICE!!!  This program and source code is owned and licensed by
4
StockSharp, LLC, www.stocksharp.com
5
Viewing or use of this code requires your acceptance of the license
6
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
7
Removal of this comment is a violation of the license agreement.
8

9
Project: StockSharp.BusinessEntities.BusinessEntities
10
File: News.cs
11
Created: 2015, 11, 11, 2:32 PM
12

13
Copyright 2010 by StockSharp, LLC
14
*******************************************************************************************/
15
#endregion S# License
16
namespace StockSharp.BusinessEntities
17
{
18
	using System;
19
	using System.ComponentModel.DataAnnotations;
20
	using System.Runtime.Serialization;
21

22
	using Ecng.ComponentModel;
23

24
	using StockSharp.Messages;
25
	using StockSharp.Localization;
26

27
	/// <summary>
28
	/// News.
29
	/// </summary>
30
	[Serializable]
31
	[DataContract]
32
	[Display(
33
		ResourceType = typeof(LocalizedStrings),
34
		Name = LocalizedStrings.NewsKey,
35
		Description = LocalizedStrings.NewsDescKey)]
36
	public class News : NotifiableObject
37
	{
38
		/// <summary>
39
		/// News ID.
40
		/// </summary>
41
		[DataMember]
42
		[Display(
43
			ResourceType = typeof(LocalizedStrings),
44
			Name = LocalizedStrings.IdKey,
45
			Description = LocalizedStrings.NewsIdKey,
46
			GroupName = LocalizedStrings.GeneralKey)]
47
		public string Id { get; set; }
48

49
		/// <summary>
50
		/// Exchange board for which the news is published.
51
		/// </summary>
52
		[DataMember]
53
		[Display(
54
			ResourceType = typeof(LocalizedStrings),
55
			Name = LocalizedStrings.BoardKey,
56
			Description = LocalizedStrings.ElectronicBoardDescKey,
57
			GroupName = LocalizedStrings.GeneralKey)]
58
		public ExchangeBoard Board { get; set; }
59

60
		/// <summary>
61
		/// Security, for which news have been published.
62
		/// </summary>
63
		[DataMember]
64
		[Display(
65
			ResourceType = typeof(LocalizedStrings),
66
			Name = LocalizedStrings.SecurityKey,
67
			Description = LocalizedStrings.NewsSecurityKey,
68
			GroupName = LocalizedStrings.GeneralKey)]
69
		public Security Security { get; set; }
70

71
		/// <summary>
72
		/// News source.
73
		/// </summary>
74
		[DataMember]
75
		[Display(
76
			ResourceType = typeof(LocalizedStrings),
77
			Name = LocalizedStrings.SourceKey,
78
			Description = LocalizedStrings.NewsSourceKey,
79
			GroupName = LocalizedStrings.GeneralKey)]
80
		public string Source { get; set; }
81

82
		/// <summary>
83
		/// Header.
84
		/// </summary>
85
		[DataMember]
86
		[Display(
87
			ResourceType = typeof(LocalizedStrings),
88
			Name = LocalizedStrings.HeaderKey,
89
			Description = LocalizedStrings.HeaderKey + LocalizedStrings.Dot,
90
			GroupName = LocalizedStrings.GeneralKey)]
91
		public string Headline { get; set; }
92

93
		private string _story;
94

95
		/// <summary>
96
		/// News text.
97
		/// </summary>
98
		[DataMember]
99
		[Display(
100
			ResourceType = typeof(LocalizedStrings),
101
			Name = LocalizedStrings.TextKey,
102
			Description = LocalizedStrings.NewsTextKey,
103
			GroupName = LocalizedStrings.GeneralKey)]
104
		public string Story
105
		{
106
			get => _story;
107
			set
108
			{
109
				_story = value;
110
				NotifyChanged();
111
			}
112
		}
113

114
		/// <summary>
115
		/// Time of news arrival.
116
		/// </summary>
117
		[DataMember]
118
		[Display(
119
			ResourceType = typeof(LocalizedStrings),
120
			Name = LocalizedStrings.TimeKey,
121
			Description = LocalizedStrings.NewsTimeKey,
122
			GroupName = LocalizedStrings.GeneralKey)]
123
		public DateTimeOffset ServerTime { get; set; }
124

125
		/// <summary>
126
		/// News received local time.
127
		/// </summary>
128
		[DataMember]
129
		[Display(
130
			ResourceType = typeof(LocalizedStrings),
131
			Name = LocalizedStrings.LocalTimeKey,
132
			Description = LocalizedStrings.LocalTimeDescKey,
133
			GroupName = LocalizedStrings.GeneralKey)]
134
		public DateTimeOffset LocalTime { get; set; }
135

136
		/// <summary>
137
		/// News link in the internet.
138
		/// </summary>
139
		[DataMember]
140
		[Display(
141
			ResourceType = typeof(LocalizedStrings),
142
			Name = LocalizedStrings.LinkKey,
143
			Description = LocalizedStrings.NewsLinkKey,
144
			GroupName = LocalizedStrings.GeneralKey)]
145
		//[Url]
146
		public string Url { get; set; }
147

148
		/// <summary>
149
		/// News priority.
150
		/// </summary>
151
		[DataMember]
152
		[Display(
153
			ResourceType = typeof(LocalizedStrings),
154
			Name = LocalizedStrings.PriorityKey,
155
			Description = LocalizedStrings.NewsPriorityKey,
156
			GroupName = LocalizedStrings.GeneralKey)]
157
		public NewsPriorities? Priority { get; set; }
158

159
		/// <summary>
160
		/// Language.
161
		/// </summary>
162
		[DataMember]
163
		public string Language { get; set; }
164

165
		/// <summary>
166
		/// Expiration date.
167
		/// </summary>
168
		[DataMember]
169
		public DateTimeOffset? ExpiryDate { get; set; }
170

171
		/// <summary>
172
		/// Sequence number.
173
		/// </summary>
174
		/// <remarks>Zero means no information.</remarks>
175
		[DataMember]
176
		public long SeqNum { get; set; }
177

178
		/// <inheritdoc />
179
		public override string ToString()
180
		{
181
			return $"{ServerTime} {Headline} {Story} {Source}";
182
		}
183
	}
184
}

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.