Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My first commit #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified code/iStepPhone/.vs/iStepPhone/v14/.suo
Binary file not shown.
27 changes: 27 additions & 0 deletions code/iStepPhone/Menu/Menu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iStepPhone.Menu
{
public class Menu
{
public string[] item;
public Menu()
{
item = new string[8] {
"Address Book",
"SMS",
"Organizer",
"Playmarket",
"XO",
"Snake",
"File Manager",
"API Checker"
};
}
}
}

190 changes: 190 additions & 0 deletions code/iStepPhone/Menu/MenuRender.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace iStepPhone.Menu
{
class Test
{
public void Start()
{
Console.WriteLine("Scooby-doo");
}
}
public static class MenuRender
{
public enum HighLight { AdressBook, Sms, Organizer, Playmarket, XO, Snake, FileManager, ApiChecker };
public static List<string> menuItems = new List<string>();

static void HightLightRow()
{
Console.ForegroundColor = ConsoleColor.Green;
}
static void DontHightLightRow()
{
Console.ForegroundColor = ConsoleColor.White;
}

public static void Read()
{
Type t = typeof(Test);

var doc = XDocument.Load(@"D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\config.xml");

foreach (var element in doc.Element("menu").Elements("menuItem"))
{
var method = t.GetMethod(element.Element("methodToCall").Value); //узнаем метод, который надо вызвать
method.Invoke(new Test(), null); // вызываем на объекте new Test(), null - это спискок параметров, которые принимает метод

menuItems.Add(element.Element("name").Value);
}
}

static HighLight ChangeSelectRow(HighLight position)
{
HighLight MinRow = HighLight.AdressBook;
HighLight MaxRow = HighLight.ApiChecker;
return (position > MaxRow) ? MinRow : (position < MinRow) ? MaxRow : position;
}

public static HighLight SelectMenu(string[] item)
{
HighLight position = 0;

do
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\t\t iStepPhone");
DontHightLightRow();



switch (position)
{
case HighLight.AdressBook:
HightLightRow();
Console.WriteLine(item[(int)HighLight.AdressBook]);
DontHightLightRow();
Console.WriteLine(item[(int)HighLight.Sms]);
Console.WriteLine(item[(int)HighLight.Organizer]);
Console.WriteLine(item[(int)HighLight.Playmarket]);
Console.WriteLine(item[(int)HighLight.XO]);
Console.WriteLine(item[(int)HighLight.Snake]);
Console.WriteLine(item[(int)HighLight.FileManager]);
Console.WriteLine(item[(int)HighLight.ApiChecker]);
break;
case HighLight.Sms:
Console.WriteLine(item[(int)HighLight.AdressBook]);
HightLightRow();
Console.WriteLine(item[(int)HighLight.Sms]);
DontHightLightRow();
Console.WriteLine(item[(int)HighLight.Organizer]);
Console.WriteLine(item[(int)HighLight.Playmarket]);
Console.WriteLine(item[(int)HighLight.XO]);
Console.WriteLine(item[(int)HighLight.Snake]);
Console.WriteLine(item[(int)HighLight.FileManager]);
Console.WriteLine(item[(int)HighLight.ApiChecker]);
break;
case HighLight.Organizer:
Console.WriteLine(item[(int)HighLight.AdressBook]);
Console.WriteLine(item[(int)HighLight.Sms]);
HightLightRow();
Console.WriteLine(item[(int)HighLight.Organizer]);
DontHightLightRow();
Console.WriteLine(item[(int)HighLight.Playmarket]);
Console.WriteLine(item[(int)HighLight.XO]);
Console.WriteLine(item[(int)HighLight.Snake]);
Console.WriteLine(item[(int)HighLight.FileManager]);
Console.WriteLine(item[(int)HighLight.ApiChecker]);
break;
case HighLight.Playmarket:
Console.WriteLine(item[(int)HighLight.AdressBook]);
Console.WriteLine(item[(int)HighLight.Sms]);
Console.WriteLine(item[(int)HighLight.Organizer]);
HightLightRow();
Console.WriteLine(item[(int)HighLight.Playmarket]);
DontHightLightRow();
Console.WriteLine(item[(int)HighLight.XO]);
Console.WriteLine(item[(int)HighLight.Snake]);
Console.WriteLine(item[(int)HighLight.FileManager]);
Console.WriteLine(item[(int)HighLight.ApiChecker]);
break;
case HighLight.XO:
Console.WriteLine(item[(int)HighLight.AdressBook]);
Console.WriteLine(item[(int)HighLight.Sms]);
Console.WriteLine(item[(int)HighLight.Organizer]);
Console.WriteLine(item[(int)HighLight.Playmarket]);
HightLightRow();
Console.WriteLine(item[(int)HighLight.XO]);
DontHightLightRow();
Console.WriteLine(item[(int)HighLight.Snake]);
Console.WriteLine(item[(int)HighLight.FileManager]);
Console.WriteLine(item[(int)HighLight.ApiChecker]);
break;
case HighLight.Snake:
Console.WriteLine(item[(int)HighLight.AdressBook]);
Console.WriteLine(item[(int)HighLight.Sms]);
Console.WriteLine(item[(int)HighLight.Organizer]);
Console.WriteLine(item[(int)HighLight.Playmarket]);
Console.WriteLine(item[(int)HighLight.XO]);
HightLightRow();
Console.WriteLine(item[(int)HighLight.Snake]);
DontHightLightRow();
Console.WriteLine(item[(int)HighLight.FileManager]);
Console.WriteLine(item[(int)HighLight.ApiChecker]);
break;
case HighLight.FileManager:
Console.WriteLine(item[(int)HighLight.AdressBook]);
Console.WriteLine(item[(int)HighLight.Sms]);
Console.WriteLine(item[(int)HighLight.Organizer]);
Console.WriteLine(item[(int)HighLight.Playmarket]);
Console.WriteLine(item[(int)HighLight.XO]);
Console.WriteLine(item[(int)HighLight.Snake]);
HightLightRow();
Console.WriteLine(item[(int)HighLight.FileManager]);
DontHightLightRow();
Console.WriteLine(item[(int)HighLight.ApiChecker]);
break;
case HighLight.ApiChecker:
Console.WriteLine(item[(int)HighLight.AdressBook]);
Console.WriteLine(item[(int)HighLight.Sms]);
Console.WriteLine(item[(int)HighLight.Organizer]);
Console.WriteLine(item[(int)HighLight.Playmarket]);
Console.WriteLine(item[(int)HighLight.XO]);
Console.WriteLine(item[(int)HighLight.Snake]);
Console.WriteLine(item[(int)HighLight.FileManager]);
HightLightRow();
Console.WriteLine(item[(int)HighLight.ApiChecker]);
DontHightLightRow();
break;
}
Thread.Sleep(5);

var key = Console.ReadKey();
if (key.Key == ConsoleKey.DownArrow)
position++;
else if (key.Key == ConsoleKey.UpArrow)
position--;
else if (key.Key == ConsoleKey.Enter)
{
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("\t" + item[(int)position]);
DontHightLightRow();
//Console.Read();
return position;
}

position = ChangeSelectRow(position);

Console.Clear();

} while (true);
}
}
}

9 changes: 7 additions & 2 deletions code/iStepPhone/Menu/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
using System.Text;
using System.Threading.Tasks;

namespace Menu
namespace iStepPhone.Menu
{
class Program
{
static void Main(string[] args)
{

Menu menu = new Menu();
MenuRender.Read();
MenuRender.SelectMenu(MenuRender.menuItems.ToArray());



}
}
}
Binary file modified code/iStepPhone/Menu/bin/Debug/Menu.exe
Binary file not shown.
Binary file modified code/iStepPhone/Menu/bin/Debug/Menu.pdb
Binary file not shown.
Binary file modified code/iStepPhone/Menu/bin/Debug/SMS.dll
Binary file not shown.
Binary file modified code/iStepPhone/Menu/bin/Debug/SMS.pdb
Binary file not shown.
15 changes: 15 additions & 0 deletions code/iStepPhone/Menu/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<menu>
<menuItem>
<name>SMS</name>
<assemblyName>ClassLibrary1</assemblyName>
<typeName>ClassLibrary1.SMS</typeName>
<methodToCall>Start</methodToCall>
</menuItem>
<menuItem>
<name>AddressBook</name>
<assemblyName>ClassLibrary1</assemblyName>
<typeName>ClassLibrary1.SMS</typeName>
<methodToCall>Start</methodToCall>
</menuItem>
</menu>
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Menu.cs" />
<Compile Include="MenuRender.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand All @@ -55,6 +57,14 @@
<Name>SMS</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Logger\" />
<Folder Include="LoginPage\" />
<Folder Include="UserSettings\" />
</ItemGroup>
<ItemGroup>
<Content Include="config.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ C:\Users\Admin\Documents\GitHub\iStepPhone\code\iStepPhone\Menu\bin\Debug\SMS.pd
C:\Users\Admin\Documents\GitHub\iStepPhone\code\iStepPhone\Menu\obj\Debug\Menu.csprojResolveAssemblyReference.cache
C:\Users\Admin\Documents\GitHub\iStepPhone\code\iStepPhone\Menu\obj\Debug\Menu.exe
C:\Users\Admin\Documents\GitHub\iStepPhone\code\iStepPhone\Menu\obj\Debug\Menu.pdb
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\bin\Debug\Menu.exe.config
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\obj\Debug\Menu.exe
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\obj\Debug\Menu.pdb
Binary file modified code/iStepPhone/Menu/obj/Debug/Menu.exe
Binary file not shown.
Binary file modified code/iStepPhone/Menu/obj/Debug/Menu.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\bin\Debug\Menu.exe.config
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\bin\Debug\Menu.exe
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\bin\Debug\Menu.pdb
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\bin\Debug\SMS.dll
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\bin\Debug\SMS.pdb
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\obj\Debug\iStepPhone.Menu.csprojResolveAssemblyReference.cache
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\obj\Debug\Menu.exe
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\Menu\obj\Debug\Menu.pdb
Binary file not shown.
5 changes: 5 additions & 0 deletions code/iStepPhone/SMS/obj/Debug/SMS.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\SMS\bin\Debug\SMS.dll
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\SMS\bin\Debug\SMS.pdb
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\SMS\obj\Debug\SMS.csprojResolveAssemblyReference.cache
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\SMS\obj\Debug\SMS.dll
D:\Users\301-07\Documents\iStepPhone\code\iStepPhone\SMS\obj\Debug\SMS.pdb
12 changes: 12 additions & 0 deletions code/iStepPhone/iStepPhone.Abstraction/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iStepPhone.Abstraction
{
public class Class1
{
}
}
36 changes: 36 additions & 0 deletions code/iStepPhone/iStepPhone.Abstraction/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("iStepPhone.Abstraction")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("iStepPhone.Abstraction")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c12a1197-9dd9-42be-8085-fcd755675655")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading