Add cmd
This commit is contained in:
parent
e3a3880d62
commit
d1f4e69191
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
@ -8,11 +9,14 @@ namespace vr21
|
|||||||
public class Receipe
|
public class Receipe
|
||||||
{
|
{
|
||||||
public string Name;
|
public string Name;
|
||||||
|
public string Description;
|
||||||
public List<Ingredient> Ingredients;
|
public List<Ingredient> Ingredients;
|
||||||
|
public List<string> Steps;
|
||||||
|
|
||||||
public Receipe()
|
public Receipe()
|
||||||
{
|
{
|
||||||
Ingredients = new List<Ingredient>();
|
Ingredients = new List<Ingredient>();
|
||||||
|
Steps = new List<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,13 +35,32 @@ namespace vr21
|
|||||||
Receipe r = new Receipe() {Name="Supp"};
|
Receipe r = new Receipe() {Name="Supp"};
|
||||||
r.Ingredients.Add(kartul);
|
r.Ingredients.Add(kartul);
|
||||||
r.Ingredients.Add(kartul);
|
r.Ingredients.Add(kartul);
|
||||||
|
r.Steps.Add("Koori");
|
||||||
|
r.Steps.Add("Keeda");
|
||||||
List<Receipe> l = new List<Receipe>();
|
List<Receipe> l = new List<Receipe>();
|
||||||
l.Add(r);
|
l.Add(r);
|
||||||
l.Add(r);
|
l.Add(r);
|
||||||
XmlSerializer x = new XmlSerializer(l.GetType());
|
XmlSerializer x = new XmlSerializer(l.GetType());
|
||||||
x.Serialize(Console.Out, l);
|
// x.Serialize(Console.Out, l);
|
||||||
//writeReceipesInformation();
|
//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()
|
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" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="getline.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user