Skip to content

Commit 0bf5817

Browse files
committed
update 0.94
1 parent 4b5336d commit 0bf5817

16 files changed

+402
-225
lines changed

README.md

Lines changed: 220 additions & 103 deletions
Large diffs are not rendered by default.

README_CN.md

Lines changed: 80 additions & 114 deletions
Large diffs are not rendered by default.

dolphindb_csharpapi/DBConnection.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ public virtual IEntity run(string script, ProgressListener listener)
375375
{
376376
login();
377377
}
378+
if (this.initialScript != "") run(initialScript);
378379
}
379380
int numObject = int.Parse(headers[1]);
380381

@@ -519,6 +520,7 @@ public virtual IEntity run(string function, IList<IEntity> arguments)
519520
{
520521
login();
521522
}
523+
if (this.initialScript != "") run(initialScript);
522524
}
523525
int numObject = int.Parse(headers[1]);
524526

@@ -684,6 +686,7 @@ public virtual void upload(IDictionary<string, IEntity> variableObjectMap)
684686
{
685687
login();
686688
}
689+
if (this.initialScript != "") run(initialScript);
687690
}
688691
string msg = @in.readLine();
689692
if (!msg.Equals("OK"))

dolphindb_csharpapi/data/BasicDate.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ public override bool Equals(object o)
7878
return base.getValue() == ((BasicInt)o).getValue();
7979
}
8080
}
81+
82+
public override void setObject(object value)
83+
{
84+
if (value != null && value.GetType() == Type.GetType("System.DateTime"))
85+
{
86+
base.setObject(Utils.countDays(Convert.ToDateTime(value)));
87+
}
88+
}
8189
}
8290

8391
}

dolphindb_csharpapi/data/BasicDateTime.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ public override bool Equals(object o)
7979
return base.getValue() == ((BasicInt)o).getValue();
8080
}
8181
}
82+
83+
public override void setObject(object value)
84+
{
85+
if(value != null && value.GetType() == Type.GetType("System.DateTime"))
86+
{
87+
base.setObject(Utils.countSeconds(Convert.ToDateTime(value)));
88+
}
89+
}
8290
}
8391

8492
}

dolphindb_csharpapi/data/BasicMinute.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ public override bool Equals(object o)
7979
return base.getValue() == ((BasicInt)o).getValue();
8080
}
8181
}
82+
83+
public override void setObject(object value)
84+
{
85+
if (value != null && value.GetType() == Type.GetType("System.TimeSpan"))
86+
{
87+
base.setObject(Utils.countMinutes((TimeSpan)value));
88+
}
89+
}
8290
}
8391

8492
}

dolphindb_csharpapi/data/BasicMonth.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ public override bool Equals(object o)
8585
return base.getValue() == ((BasicInt)o).getValue();
8686
}
8787
}
88+
89+
public override void setObject(object value)
90+
{
91+
if (value != null && value.GetType() == Type.GetType("System.DateTime"))
92+
{
93+
var v = (DateTime)value;
94+
base.setObject(v.Year * 12 + v.Month - 1);
95+
}
96+
}
8897
}
8998

9099
}

dolphindb_csharpapi/data/BasicNanoTime.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class BasicNanoTime : BasicLong
88
{
99
private static string format = "c";
1010

11-
public BasicNanoTime(DateTime value) : base(Utils.countNanoseconds(value))
11+
public BasicNanoTime(TimeSpan value) : base(Utils.countNanoseconds(value))
1212
{
1313
}
1414

@@ -80,6 +80,14 @@ public override bool Equals(object o)
8080
return base.getValue() == ((BasicLong)o).getValue();
8181
}
8282
}
83+
84+
public override void setObject(object value)
85+
{
86+
if (value != null && value.GetType() == Type.GetType("System.TimeSpan"))
87+
{
88+
base.setObject(Utils.countNanoseconds((TimeSpan)value));
89+
}
90+
}
8391
}
8492

8593
}

dolphindb_csharpapi/data/BasicNanoTimestamp.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ public override bool Equals(object o)
7777
return base.getValue() == ((BasicLong)o).getValue();
7878
}
7979
}
80+
81+
public override void setObject(object value)
82+
{
83+
if (value != null && value.GetType() == Type.GetType("System.DateTime"))
84+
{
85+
base.setObject(Utils.countNanoseconds(Convert.ToDateTime(value)));
86+
}
87+
}
8088
}
8189

8290
}

dolphindb_csharpapi/data/BasicSecond.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ public override bool Equals(object o)
8181
return base.getValue() == ((BasicInt)o).getValue();
8282
}
8383
}
84-
}
84+
85+
public override void setObject(object value)
86+
{
87+
if (value != null && value.GetType() == Type.GetType("System.TimeSpan"))
88+
{
89+
base.setObject(Utils.countSeconds((TimeSpan)value));
90+
}
91+
}
92+
}
8593

8694
}

0 commit comments

Comments
 (0)