Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 4 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
6 Source/BTW2.sln
@@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gtd.CoreDomain", "Gtd.CoreD
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gtd.CoreDomain.Tests", "Gtd.CoreDomain.Tests\Gtd.CoreDomain.Tests.csproj", "{1B1D22E9-C631-49AD-9633-091DE70DC526}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gtd.Server", "Gtd.Server\Gtd.Server.csproj", "{5FA1A7EF-3776-4520-A9B9-872D7BFFC2C1}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gtd.Shell", "Gtd.Console\Gtd.Shell.csproj", "{B5516C60-3F2C-4CF1-9174-ED3ED2C7BF75}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{CBDBCC09-581A-465B-B658-10A7399DAEFF}"
@@ -40,10 +38,6 @@ Global
{1B1D22E9-C631-49AD-9633-091DE70DC526}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B1D22E9-C631-49AD-9633-091DE70DC526}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B1D22E9-C631-49AD-9633-091DE70DC526}.Release|Any CPU.Build.0 = Release|Any CPU
- {5FA1A7EF-3776-4520-A9B9-872D7BFFC2C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5FA1A7EF-3776-4520-A9B9-872D7BFFC2C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5FA1A7EF-3776-4520-A9B9-872D7BFFC2C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5FA1A7EF-3776-4520-A9B9-872D7BFFC2C1}.Release|Any CPU.Build.0 = Release|Any CPU
{B5516C60-3F2C-4CF1-9174-ED3ED2C7BF75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5516C60-3F2C-4CF1-9174-ED3ED2C7BF75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5516C60-3F2C-4CF1-9174-ED3ED2C7BF75}.Release|Any CPU.ActiveCfg = Release|Any CPU
View
69 Source/Gtd.Console/Commands/ArchiveThoughtCommand.cs
@@ -1,6 +1,3 @@
-using System;
-using System.Globalization;
-using System.Linq;
using Gtd.Shell.Projections;
namespace Gtd.Shell.Commands
@@ -55,70 +52,4 @@ public void Execute(ConsoleEnvironment env, string[] args)
throw new KnownConsoleInputError("Can't archive record:" + record.GetTitle());
}
}
-
- public static class Parser
- {
- public delegate DateTime Change(float diff, DateTime source);
-
- static bool TryRepresent(string value, string[] suffix, Change producer, out DateTime result)
- {
- result = DateTime.MinValue;
- foreach (var s in suffix)
- {
- if (!value.EndsWith(s, StringComparison.InvariantCultureIgnoreCase))
- continue;
- var trimmed = value.Remove(value.Length - s.Length, s.Length).TrimEnd();
- float res;
-
- if (!float.TryParse(trimmed, NumberStyles.Float | NumberStyles.AllowThousands, CultureInfo.InvariantCulture, out res))
- {
- continue;
- }
- result =producer(res, DateTime.Now);
- return true;
- }
- return false;
- }
-
- public static bool TryParseDate(string value, out DateTime span)
- {
- span = DateTime.MinValue;
- if (string.IsNullOrWhiteSpace(value))
- return false;
-
- value = value.Trim().ToLowerInvariant();
-
- switch (value)
- {
- case "now":
- span = DateTime.UtcNow;
- return true;
- case "today":
- span = DateTime.UtcNow.Date.AddHours(8);
- return true;
- case "tomorrow":
- span = DateTime.UtcNow.Date.AddHours(8).AddDays(1);
- return true;
- }
-
- try
- {
- if (TryRepresent(value, new[] {"w", "wk", "week"}, (diff, source) => source.AddDays(7 * diff) , out span))
- return true;
- if (TryRepresent(value, new[] {"d", "day", "days"},(diff, source) => source.AddDays(diff), out span))
- return true;
- if (TryRepresent(value, new[] {"m", "mth", "month"}, (diff, source) => source.AddMonths((int)diff),out span)) ;
-
-
-
- }
- catch (Exception ex)
- {
-
-
- }
- return false;
-
- }
- }
}
View
2  Source/Gtd.Console/Commands/AssignDueDateCommand.cs
@@ -28,7 +28,7 @@ public void Execute(ConsoleEnvironment env, string[] args)
return;
}
- if (!Parser.TryParseDate(value, out span))
+ if (!FriendlyDateParser.TryParseDate(value, out span))
{
throw new KnownConsoleInputError("Failed to parse due date '{0}'", value);
}
View
2  Source/Gtd.Console/Commands/AssignStartDateCommand.cs
@@ -32,7 +32,7 @@ public void Execute(ConsoleEnvironment env, string[] args)
return;
}
- if (!Parser.TryParseDate(value, out span))
+ if (!FriendlyDateParser.TryParseDate(value, out span))
{
throw new KnownConsoleInputError("Failed to parse start date '{0}'", value);
}
View
71 Source/Gtd.Console/FriendlyDateParser.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Globalization;
+
+namespace Gtd.Shell
+{
+ public static class FriendlyDateParser
+ {
+ public delegate DateTime Change(float diff, DateTime source);
+
+ static bool TryRepresent(string value, string[] suffix, Change producer, out DateTime result)
+ {
+ result = DateTime.MinValue;
+ foreach (var s in suffix)
+ {
+ if (!value.EndsWith(s, StringComparison.InvariantCultureIgnoreCase))
+ continue;
+ var trimmed = value.Remove(value.Length - s.Length, s.Length).TrimEnd();
+ float res;
+
+ if (!float.TryParse(trimmed, NumberStyles.Float | NumberStyles.AllowThousands, CultureInfo.InvariantCulture, out res))
+ {
+ continue;
+ }
+ result =producer(res, DateTime.Now);
+ return true;
+ }
+ return false;
+ }
+
+ public static bool TryParseDate(string value, out DateTime span)
+ {
+ span = DateTime.MinValue;
+ if (string.IsNullOrWhiteSpace(value))
+ return false;
+
+ value = value.Trim().ToLowerInvariant();
+
+ switch (value)
+ {
+ case "now":
+ span = DateTime.UtcNow;
+ return true;
+ case "today":
+ span = DateTime.UtcNow.Date.AddHours(8);
+ return true;
+ case "tomorrow":
+ span = DateTime.UtcNow.Date.AddHours(8).AddDays(1);
+ return true;
+ }
+
+ try
+ {
+ if (TryRepresent(value, new[] {"w", "wk", "week"}, (diff, source) => source.AddDays(7 * diff) , out span))
+ return true;
+ if (TryRepresent(value, new[] {"d", "day", "days"},(diff, source) => source.AddDays(diff), out span))
+ return true;
+ if (TryRepresent(value, new[] {"m", "mth", "month"}, (diff, source) => source.AddMonths((int)diff),out span)) ;
+
+
+
+ }
+ catch (Exception ex)
+ {
+
+
+ }
+ return false;
+
+ }
+ }
+}
View
23 Source/Gtd.Console/Gtd.Shell.csproj
@@ -17,7 +17,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
+ <OutputPath>..\..\bin\shell\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -26,29 +26,15 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\..\bin\shell\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="protobuf-net">
- <HintPath>..\..\Library\ProtoBuf-net\protobuf-net.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Interfaces">
- <HintPath>..\..\Library\ServiceStack\ServiceStack.Interfaces.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Redis">
- <HintPath>..\..\Library\ServiceStack\ServiceStack.Redis.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
- <Reference Include="System.Runtime.Serialization" />
- <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="Commands\ArchiveThoughtCommand.cs" />
@@ -68,6 +54,7 @@
<Compile Include="Commands\ListActionsCommand.cs" />
<Compile Include="Commands\ListProjectsCommand.cs" />
<Compile Include="Commands\KnownConsoleInputError.cs" />
+ <Compile Include="FriendlyDateParser.cs" />
<Compile Include="Commands\RenameSubjectCommand.cs" />
<Compile Include="Commands\ViewInboxCommand.cs" />
<Compile Include="ConsoleSession.cs" />
@@ -91,10 +78,6 @@
<Project>{A435667B-5C71-41A0-A7C8-4700BDADF8B2}</Project>
<Name>Btw.Portable</Name>
</ProjectReference>
- <ProjectReference Include="..\Btw.Redis\Btw.Redis.csproj">
- <Project>{66A6C5E4-3732-4955-8247-620377E261F2}</Project>
- <Name>Btw.Redis</Name>
- </ProjectReference>
<ProjectReference Include="..\Gtd.CoreDomain\Gtd.CoreDomain.csproj">
<Project>{BAB02576-30C8-4DE2-AC43-23766F9FD6A1}</Project>
<Name>Gtd.CoreDomain</Name>
View
2  Source/Gtd.Console/Program.cs
@@ -5,11 +5,9 @@
using System.Text;
using System.Threading;
using Gtd.CoreDomain;
-using Btw.Redis;
using Gtd.Shell.Commands;
using Gtd.Shell.Filters;
using Gtd.Shell.Projections;
-using ServiceStack.Redis;
namespace Gtd.Shell
{
View
56 Source/Gtd.Server/Gtd.Server.csproj
@@ -1,56 +0,0 @@
-<?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>{5FA1A7EF-3776-4520-A9B9-872D7BFFC2C1}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Gtd.Server</RootNamespace>
- <AssemblyName>Gtd.Server</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <PlatformTarget>AnyCPU</PlatformTarget>
- <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' ">
- <PlatformTarget>AnyCPU</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="ServiceStack">
- <HintPath>..\..\Library\ServiceStack\ServiceStack.dll</HintPath>
- </Reference>
- <Reference Include="ServiceStack.Interfaces">
- <HintPath>..\..\Library\ServiceStack\ServiceStack.Interfaces.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.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>
View
47 Source/Gtd.Server/Program.cs
@@ -1,47 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using ServiceStack.WebHost.Endpoints;
-
-namespace Gtd.Server
-{
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Starting GTD server in console mode. Press enter to quit");
- Console.WriteLine("This is an empty stub now");
-
- Console.WriteLine("Make sure, that you are running as ADMIN!");
- using (var host = new ServiceStackHost())
- {
- host.Init();
- host.Start("http://localhost:20002/");
- Console.ReadLine();
- }
- }
- }
-
- public class ServiceStackHost : AppHostHttpListenerBase
- {
-
- public ServiceStackHost()
- : base("BTW GTD (raw)", typeof(ServiceStackHost).Assembly)
- {
-
- }
-
- public override void Configure(Funq.Container container)
- {
- //LoadPlugin(new TaskSupport());
- //Routes
- // .Add<ClientDto.WriteEvent>(ClientDto.WriteEvent.Url, "POST")
- // .Add<ClientDto.WriteBatch>(ClientDto.WriteBatch.Url, "POST")
- // .Add<ClientDto.ResetStore>(ClientDto.ResetStore.Url, "POST")
- // .Add<ClientDto.ShutdownServer>(ClientDto.ShutdownServer.Url, "GET");
-
- //container.Register(_publisher);
- }
- }
-
-}
View
36 Source/Gtd.Server/Properties/AssemblyInfo.cs
@@ -1,36 +0,0 @@
-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("Gtd.Server")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Gtd.Server")]
-[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("ea74a3b6-640c-4ecf-bcc1-75b2bd0cc3fc")]
-
-// 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")]

No commit comments for this range

Something went wrong with that request. Please try again.