mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-06 11:32:59 +00:00
Enum
This commit is contained in:
parent
443623d8df
commit
5991cec92d
@ -1181,10 +1181,20 @@ namespace Esyur.Data
|
||||
//else
|
||||
// return (DataType.Void, null);
|
||||
else if (value is DistributedPropertyContext)
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (connection != null)
|
||||
value = (value as DistributedPropertyContext).Method(connection);
|
||||
//else
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Global.Log(ex);
|
||||
return (DataType.Void, null);
|
||||
}
|
||||
// return (DataType.Void, null);
|
||||
}
|
||||
|
||||
if (value == null)
|
||||
return (DataType.Void, null);
|
||||
@ -1208,10 +1218,27 @@ namespace Esyur.Data
|
||||
var isArray = t.IsArray;
|
||||
|
||||
if (isArray)
|
||||
{
|
||||
t = t.GetElementType();
|
||||
if (t.IsEnum)
|
||||
{
|
||||
var src = value as Array;
|
||||
t = t.GetEnumUnderlyingType();
|
||||
var dst = Array.CreateInstance(t, src.Length);
|
||||
src.CopyTo(dst, 0);
|
||||
value = dst;
|
||||
}
|
||||
}
|
||||
else if (t.IsEnum)
|
||||
{
|
||||
t = t.GetEnumUnderlyingType();
|
||||
value = Convert.ChangeType(value, t);
|
||||
}
|
||||
|
||||
DataType type;
|
||||
|
||||
|
||||
|
||||
if (t == typeof(bool))
|
||||
type = DataType.Bool;
|
||||
else if (t == typeof(char))
|
||||
|
@ -268,8 +268,10 @@ namespace Esyur.Net.HTTP
|
||||
if ((fileEditTime - ims).TotalSeconds < 2)
|
||||
{
|
||||
Response.Number = HTTPResponsePacket.ResponseCode.NotModified;
|
||||
Response.Headers.Clear();
|
||||
//Response.Text = "Not Modified";
|
||||
Send((byte[])null);
|
||||
Send(HTTPResponsePacket.ComposeOptions.SpecifiedHeadersOnly);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
@ -139,8 +139,8 @@ namespace Esyur.Net.Packets
|
||||
{
|
||||
string header = $"{Version} {(int)Number} {Text}\r\nServer: Esyur {Global.Version}\r\nDate: {DateTime.Now.ToUniversalTime().ToString("r")}\r\n";
|
||||
|
||||
if (options == ComposeOptions.AllCalculateLength && Message != null)
|
||||
Headers["Content-Length"] = Message.Length.ToString();
|
||||
if (options == ComposeOptions.AllCalculateLength)
|
||||
Headers["Content-Length"] = Message?.Length.ToString() ?? "0";
|
||||
|
||||
foreach (var kv in Headers)
|
||||
header += kv.Key + ": " + kv.Value + "\r\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user