Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
sinnedpenguin authored May 12, 2023
1 parent 85cde42 commit 9330901
Show file tree
Hide file tree
Showing 50 changed files with 559 additions and 0 deletions.
25 changes: 25 additions & 0 deletions What-ToDo.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33627.172
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "What-ToDo", "What-ToDo\What-ToDo.csproj", "{8F7DA7DE-96C0-4DD8-B243-27D431E70AA6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F7DA7DE-96C0-4DD8-B243-27D431E70AA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F7DA7DE-96C0-4DD8-B243-27D431E70AA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F7DA7DE-96C0-4DD8-B243-27D431E70AA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F7DA7DE-96C0-4DD8-B243-27D431E70AA6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7AD9F7FA-9E4A-446B-A222-90C0AE132746}
EndGlobalSection
EndGlobal
170 changes: 170 additions & 0 deletions What-ToDo/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.IO;

class Program
{
static void Main(string[] args)
{
// Tasks list
List<string> tasks = new List<string>();
// Load the list of tasks from the txt file
if (File.Exists("tasks.txt"))
{
string[] lines = File.ReadAllLines("tasks.txt");
tasks = new List<string>(lines);
}

// Main loop
while (true)
{
DisplayTasks(); // Display current tasks
Console.WriteLine("1. Add a task");
Console.WriteLine("2. Edit a task");
Console.WriteLine("3. Mark a task as completed");
Console.WriteLine("4. Delete a task");
Console.WriteLine("5. Exit");
Console.Write("Option: ");
string userInput = Console.ReadLine();

switch (userInput)
{
// Add a task
case "1":
Console.Write("Enter a task: ");
string task = Console.ReadLine();
tasks.Add(task);
Console.WriteLine("**************************************");
Console.WriteLine("Task added!");
// Save the list of tasks to the txt file
File.WriteAllText("tasks.txt", string.Join("\n", tasks));
break;

// Edit a task
case "2":
DisplayTasks();
Console.Write("Select a task to edit: ");
int editIndex;
while (true)
{
// Validate the user input
bool isValidEditIndex = int.TryParse(Console.ReadLine(), out editIndex); // Check if the user input is an integer
if (!isValidEditIndex || editIndex < 1 || editIndex > tasks.Count) // Check if the user input is equal to the task number
{
Console.WriteLine("**************************************");
Console.WriteLine("Invalid task number!");
DisplayTasks();
Console.Write("Select a task to edit: ");
}
else
{
break;
}
}
// Allow user to edit the task
Console.Write("Enter new task name: ");
string newTask = Console.ReadLine();
tasks[editIndex - 1] = newTask;
Console.WriteLine("**************************************");
Console.WriteLine("Task edited!");
// Update the list of tasks on the txt file
File.WriteAllText("tasks.txt", string.Join("\n", tasks));
break;

// Mark a task as completed
case "3":
DisplayTasks();
Console.Write("Select a task to mark as completed: ");
int completeIndex;
while (true)
{
bool isValidCompleteIndex = int.TryParse(Console.ReadLine(),out completeIndex);
if (!isValidCompleteIndex || completeIndex < 1 || completeIndex > tasks.Count)
{
Console.WriteLine("**************************************");
Console.WriteLine("Invalid task number!");
DisplayTasks();
Console.Write("Select a task to mark as completed: ");
}
else
{
break;
}
}
string completedTask = tasks[completeIndex - 1] + " (COMPLETED)";
tasks[completeIndex - 1] = completedTask;
Console.WriteLine("**************************************");
Console.WriteLine("Task marked as completed!");
File.WriteAllText("tasks.txt", string.Join("\n", tasks));
break;

// Delete a task
case "4":
DisplayTasks();
Console.Write("Select a task to delete: ");
int deleteIndex;
while (true)
{
bool isValidDeleteIndex = int.TryParse(Console.ReadLine(), out deleteIndex);
if (!isValidDeleteIndex || deleteIndex < 1 || deleteIndex > tasks.Count)
{
Console.WriteLine("**************************************");
Console.WriteLine("Invalid task number!");
DisplayTasks();
Console.Write("Select a task to delete: ");
}
else
{
break;
}
}
tasks.RemoveAt(deleteIndex - 1);
Console.WriteLine("**************************************");
Console.WriteLine("Task deleted!");
File.WriteAllText("tasks.txt", string.Join("\n", tasks));
break;

// Exit the app
case "5":
while (true)
{
Console.Write("Are you sure? (y/n): ");
string confirmExit = Console.ReadLine().ToLower();
if (confirmExit != "y" && confirmExit != "n")
{
Console.WriteLine("Invalid input!");
}
else if (confirmExit == "y")
{
Console.WriteLine("**************************************");
Console.WriteLine("Exiting...");
Console.WriteLine("**************************************");
Environment.Exit(0);
}
else if (confirmExit == "n")
{
Console.WriteLine("**************************************");
break;
}
}
break;

default:
Console.WriteLine("**************************************");
Console.WriteLine("Invalid input!");
break;
}
}
// Display tasks function
void DisplayTasks()
{
Console.WriteLine("**************************************");
Console.WriteLine("TASKS:");
for (int i = 0; i < tasks.Count; i++)
{
Console.WriteLine($"{i + 1}. {tasks[i]}");
}
Console.WriteLine("**************************************");
}
}
}
11 changes: 11 additions & 0 deletions What-ToDo/What-ToDo.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>What_ToDo</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
23 changes: 23 additions & 0 deletions What-ToDo/bin/Debug/net6.0/What-ToDo.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"What-ToDo/1.0.0": {
"runtime": {
"What-ToDo.dll": {}
}
}
}
},
"libraries": {
"What-ToDo/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
Binary file added What-ToDo/bin/Debug/net6.0/What-ToDo.dll
Binary file not shown.
Binary file added What-ToDo/bin/Debug/net6.0/What-ToDo.exe
Binary file not shown.
Binary file added What-ToDo/bin/Debug/net6.0/What-ToDo.pdb
Binary file not shown.
9 changes: 9 additions & 0 deletions What-ToDo/bin/Debug/net6.0/What-ToDo.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
}
}
}
23 changes: 23 additions & 0 deletions What-ToDo/bin/Release/net6.0/What-ToDo.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"What-ToDo/1.0.0": {
"runtime": {
"What-ToDo.dll": {}
}
}
}
},
"libraries": {
"What-ToDo/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
Binary file added What-ToDo/bin/Release/net6.0/What-ToDo.dll
Binary file not shown.
Binary file added What-ToDo/bin/Release/net6.0/What-ToDo.exe
Binary file not shown.
Binary file added What-ToDo/bin/Release/net6.0/What-ToDo.pdb
Binary file not shown.
12 changes: 12 additions & 0 deletions What-ToDo/bin/Release/net6.0/What-ToDo.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
}
23 changes: 23 additions & 0 deletions What-ToDo/obj/Debug/net6.0/What-ToDo.AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("What-ToDo")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("What-ToDo")]
[assembly: System.Reflection.AssemblyTitleAttribute("What-ToDo")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ffb0e437429daa811cc989c3e06dfeb0f1e51787
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = What_ToDo
build_property.ProjectDir = C:\Users\densyo\source\repos\What-ToDo\What-ToDo\
8 changes: 8 additions & 0 deletions What-ToDo/obj/Debug/net6.0/What-ToDo.GlobalUsings.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
Binary file added What-ToDo/obj/Debug/net6.0/What-ToDo.assets.cache
Binary file not shown.
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5039738e27d4a6aca2abebbea768107b8cc522d7
15 changes: 15 additions & 0 deletions What-ToDo/obj/Debug/net6.0/What-ToDo.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Debug\net6.0\What-ToDo.exe
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Debug\net6.0\What-ToDo.deps.json
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Debug\net6.0\What-ToDo.runtimeconfig.json
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Debug\net6.0\What-ToDo.dll
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Debug\net6.0\What-ToDo.pdb
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\What-ToDo.csproj.AssemblyReference.cache
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\What-ToDo.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\What-ToDo.AssemblyInfoInputs.cache
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\What-ToDo.AssemblyInfo.cs
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\What-ToDo.csproj.CoreCompileInputs.cache
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\What-ToDo.dll
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\refint\What-ToDo.dll
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\What-ToDo.pdb
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\What-ToDo.genruntimeconfig.cache
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\obj\Debug\net6.0\ref\What-ToDo.dll
Binary file added What-ToDo/obj/Debug/net6.0/What-ToDo.dll
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
92ffe0f3d15750d0611bdcf865e3c59ff9407e97
Binary file added What-ToDo/obj/Debug/net6.0/What-ToDo.pdb
Binary file not shown.
Binary file added What-ToDo/obj/Debug/net6.0/apphost.exe
Binary file not shown.
Binary file added What-ToDo/obj/Debug/net6.0/ref/What-ToDo.dll
Binary file not shown.
Binary file added What-ToDo/obj/Debug/net6.0/refint/What-ToDo.dll
Binary file not shown.
5 changes: 5 additions & 0 deletions What-ToDo/obj/Release/net6.0/PublishOutputs.258b53cf2e.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
C:\Users\densyo\Desktop\What-ToDo.exe
C:\Users\densyo\Desktop\What-ToDo.dll
C:\Users\densyo\Desktop\What-ToDo.deps.json
C:\Users\densyo\Desktop\What-ToDo.runtimeconfig.json
C:\Users\densyo\Desktop\What-ToDo.pdb
5 changes: 5 additions & 0 deletions What-ToDo/obj/Release/net6.0/PublishOutputs.42f9c34931.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Release\net6.0\publish\What-ToDo.exe
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Release\net6.0\publish\What-ToDo.dll
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Release\net6.0\publish\What-ToDo.deps.json
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Release\net6.0\publish\What-ToDo.runtimeconfig.json
C:\Users\densyo\source\repos\What-ToDo\What-ToDo\bin\Release\net6.0\publish\What-ToDo.pdb
23 changes: 23 additions & 0 deletions What-ToDo/obj/Release/net6.0/What-ToDo.AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("What-ToDo")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("What-ToDo")]
[assembly: System.Reflection.AssemblyTitleAttribute("What-ToDo")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3c38bc32a4f56ee5992d8b4bf83fc8733e6806e1
Loading

0 comments on commit 9330901

Please sign in to comment.