-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdditionalInfoItem.cs
More file actions
625 lines (581 loc) · 13.5 KB
/
AdditionalInfoItem.cs
File metadata and controls
625 lines (581 loc) · 13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
using System;
using System.Runtime.CompilerServices;
using System.Xml.Linq;
using _003CPrivateImplementationDetails_003E_007B32439FAB_002DE055_002D4B6F_002D932A_002DAD6005671EA2_007D;
using ProtoBuf;
using TradingPlatform.BusinessLayer.Integration;
using TradingPlatform.BusinessLayer.Serialization;
namespace TradingPlatform.BusinessLayer;
/// <summary>
/// The additional info item.
/// </summary>
[ProtoContract]
public class AdditionalInfoItem : ICloneable, IXElementSerialization, IEquatable<AdditionalInfoItem>
{
[CompilerGenerated]
private string 녞놌;
[CompilerGenerated]
private string 녞놕;
[CompilerGenerated]
private int 녞뇊;
[CompilerGenerated]
private string 녞놋;
[CompilerGenerated]
private string 녞녣;
[CompilerGenerated]
private ComparingType 녞녩;
[CompilerGenerated]
private object 녞놤;
[CompilerGenerated]
private bool 녞논;
[CompilerGenerated]
private AdditionalInfoItemFormatingType 녞녘;
[CompilerGenerated]
private string 녞노;
[CompilerGenerated]
private bool 녞녒;
[CompilerGenerated]
private bool 녞녕;
[CompilerGenerated]
private EditingInfo 녞녖;
[CompilerGenerated]
private IFormattingDescription 놫녴;
/// <summary>
/// ключ для апи, обязательно для заполнения и должен быть уникальным
/// </summary>
[ProtoMember(1)]
public string Id
{
[CompilerGenerated]
get
{
return 녞놌;
}
[CompilerGenerated]
set
{
녞놌 = value;
}
}
/// <summary>
/// Gets or Sets the group info.
/// </summary>
[ProtoMember(2)]
public string GroupInfo
{
[CompilerGenerated]
get
{
return 녞놕;
}
[CompilerGenerated]
set
{
녞놕 = value;
}
}
/// <summary>
/// Gets or Sets the sort index.
/// </summary>
[ProtoMember(3)]
public int SortIndex
{
[CompilerGenerated]
get
{
return 녞뇊;
}
[CompilerGenerated]
set
{
녞뇊 = value;
}
}
/// <summary>
/// Gets or Sets the name key.
/// </summary>
[ProtoMember(4)]
public string NameKey
{
[CompilerGenerated]
get
{
return 녞놋;
}
[CompilerGenerated]
set
{
녞놋 = value;
}
}
/// <summary>
/// Gets or Sets the tool tip key.
/// </summary>
[ProtoMember(5)]
public string ToolTipKey
{
[CompilerGenerated]
get
{
return 녞녣;
}
[CompilerGenerated]
set
{
녞녣 = value;
}
}
/// <summary>
/// Gets or Sets the data type.
/// </summary>
[ProtoMember(6)]
public ComparingType DataType
{
[CompilerGenerated]
get
{
return 녞녩;
}
[CompilerGenerated]
set
{
녞녩 = value;
}
}
/// <summary>
/// Gets or Sets the value.
/// </summary>
[ProtoIgnore]
public object Value
{
[CompilerGenerated]
get
{
return 녞놤;
}
[CompilerGenerated]
set
{
녞놤 = value;
}
}
/// <summary>
/// Gets or Sets a value indicating whether hidden.
/// </summary>
[ProtoMember(7)]
public bool Hidden
{
[CompilerGenerated]
get
{
return 녞논;
}
[CompilerGenerated]
set
{
녞논 = value;
}
}
/// <summary>
/// Gets or Sets the formating type.
/// </summary>
[ProtoMember(8)]
public AdditionalInfoItemFormatingType FormatingType
{
[CompilerGenerated]
get
{
return 녞녘;
}
[CompilerGenerated]
set
{
녞녘 = value;
}
}
/// <summary>
/// используется в связке с AccountAdditionalInfoItemFormatingType.CustomAsset для форматирования в заданном ассете
/// </summary>
[ProtoMember(9)]
public string CustomAssetID
{
[CompilerGenerated]
get
{
return 녞노;
}
[CompilerGenerated]
set
{
녞노 = value;
}
}
/// <summary>
/// Gets or Sets a value indicating whether visible.
/// </summary>
[ProtoMember(10)]
public bool Visible
{
[CompilerGenerated]
get
{
return 녞녒;
}
[CompilerGenerated]
set
{
녞녒 = value;
}
}
/// <summary>
/// Gets or Sets a value indicating whether is link.
/// </summary>
[ProtoMember(11)]
public bool IsLink
{
[CompilerGenerated]
get
{
return 녞녕;
}
[CompilerGenerated]
set
{
녞녕 = value;
}
}
[ProtoMember(12, IsRequired = false)]
private string ProtoDynamicPropertySurrogateString
{
get
{
if (DataType != 0)
{
return null;
}
return (string)Value;
}
set
{
if (DataType == ComparingType.String && value != null)
{
Value = value;
}
}
}
[ProtoMember(13, IsRequired = false)]
private int? ProtoDynamicPropertySurrogateInt
{
get
{
if (DataType != ComparingType.Int)
{
return null;
}
return (int)Value;
}
set
{
if (DataType == ComparingType.Int && value.HasValue)
{
Value = value;
}
}
}
[ProtoMember(14, IsRequired = false)]
private double? ProtoDynamicPropertySurrogateDouble
{
get
{
if (DataType != ComparingType.Double)
{
return null;
}
return (double)Value;
}
set
{
if (DataType == ComparingType.Double && value.HasValue)
{
Value = value;
}
}
}
[ProtoMember(15, IsRequired = false)]
private long? ProtoDynamicPropertySurrogateLong
{
get
{
if (DataType != ComparingType.Long)
{
return null;
}
return (long)Value;
}
set
{
if (DataType == ComparingType.Long && value.HasValue)
{
Value = value;
}
}
}
[ProtoMember(16, IsRequired = false)]
private DateTime? ProtoDynamicPropertySurrogateDateTime
{
get
{
if (DataType != ComparingType.DateTime)
{
return null;
}
return (DateTime)Value;
}
set
{
if (DataType == ComparingType.DateTime && value.HasValue)
{
Value = value;
}
}
}
[ProtoMember(17, IsRequired = false)]
private bool? ProtoDynamicPropertySurrogateBoolean
{
get
{
if (DataType != ComparingType.Boolean)
{
return null;
}
return (bool)Value;
}
set
{
if (DataType == ComparingType.Boolean && value.HasValue)
{
Value = value;
}
}
}
/// <summary>
/// Gets or Sets the editing info.
/// </summary>
public EditingInfo EditingInfo
{
[CompilerGenerated]
get
{
return 녞녖;
}
[CompilerGenerated]
set
{
녞녖 = value;
}
}
/// <summary>
/// Gets or Sets the formatting description.
/// </summary>
public IFormattingDescription FormattingDescription
{
[CompilerGenerated]
get
{
return 놫녴;
}
[CompilerGenerated]
set
{
놫녴 = value;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="T:TradingPlatform.BusinessLayer.AdditionalInfoItem" /> class.
/// </summary>
public AdditionalInfoItem()
{
Visible = true;
}
/// <summary>
///
/// </summary>
/// <param name="item">The item.</param>
public virtual void Update(AdditionalInfoItem item)
{
GroupInfo = item.GroupInfo;
SortIndex = item.SortIndex;
NameKey = item.NameKey;
ToolTipKey = item.ToolTipKey;
DataType = item.DataType;
Value = item.Value;
Hidden = item.Hidden;
Visible = item.Visible;
IsLink = item.IsLink;
Id = item.Id;
FormatingType = item.FormatingType;
CustomAssetID = item.CustomAssetID;
EditingInfo = ((item.EditingInfo == null) ? null : new EditingInfo(item.EditingInfo));
FormattingDescription = item.FormattingDescription;
}
/// <summary>
///
/// </summary>
/// <returns>An object.</returns>
public object Clone()
{
AdditionalInfoItem additionalInfoItem = new AdditionalInfoItem();
additionalInfoItem.Update(this);
return additionalInfoItem;
}
/// <summary>
/// To the XML element.
/// </summary>
/// <returns>A XElement.</returns>
public XElement ToXElement()
{
XElement xElement = new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놁());
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녭(), Id));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녱(), GroupInfo));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놲(), SortIndex));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶높(), NameKey));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놶(), ToolTipKey));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶뇏(), (int)DataType));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.놴놯(), Value));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.놥(), Hidden));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녻(), (int)FormatingType));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녙(), CustomAssetID));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놢(), Visible));
xElement.Add(new XElement(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녧(), IsLink));
return xElement;
}
/// <summary>
/// From the XML element.
/// </summary>
/// <param name="element">The element.</param>
/// <param name="deserializationInfo">The deserialization info.</param>
public void FromXElement(XElement element, DeserializationInfo deserializationInfo)
{
XElement xElement = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녭());
if (xElement != null)
{
Id = xElement.Value;
}
XElement xElement2 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녱());
if (xElement2 != null)
{
GroupInfo = xElement2.Value;
}
XElement xElement3 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놲());
if (xElement3 != null)
{
SortIndex = xElement3.ToInt();
}
XElement xElement4 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶높());
if (xElement4 != null)
{
NameKey = xElement4.Value;
}
XElement xElement5 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놶());
if (xElement5 != null)
{
ToolTipKey = xElement5.Value;
}
XElement xElement6 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶뇏());
if (xElement6 != null)
{
DataType = (ComparingType)xElement6.ToInt();
}
XElement xElement7 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.놴놯());
if (xElement7 != null)
{
Value = DataType switch
{
ComparingType.Int => xElement7.ToInt(),
ComparingType.Double => xElement7.ToDouble(),
ComparingType.Long => xElement7.ToLong(),
ComparingType.DateTime => xElement7.ToDateTime(),
ComparingType.Boolean => xElement7.ToBool(),
_ => xElement7.Value,
};
}
XElement xElement8 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.놥());
if (xElement8 != null)
{
Hidden = xElement8.ToBool();
}
XElement xElement9 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녻());
if (xElement9 != null)
{
FormatingType = (AdditionalInfoItemFormatingType)xElement9.ToInt();
}
XElement xElement10 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녙());
if (xElement10 != null)
{
CustomAssetID = xElement10.Value;
}
XElement xElement11 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놢());
if (xElement11 != null)
{
Visible = xElement11.ToBool();
}
XElement xElement12 = element.Element(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녧());
if (xElement12 != null)
{
IsLink = xElement12.ToBool();
}
}
/// <summary>
/// To the string.
/// </summary>
/// <returns>A string.</returns>
public override string ToString()
{
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(38, 4);
defaultInterpolatedStringHandler.AppendLiteral(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶녤());
defaultInterpolatedStringHandler.AppendFormatted(Id);
defaultInterpolatedStringHandler.AppendLiteral(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놆());
defaultInterpolatedStringHandler.AppendFormatted(GroupInfo);
defaultInterpolatedStringHandler.AppendLiteral(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶뇎());
defaultInterpolatedStringHandler.AppendFormatted(Visible);
defaultInterpolatedStringHandler.AppendLiteral(_26195AC7_002DD65B_002D4910_002DB963_002D637D18805E71.녶놷());
defaultInterpolatedStringHandler.AppendFormatted(Hidden);
return defaultInterpolatedStringHandler.ToStringAndClear();
}
public bool Equals(AdditionalInfoItem other)
{
if (other == null)
{
return false;
}
if (this == other)
{
return true;
}
if (NameKey == other.NameKey)
{
return object.Equals(Value, other.Value);
}
return false;
}
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
if (this == obj)
{
return true;
}
if (obj.GetType() != GetType())
{
return false;
}
return Equals((AdditionalInfoItem)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(NameKey, Value);
}
}