forked from ahyahy/OneScriptForms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoldedDates.cs
More file actions
47 lines (41 loc) · 1.37 KB
/
BoldedDates.cs
File metadata and controls
47 lines (41 loc) · 1.37 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
using System;
using ScriptEngine.Machine.Contexts;
using ScriptEngine.Machine;
namespace osf
{
[ContextClass ("КлВыделенныеДаты", "ClBoldedDates")]
public class ClBoldedDates : AutoContext<ClBoldedDates>
{
public osf.MonthCalendar M_MonthCalendar;
public System.DateTime[] M_Object
{
get { return M_MonthCalendar.BoldedDates; }
set { M_MonthCalendar.BoldedDates = value; }
}
[ContextProperty("Количество", "Count")]
public int Count
{
get { return M_Object.Length; }
}
[ContextMethod("Добавить", "Add")]
public IValue Add(IValue p1)
{
DateTime[] DateTime2 = new DateTime[M_Object.Length + 1];
M_Object.CopyTo(DateTime2, 0);
System.DateTime p2 = p1.AsDate();
DateTime2[M_Object.Length] = new System.DateTime(p2.Year, p2.Month, p2.Day, p2.Hour, p2.Minute, p2.Second);
M_Object = DateTime2;
return p1;
}
[ContextMethod("Очистить", "Clear")]
public void Clear()
{
M_Object = new DateTime[0];
}
[ContextMethod("Элемент", "Item")]
public IValue Item(int p1)
{
return ValueFactory.Create(M_Object[p1]);
}
}
}