Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
This is the primitive version of FreeFiles.
  • Loading branch information
amirjalilifard committed Aug 2, 2013
1 parent 9db312f commit e6cc284
Show file tree
Hide file tree
Showing 140 changed files with 8,904 additions and 0 deletions.
256 changes: 256 additions & 0 deletions AssemblyDependencies1.dgml

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions Entities/Entities.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{49240D90-C088-4CEB-94ED-631F248D8BE6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Entities</RootNamespace>
<AssemblyName>Entities</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="File.cs" />
<Compile Include="Peer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
16 changes: 16 additions & 0 deletions Entities/File.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Entities
{
public sealed class File
{
public string FileName { get; set; }
public int FileSize { get; set; }
public string FileType { get; set; }
public Guid PeerID { get; set; }
public string PeerHostName { get; set; }
}
}
14 changes: 14 additions & 0 deletions Entities/Peer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Entities
{
public sealed class Peer
{
public Guid PeerID { get; set; }
public string PeerHostName { get; set; }
public string Comments { get; set; }
}
}
36 changes: 36 additions & 0 deletions Entities/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("Entities")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Entities")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
[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("a9a4572c-9612-40f2-9c69-fffba65c5b0e")]

// 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")]
59 changes: 59 additions & 0 deletions FakeObjects/FakeObjects.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4BDDF06D-0C74-4339-80DF-42B28151BF82}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FakeObjects</RootNamespace>
<AssemblyName>FakeObjects</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FakeTransferEngine.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FreeFile.DownloadManager\FreeFile.DownloadManager.csproj">
<Project>{bdf446f0-3e99-4ee0-a154-ef11606794ca}</Project>
<Name>FreeFile.DownloadManager</Name>
</ProjectReference>
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
37 changes: 37 additions & 0 deletions FakeObjects/FakeTransferEngine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using FreeFile.DownloadManager.Abstract;

namespace FakeObjects
{
public class FakeTransferEngine : ITransferEngine
{
public byte[] GetFile(string filePath, string fileName, string hostURI = "", string hash = "", long partNumber = 1)
{
if (!filePath.EndsWith(@"\"))
{
filePath += @"\";
}
var data=File.ReadAllBytes(filePath + fileName);
return data;
}

public byte[] GetFile(string filename, string hash, long partNumber, string hostName)
{
throw new NotImplementedException();
}

public byte[] GetFile(string filename, long partNumber, string hostName)
{
throw new NotImplementedException();
}

public void SetupFileServer()
{
throw new NotImplementedException();
}
}
}
36 changes: 36 additions & 0 deletions FakeObjects/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("FakeObjects")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("FakeObjects")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
[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("e5ff1e3e-7199-4f98-b66e-459ba01d3bac")]

// 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")]
69 changes: 69 additions & 0 deletions FreeFile.DownloadManager/Abstract/Factory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Forms;

namespace FreeFile.DownloadManager.Abstract
{
public sealed class Factory
{
Factory()
{

Assembly transferEngineAssembly = Assembly.LoadFile(Path.GetDirectoryName( Application.ExecutablePath) + "\\FreeFiles.TransferEngine.WCFPNRP.dll");
var tnaTypes = transferEngineAssembly.GetTypes();
foreach (var item in tnaTypes)
{
if (item.GetInterface("ITransferEngineFactory") != null)
{
ITransferEngineFactory ITransferEngineFactory = Activator.CreateInstance(item) as ITransferEngineFactory;
this.transferEngine = ITransferEngineFactory.CreateTransferEngine();
this.fileProviderServer = this.transferEngine as IFileProviderServer;
break;
}
}
/* Create
*searchEngine;
*/
this.searchEngine = new Searchengine();
}
static readonly object sharedObject = new object();
static Factory instance;
public static Factory Instance
{
get
{
if (instance == null)
{
lock (sharedObject)
{
if (instance == null)
{
instance = new Factory();
}
}
}
return instance;
}
}
ISearchEngine searchEngine;
ITransferEngine transferEngine;
IFileProviderServer fileProviderServer;
public ISearchEngine CreateSeachEngine()
{
return searchEngine;
}
public ITransferEngine CreateTransferEngine()
{
return transferEngine;
}

public IFileProviderServer CreateFileProviderServer()
{
return fileProviderServer;
}
}
}
15 changes: 15 additions & 0 deletions FreeFile.DownloadManager/Abstract/FileSearchResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FreeFile.DownloadManager.Abstract
{
public sealed class FileSearchResult
{
public string FileName { get; set; }
public long Size { get; set; }
public string Hash { get; set; }
public string HostName { get; set; }
}
}
16 changes: 16 additions & 0 deletions FreeFile.DownloadManager/Abstract/IFileInfoServerManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FreeFile.DownloadManager.LocalFileManagement
{
namespace FreeFile.DownloadManager.Abstract
{
public interface IFileInfoServerManager
{
void RegisterSharedFileInfo(string localServerName, string fileName, string hash, long size);
void RemoveSharedFile(string localServerName, string fileName, string hash);
}
}
}
12 changes: 12 additions & 0 deletions FreeFile.DownloadManager/Abstract/IFileProviderServer.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;

namespace FreeFile.DownloadManager.Abstract
{
public interface IFileProviderServer
{
void SetupFileServer();
}
}
13 changes: 13 additions & 0 deletions FreeFile.DownloadManager/Abstract/ISearchEngine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FreeFile.DownloadManager.Abstract
{
public interface ISearchEngine
{
List<Entities.File> Search(string searchPattern);
List<FileSearchResult> SearchByFileHashCode(string hashCode);
}
}
Loading

0 comments on commit e6cc284

Please sign in to comment.