Mercurial > hg > Database > Christie-sharp
changeset 6:5c334a1fbc5e
fix blanks
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 23 Sep 2020 13:15:18 +0900 |
parents | 5f2af64540be |
children | f48a2df9da65 |
files | datagear/command/Command.cs datagear/command/CommandBuilder.cs datagear/command/CommandType.cs |
diffstat | 3 files changed, 30 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/datagear/command/Command.cs Tue Aug 25 19:05:46 2020 +0900 +++ b/datagear/command/Command.cs Wed Sep 23 13:15:18 2020 +0900 @@ -29,11 +29,11 @@ // instead of any Constoractor args protected void CheckNeedParam(ComanndBuilder cb) { - + } public abstract void Execute(); - - public abstract + + public abstract } } \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datagear/command/CommandBuilder.cs Wed Sep 23 13:15:18 2020 +0900 @@ -0,0 +1,19 @@ +using System; +namespace Christie_net.datagear.command { + public class CommandBuilder { + protected CommandType type; // need + protected string kye = null; + protected string toDgmName = null; // for take + protected string fromDgmname = "local"; // for remotetake/reply + protected int? cgmID = null; // for local meta + protected CodeGear cg = null; // for localtake + protected DataGear dg = null; // for put/localtake/reply + protected Type clazz = null; // for remote + protected Connection connection = null; // for reply + + + + public CommandBuilder() { + } + } +}
--- a/datagear/command/CommandType.cs Tue Aug 25 19:05:46 2020 +0900 +++ b/datagear/command/CommandType.cs Wed Sep 23 13:15:18 2020 +0900 @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; namespace Christie_net.datagear.command { @@ -17,8 +18,9 @@ public static Dictionary<int, CommandType> hash = new Dictionary<int, CommandType>(); private static int lastID = 0; // total command number - private CommandTypeEtx() { - this.id = id; + static CommandTypeEtx() { + StoreValues(); + id = IncrementLastID(); } private static int IncrementLastID() { @@ -29,8 +31,10 @@ return hash[id]; } - static { - for(CommandType type: CommandType.va) + public static void StoreValues() { + foreach (CommandType value in Enum.GetValues (typeof (CommandType))) { + hash.Add(Convert.ToInt32(value), value); + } } } } \ No newline at end of file