Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Big refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
wjch-krl committed Nov 8, 2014
1 parent bc6ca49 commit bc47f14
Show file tree
Hide file tree
Showing 185 changed files with 223,893 additions and 1,355 deletions.
Binary file added ._.DS_Store
Binary file not shown.
Binary file added ._PiggyLogo_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ._PiggyLogo_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ._PiggySync
Binary file not shown.
Empty file modified .gitignore
100755 → 100644
Empty file.
Empty file modified BouncyCastle.Crypto.dll
100755 → 100644
Empty file.
Binary file added PiggyLogo.xcf
Binary file not shown.
Binary file added PiggyLogo_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
4 changes: 3 additions & 1 deletion PiggySync/PiggySync.Common/Concrete/CheckSumGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.IO;
using PiggySync.Common.Abstract;
using PiggySync.Common.Concrete;

namespace PiggySync.Core
{
Expand All @@ -9,7 +11,7 @@ public static class CheckSumGenerator

static CheckSumGenerator ()
{
generator = new MD5Generator ();
generator = new Md5Generator ();
}

public static void ChangeGenerator (ICheckSumGenerator generator)
Expand Down
2 changes: 1 addition & 1 deletion PiggySync/PiggySync.Common/Extensions.cs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;

namespace PiggySyncWin.Domain
namespace PiggySync.Common
{
public static class Extensions
{
Expand Down
11 changes: 3 additions & 8 deletions PiggySync/PiggySync.Common/IPUtils.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Sockets;
using System.Linq;
using System.Net;
using PiggySyncWin.WinUI.Models;
using System.Net.NetworkInformation;
using System.Net.Sockets;

namespace PiggySyncWin.WinUI.Models
namespace PiggySync.Common
{
public class IPUtils
{
Expand Down
Binary file added PiggySync/PiggySync.Core/._Properties
Binary file not shown.
13 changes: 1 addition & 12 deletions PiggySync/PiggySync.Core/Concrete/TcpSocket.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
using PiggySyncWin.Domain.Concrete;
using PiggySyncWin.WinUI.Infrastructure;
using PiggySyncWin.WinUI.Infrastructure.Concrete;
using PiggySyncWin.WinUI.Models;
using PiggySyncWin.WinUI.Models.Concrete;
using PiggySyncWin.WinUI.Sync;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;

namespace PiggySyncWin.WinUI
namespace PiggySync.Core.Concrete
{
public class TcpSocket
{
Expand Down
3 changes: 1 addition & 2 deletions PiggySync/PiggySync.Core/Concrete/TcpSocketListner.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using PiggySyncWin.Domain.Concrete;
using PiggySync.Core.Concrete;
using PiggySyncWin.WinUI.Infrastructure;
using PiggySyncWin.WinUI.Infrastructure.Concrete;
using PiggySyncWin.WinUI.Models;
using PiggySyncWin.WinUI.Models.Concrete;
using PiggySyncWin.WinUI.Sync;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
Expand Down
14 changes: 1 addition & 13 deletions PiggySync/PiggySync.Core/Concrete/UdpSocket.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
using PiggySyncWin.Domain.Concrete;
using PiggySyncWin.WinUI.Infrastructure;
using PiggySyncWin.WinUI.Infrastructure.Concrete;
using PiggySyncWin.WinUI.Models;
using PiggySyncWin.WinUI.Models.Concrete;
using PiggySyncWin.WinUI.Sync;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;

namespace PiggySyncWin.WinUI
namespace PiggySync.Core.Concrete
{
class UdpSocket
{
Expand Down
63 changes: 29 additions & 34 deletions PiggySync/PiggySync.Core/DeviaceManager.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
using PiggySyncWin.WinUI.Models;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PiggySync.DatabaseManager;
using PiggySync.Model;
using PiggySyncWin.WinUI.Infrastructure;
using PiggySyncWin.WinUI.Models;

namespace PiggySyncWin.WinUI.Infrastructure
namespace PiggySync.Core
{
public static class DeviaceHistoryManager
{
public static List<PiggyRemoteHostHistoryEntry> AllHosts
{
get;
set;
}
public static class DeviaceHistoryManager
{
static DeviaceHistoryManager()
{
AllHosts = DatabaseManager.Instance.GetHistoricalDeviaces();
}

static DeviaceHistoryManager ()
{
AllHosts = DatabaseManager.Instance.GetHistoricalDeviaces ();
}
public static List<PiggyRemoteHostHistoryEntry> AllHosts { get; set; }

public static void AddHost (PiggyRemoteHost host)
{
foreach (var x in AllHosts)
{
if (x == host)
{
x.LastSync = DateTime.Now;
DatabaseManager.Instance.UpdateHistoricalDeviace (x);
return;
}
}
var newHost = new PiggyRemoteHostHistoryEntry (host);
newHost.LastSync = DateTime.Now;
DatabaseManager.Instance.SaveHistoricalDeviace (newHost);
public static void AddHost(PiggyRemoteHost host)
{
foreach (PiggyRemoteHostHistoryEntry x in AllHosts)
{
if (x == host)
{
x.LastSync = DateTime.Now;
DatabaseManager.Instance.UpdateHistoricalDeviace(x);
return;
}
}
var newHost = new PiggyRemoteHostHistoryEntry(host);
newHost.LastSync = DateTime.Now;
DatabaseManager.Instance.SaveHistoricalDeviace(newHost);

AllHosts.Add (newHost);
}
}
AllHosts.Add(newHost);
}
}
}
23 changes: 11 additions & 12 deletions PiggySync/PiggySync.Core/FileManager.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;
using System.Threading;
using PiggySyncWin.Domain.Concrete;
using PiggySyncWin.Domain;
using System.IO;
using PiggySyncWin.WinUI.Infrastructure;
using PiggySync.Core;
using PiggySync.DatabaseManager;
using System.Linq;
using PiggySync.Domain.Concrete;
using PiggySync.Model;
using PiggySync.Model.Concrete;
using PiggySyncWin.WinUI.Models;
using PiggySyncWin.WinUI.Models.Concrete;

namespace PiggySyncWin.WinUI.Models
namespace PiggySync.Core
{
public class FileManager
{
Expand Down Expand Up @@ -146,10 +141,14 @@ static void AddOtherDeletedFiles (HashSet<FileInf> dbFiles, SyncInfoPacket root)
curr = string.Format ("{1}/{0}", element, curr);
if (!Directory.Exists (curr))
{
root.Folders.Add (new FolderInfoPacket (element, 144));//TODO
var deletedFolder = new FolderInfoPacket (curr.Replace(XmlSettingsRepository.Instance.Settings.SyncPath, String.Empty), 144);

root.Folders.Add (deletedFolder);//TODO
deletedFolder.DeletedFiles.Add (new FileDeletePacket (file));
break;
}
}
//rootFolder.DeletedFiles.Add (new FileDeletePacket(file));
rootFolder.DeletedFiles.Add (new FileDeletePacket(file));
//TODO Create deleted folder packet
}
}
Expand Down
5 changes: 2 additions & 3 deletions PiggySync/PiggySync.Core/FilePacketCreator.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using PiggySyncWin.Domain.Concrete;
using System.IO;
using System.IO;

namespace PiggySyncWin.WinUI.Infrastructure
namespace PiggySync.Core
{
public static class FilePacketCreator
{
Expand Down
Empty file modified PiggySync/PiggySync.Core/Properties/AssemblyInfo.cs
100755 → 100644
Empty file.
Loading

0 comments on commit bc47f14

Please sign in to comment.