This commit is contained in:
Arti Zirk 2017-02-01 18:08:40 +02:00
parent e3a3880d62
commit d1f4e69191
3 changed files with 1465 additions and 2 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -43,6 +43,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="getline.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>