Permalink
Browse files

restructured the project

  • Loading branch information...
1 parent 3555801 commit 72cfc042e201ba933d1b85a9e14ac458fc04d52f Daniel Draper committed Oct 11, 2011
View
@@ -0,0 +1,13 @@
+[Oo]bj/
+[Bb]in/
+_ReSharper.*
+*.csproj.user
+*.resharper.user
+*.resharper
+*.suo
+*.cache
+*~
+*.swp
+*.resharper.user
+*.rptproj.user
+*.db
@@ -0,0 +1,53 @@
+/*Copyright 2011 Arash Norouzi
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+using System;
+
+namespace MoonAPNS
+{
+ /// <summary>
+ /// Feedback object
+ /// </summary>
+ public class Feedback
+ {
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ public Feedback()
+ {
+ this.DeviceToken = string.Empty;
+ this.Timestamp = DateTime.MinValue;
+ }
+
+ /// <summary>
+ /// Device Token string in hex form without any spaces or dashes
+ /// </summary>
+ public string DeviceToken
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Timestamp of the Feedback for when Apple received the notice to stop sending notifications to the device
+ /// </summary>
+ public DateTime Timestamp
+ {
+ get;
+ set;
+ }
+ }
+}
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A91E03EF-6532-4896-89C4-9FCEC1D8D4DB}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MoonAPNS</RootNamespace>
+ <AssemblyName>MoonAPNS</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</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|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <StartupObject />
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="NLog">
+ <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
+ </Reference>
+ <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="Feedback.cs" />
+ <Compile Include="NotificationAlert.cs" />
+ <Compile Include="NotificationPayload.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="PushNotification.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="NLog.config">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </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>
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <!-- make sure to set 'Copy To Output Directory' option for this file -->
+ <!-- go to http://nlog-project.org/wiki/Configuration_file for more information -->
+
+ <targets>
+ <target name="logfile" xsi:type="File" fileName="D:\MoonAPNS\MoonAPNS\MoonAPNS\Logs\Push Notification\${date:format=yyyyMMdd}.log" archiveEvery="Day" layout="${date:format=yyyyMMdd HHmm} - ${level} - ${message}" createDirs="true"/>
+ </targets>
+
+ <rules>
+ <logger name="*" minlevel="Info" writeTo="logfile"/>
+ </rules>
+</nlog>
@@ -0,0 +1,94 @@
+/*Copyright 2011 Arash Norouzi
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+using System.Collections.Generic;
+
+namespace MoonAPNS
+{
+ /// <summary>
+ /// Alert Portion of the Notification Payload
+ /// </summary>
+ public class NotificationAlert
+ {
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ public NotificationAlert()
+ {
+ Body = null;
+ ActionLocalizedKey = null;
+ LocalizedKey = null;
+ LocalizedArgs = new List<object>();
+ }
+
+ /// <summary>
+ /// Body Text of the Notification's Alert
+ /// </summary>
+ public string Body
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Action Button's Localized Key
+ /// </summary>
+ public string ActionLocalizedKey
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Localized Key
+ /// </summary>
+ public string LocalizedKey
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Localized Argument List
+ /// </summary>
+ public List<object> LocalizedArgs
+ {
+ get;
+ set;
+ }
+
+ public void AddLocalizedArgs(params object[] values)
+ {
+ this.LocalizedArgs.AddRange(values);
+ }
+
+ /// <summary>
+ /// Determines if the Alert is empty and should be excluded from the Notification Payload
+ /// </summary>
+ public bool IsEmpty
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(Body)
+ || !string.IsNullOrEmpty(ActionLocalizedKey)
+ || !string.IsNullOrEmpty(LocalizedKey)
+ || (LocalizedArgs != null && LocalizedArgs.Count > 0))
+ return false;
+ else
+ return true;
+ }
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit 72cfc04

Please sign in to comment.