Commit 9ea05768 authored by shubham's avatar shubham

Added Calendar Module, polishing some logging text.

parent 74b50117
......@@ -25,7 +25,7 @@ namespace Personal_Insight.ComputeProduct
this.page = page;
page.enterLog("Starting work on Android_Device_Configuration_Service");
calculate_numFiles();
//calculate_numFiles();
gatherDevices();
}
......@@ -50,17 +50,19 @@ namespace Personal_Insight.ComputeProduct
lastConnection = lastConnection.Substring(0, lastConnection.IndexOf("<br/>"));
devicesList.Add(new Device(model, manufacturer, iMEI, lastConnection));
page.enterLog("["+model+","+manufacturer+","+iMEI+","+lastConnection+"]");
//page.enterLog("["+model+","+manufacturer+","+iMEI+","+lastConnection+"]");
}
page.enterLog("Logged " + devicesList.Count + " Devices!");
}
private void calculate_numFiles()
/*private void calculate_numFiles()
{
string[] files = Directory.GetFiles(googleProduct.ProductFolderPath);
googleProduct.NumItems = files.Length;
page.enterLog("Num of files: " + googleProduct.NumItems);
}
}*/
public class Device
{
......
......@@ -48,13 +48,15 @@ namespace Personal_Insight.ComputeProduct
shoppingList_list.Add(new ShoppingList(listItems, checkedItems, uncheckedItems));
//page.enterLog(listItems + "," + checkedItems + "," + uncheckedItems);
}
page.enterLog("Logged " + shoppingList_list.Count + " List Items!");
}
private void calculate_numFiles()
{
string[] files = Directory.GetFiles(googleProduct.ProductFolderPath);
/*string[] files = Directory.GetFiles(googleProduct.ProductFolderPath);
googleProduct.NumItems = files.Length;
page.enterLog("Num of files: " + googleProduct.NumItems);
page.enterLog("Num of files: " + googleProduct.NumItems);*/
}
public class ShoppingList
......
......@@ -74,18 +74,20 @@ namespace Personal_Insight.ComputeProduct
blogURL = blogName + ".blogspot.com";
blogList.Add(new Blog(blogURL, blogName, blogAdmin));
page.enterLog("Name: "+blogName+", URL: "+blogURL+", Admin: " + blogAdmin);
//page.enterLog("Name: "+blogName+", URL: "+blogURL+", Admin: " + blogAdmin);
}
}
}
page.enterLog("Logged " + blogList.Count + " Blog Sites!");
}
private void calculate_numFiles()
{
string[] dirs = Directory.GetDirectories(googleProduct.ProductFolderPath + "\\Blogs");
/*string[] dirs = Directory.GetDirectories(googleProduct.ProductFolderPath + "\\Blogs");
googleProduct.NumItems = dirs.Length;
page.enterLog("Num of blogs: " + googleProduct.NumItems);
page.enterLog("Num of blogs: " + googleProduct.NumItems);*/
}
public class Blog
......
......@@ -49,13 +49,15 @@ namespace Personal_Insight.ComputeProduct
name = name.Substring(0, name.IndexOf("<"));
bookmarks.Add(new BookMark(name, link));
page.enterLog("Name: "+ name + ", Link: " + link);
//page.enterLog("Name: "+ name + ", Link: " + link);
}
}
page.enterLog("Number of Bookmarks: "+ bookmarks.Count());
//page.enterLog("Number of Bookmarks: "+ bookmarks.Count());
}
}
page.enterLog("Logged " + bookmarks.Count + " Bookmarks!");
}
public class BookMark
......
using Galactic.Calendar.iCalendar;
using Ical.Net;
using Ical.Net.Proxies;
using Personal_Insight.Models;
using Personal_Insight.Pages;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ical.Net.CalendarComponents;
namespace Personal_Insight.ComputeProduct
{
class Calendar
{
private GoogleProductModel googleProduct;
private IntroPage_5 page;
public GoogleProductModel GoogleProduct { get => googleProduct; set => googleProduct = value; }
public List<CalendarEvent_> calendarEvents;
public Calendar()
{
}
public void startWork(IntroPage_5 page)
{
this.page = page;
page.enterLog("Starting work on Calendar");
gatherData();
}
private void gatherData()
{
calendarEvents = new List<CalendarEvent_>();
string[] files = Directory.GetFiles(googleProduct.ProductFolderPath);
foreach (String file in files)
{
String fileText = File.ReadAllText(file);
var calendar = Ical.Net.Calendar.Load(fileText);
foreach(CalendarEvent calendarEvent in calendar.Events)
{
calendarEvents.Add(new CalendarEvent_(calendarEvent.Summary, calendarEvent.Description, calendarEvent.DtStart.AsSystemLocal.ToString("ddd, dd-MMM-yyy HH:mm:ss")));
}
}
page.enterLog("Logged " + calendarEvents.Count + " calendar events!");
}
public class CalendarEvent_
{
public String eventTitle { get; set; }
public String description { get; set; }
public String eventDate { get; set; }
public CalendarEvent_(String eventTitle, String description, String eventDate)
{
this.eventTitle = eventTitle;
this.description = description;
this.eventDate = eventDate;
}
}
}
}
......@@ -273,7 +273,9 @@ namespace Personal_Insight.Models
break;
case Calendar:
productObject = new Android_Device_Configuration_Service();
productObject = new Calendar();
((Calendar)productObject).GoogleProduct = googleProductModel;
((Calendar)productObject).startWork(page);
break;
case Chrome:
......
......@@ -38,6 +38,30 @@
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\ControlzEx.3.0.2.4\lib\net462\ControlzEx.dll</HintPath>
</Reference>
<Reference Include="DDay.iCal, Version=1.0.2.575, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\DDay.iCal.1.0.2.575\lib\DDay.iCal.dll</HintPath>
</Reference>
<Reference Include="Galactic.Calendar, Version=1.3.0.499, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Galactic.Calendar.1.3.0.499\lib\Galactic.Calendar.dll</HintPath>
</Reference>
<Reference Include="Galactic.Calendar.iCalendar, Version=1.3.0.499, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Galactic.Calendar.iCalendar.1.3.0.499\lib\Galactic.Calendar.iCalendar.dll</HintPath>
</Reference>
<Reference Include="Galactic.Configuration, Version=1.3.0.499, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Galactic.Configuration.1.3.0.499\lib\Galactic.Configuration.dll</HintPath>
</Reference>
<Reference Include="Galactic.Cryptography, Version=1.3.0.499, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Galactic.Cryptography.1.3.0.499\lib\Galactic.Cryptography.dll</HintPath>
</Reference>
<Reference Include="Galactic.EventLog, Version=1.3.0.499, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Galactic.EventLog.1.3.0.499\lib\Galactic.EventLog.dll</HintPath>
</Reference>
<Reference Include="Galactic.FileSystem, Version=1.3.0.499, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Galactic.FileSystem.1.3.0.499\lib\Galactic.FileSystem.dll</HintPath>
</Reference>
<Reference Include="Ical.Net, Version=4.1.8.0, Culture=neutral, PublicKeyToken=65c0446cd019ea53, processorArchitecture=MSIL">
<HintPath>packages\Ical.Net.4.1.11\lib\net46\Ical.Net.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.6.5.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\MahApps.Metro.1.6.5\lib\net47\MahApps.Metro.dll</HintPath>
</Reference>
......@@ -56,8 +80,26 @@
<Reference Include="Microsoft.WindowsAPICodePack.ShellExtensions, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll</HintPath>
</Reference>
<Reference Include="NodaTime, Version=2.0.2.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1, processorArchitecture=MSIL">
<HintPath>packages\NodaTime.2.0.2\lib\net45\NodaTime.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Reflection, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Reflection.4.1.0\lib\net462\System.Reflection.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Reflection.TypeExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Reflection.TypeExtensions.4.1.0\lib\net462\System.Reflection.TypeExtensions.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Runtime.Serialization.Primitives, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\ControlzEx.3.0.2.4\lib\net462\System.Windows.Interactivity.dll</HintPath>
......@@ -115,6 +157,7 @@
<Compile Include="ComputeProduct\Assistant Notes and Lists.cs" />
<Compile Include="ComputeProduct\Blogger.cs" />
<Compile Include="ComputeProduct\Bookmarks.cs" />
<Compile Include="ComputeProduct\Calendar.cs" />
<Compile Include="ComputeProduct\YouTube.cs" />
<Compile Include="Models\GoogleProductModel.cs" />
<Compile Include="Models\GoogleProductsList.cs" />
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ControlzEx" version="3.0.2.4" targetFramework="net472" />
<package id="DDay.iCal" version="1.0.2.575" targetFramework="net472" />
<package id="Galactic.Calendar" version="1.3.0.499" targetFramework="net472" />
<package id="Galactic.Calendar.iCalendar" version="1.3.0.499" targetFramework="net472" />
<package id="Galactic.Configuration" version="1.3.0.499" targetFramework="net472" />
<package id="Galactic.Cryptography" version="1.3.0.499" targetFramework="net472" />
<package id="Galactic.EventLog" version="1.3.0.499" targetFramework="net472" />
<package id="Galactic.FileSystem" version="1.3.0.499" targetFramework="net472" />
<package id="Ical.Net" version="4.1.11" targetFramework="net472" />
<package id="MahApps.Metro" version="1.6.5" targetFramework="net472" />
<package id="MaterialDesignColors" version="1.1.2" targetFramework="net472" />
<package id="MaterialDesignThemes" version="2.5.1" targetFramework="net472" />
<package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.0" targetFramework="net472" />
<package id="Microsoft.WindowsAPICodePack-Shell" version="1.1.0.0" targetFramework="net472" />
<package id="NodaTime" version="2.0.2" targetFramework="net472" />
<package id="System.Reflection" version="4.1.0" targetFramework="net472" />
<package id="System.Reflection.TypeExtensions" version="4.1.0" targetFramework="net472" />
<package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net472" />
</packages>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment