Add cmd
This commit is contained in:
parent
e3a3880d62
commit
d1f4e69191
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@ -8,11 +9,14 @@ namespace vr21
|
||||
public class Receipe
|
||||
{
|
||||
public string Name;
|
||||
public string Description;
|
||||
public List<Ingredient> Ingredients;
|
||||
public List<string> Steps;
|
||||
|
||||
public Receipe()
|
||||
{
|
||||
Ingredients = new List<Ingredient>();
|
||||
Steps = new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,13 +35,32 @@ namespace vr21
|
||||
Receipe r = new Receipe() {Name="Supp"};
|
||||
r.Ingredients.Add(kartul);
|
||||
r.Ingredients.Add(kartul);
|
||||
r.Steps.Add("Koori");
|
||||
r.Steps.Add("Keeda");
|
||||
List<Receipe> l = new List<Receipe>();
|
||||
l.Add(r);
|
||||
l.Add(r);
|
||||
XmlSerializer x = new XmlSerializer(l.GetType());
|
||||
x.Serialize(Console.Out, l);
|
||||
// x.Serialize(Console.Out, l);
|
||||
//writeReceipesInformation();
|
||||
Console.ReadKey();
|
||||
|
||||
LineEditor le = new LineEditor("foo") {HeuristicsMode = "csharp"};
|
||||
string s;
|
||||
|
||||
while ((s = le.Edit("shell> ", "")) != null)
|
||||
{
|
||||
var arguments = s.Split(' ');
|
||||
var command = arguments[0].Trim();
|
||||
switch (command.ToLower())
|
||||
{
|
||||
case "list":
|
||||
Console.WriteLine("Tere");
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("No command");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void writeReceipesInformation()
|
||||
|
1439
vr21/getline.cs
Normal file
1439
vr21/getline.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -43,6 +43,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="getline.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
|
Loading…
Reference in New Issue
Block a user