Move Notifications projects into OurUmbraco project

This commit is contained in:
Sebastiaan Janssen
2016-03-18 21:01:44 +01:00
parent 17f1de89d2
commit 5727b06d4b
53 changed files with 740 additions and 2477 deletions
-22
View File
@@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using uForum.Businesslogic;
namespace NotificationsCore.EventHandlers
{
public class Forum : umbraco.BusinessLogic.ApplicationBase
{
public Forum()
{
Comment.AfterCreate += new EventHandler<CreateEventArgs>(Comment_AfterCreate);
}
void Comment_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e)
{
Comment c = (Comment)sender;
//InstantNotification.Execute("NewComment", c.Id);
}
}
}
-72
View File
@@ -1,72 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Reflection;
namespace NotificationsCore
{
public class InstantNotification
{
private delegate void ExecuteDelegate(string config, string assemblydir, string name, params object[] args);
private ExecuteDelegate ed;
public InstantNotification()
{
ed = new ExecuteDelegate(this.Execute);
}
public void Invoke(string config, string assemblydir, string name, params object[] args)
{
ed.BeginInvoke(config, assemblydir, name, args, null, null);
}
public void Execute(string config,string assemblydir, string name, params object[] args)
{
try
{
XmlDocument notifications = new XmlDocument();
notifications.Load(config);
XmlNode settings = notifications.SelectSingleNode("//global");
XmlNode node = notifications.SelectSingleNode(
string.Format("//instant//notification [@name = '{0}']", name));
XmlDocument details = new XmlDocument();
XmlNode cont = details.CreateElement("details");
cont.AppendChild(details.ImportNode(settings,true));
cont.AppendChild(details.ImportNode(node,true));
details.AppendChild(cont);
if (node != null)
{
string assemblyFile =
String.Format("{0}{1}.dll", assemblydir, node.Attributes["assembly"].Value);
Assembly nAssembly = System.Reflection.Assembly.LoadFrom(assemblyFile);
Notification n =
(Notification)Activator.CreateInstance(
nAssembly.GetType(node.Attributes["type"].Value));
n.SendNotification(details, args);
}
else
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, 666, "not found");
}
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, 666, e.Message);
}
}
}
}
-12
View File
@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace NotificationsCore.Interfaces
{
interface INotification
{
bool SendNotification(XmlNode details, params object[] args);
}
}
-17
View File
@@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using NotificationsCore.Interfaces;
using System.Xml;
namespace NotificationsCore
{
public abstract class Notification: INotification
{
#region INotification Members
public virtual bool SendNotification(XmlNode details, params object[] args) { return false; }
#endregion
}
}
-294
View File
@@ -1,294 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NotificationsCore</RootNamespace>
<AssemblyName>NotificationsCore</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="AutoMapper.Net4, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="businesslogic, Version=1.0.5921.26492, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\businesslogic.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ClientDependency.Core, Version=1.8.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ClientDependency.1.8.4\lib\net45\ClientDependency.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ClientDependency.Core.Mvc, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ClientDependency-Mvc5.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="cms, Version=1.0.5921.26493, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\cms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="controls, Version=1.0.5921.26494, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\controls.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CookComputing.XmlRpcV2, Version=2.5.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d, processorArchitecture=MSIL">
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Examine, Version=0.1.68.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Examine.0.1.68.0\lib\Examine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ImageProcessor, Version=2.3.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ImageProcessor.2.3.3.0\lib\net45\ImageProcessor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ImageProcessor.Web, Version=4.5.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ImageProcessor.Web.4.5.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="interfaces, Version=1.0.5921.26487, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\log4net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181, processorArchitecture=MSIL">
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MarkdownSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Markdown.1.14.4\lib\net45\MarkdownSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Owin, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Security, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Security.Cookies, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Security.OAuth, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MiniProfiler, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b44f9351044011a3, processorArchitecture=MSIL">
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Semver, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\semver.1.1.2\lib\net451\Semver.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLCE4Umbraco, Version=1.0.5921.26494, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\SQLCE4Umbraco.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\System.Data.SqlServerCe.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="TidyNet, Version=1.0.0.0, Culture=neutral">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\TidyNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco, Version=1.0.5921.26497, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Umbraco.Core, Version=1.0.5921.26490, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\Umbraco.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco.DataLayer, Version=1.0.5921.26492, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.DataLayer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco.editorControls, Version=1.0.5921.26499, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.editorControls.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco.MacroEngines, Version=1.0.5921.26500, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.MacroEngines.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco.providers, Version=1.0.5921.26494, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.providers.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Umbraco.Web.UI, Version=1.0.5921.26501, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\Umbraco.Web.UI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="UmbracoExamine, Version=0.7.0.26493, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\UmbracoExamine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="UrlRewritingNet.UrlRewriter, Version=2.0.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UrlRewritingNet.2.0.7\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="InstantNotification.cs" />
<Compile Include="Interfaces\INotification.cs" />
<Compile Include="Notification.cs" />
<Compile Include="NotificationTypes\NewForumTopic.cs" />
<Compile Include="NotificationTypes\NewForumTopicComment.cs" />
<Compile Include="SheduledNotification.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OurUmbraco\OurUmbraco.csproj">
<Project>{a8e5c936-ecab-45b3-bfda-d12f680eb2a6}</Project>
<Name>OurUmbraco</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>
-52
View File
@@ -1,52 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
using System.Reflection;
using System.Xml;
namespace NotificationsCore
{
public class NotificationExecuter
{
public string Name { get; set; }
public double Interval { get; set; }
public string Assembly { get; set; }
public string Type { get; set; }
public XmlNode Details { get; set; }
Timer timer = new Timer();
public NotificationExecuter(string name, double interval, string assembly, string type, XmlNode details)
{
this.Name = name;
this.Interval = interval;
this.Assembly = assembly;
this.Type = type;
this.Details = details;
}
public void Start()
{
timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
timer.Interval = Interval;
timer.Enabled = true;
}
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
string assemblyFile =
String.Format("{0}.dll", Assembly);
Assembly nAssembly = System.Reflection.Assembly.LoadFrom(assemblyFile);
Notification n =
(Notification)Activator.CreateInstance(
nAssembly.GetType(Type));
n.SendNotification(Details);
}
}
}
-36
View File
@@ -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("Notification")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Notification")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[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("df83d509-8920-49a4-a9e0-41665d8bfa42")]
// 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")]
-52
View File
@@ -1,52 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
using System.Reflection;
using System.Xml;
namespace NotificationsCore
{
public class SheduledNotification
{
public string Name { get; set; }
public double Interval { get; set; }
public string Assembly { get; set; }
public string Type { get; set; }
public XmlNode Details { get; set; }
Timer timer = new Timer();
public SheduledNotification(string name, double interval, string assembly, string type, XmlNode details)
{
this.Name = name;
this.Interval = interval;
this.Assembly = assembly;
this.Type = type;
this.Details = details;
}
public void Start()
{
timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
timer.Interval = Interval;
timer.Enabled = true;
}
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
string assemblyFile =
String.Format("{0}.dll", Assembly);
Assembly nAssembly = System.Reflection.Assembly.LoadFrom(assemblyFile);
Notification n =
(Notification)Activator.CreateInstance(
nAssembly.GetType(Type));
n.SendNotification(Details);
}
}
}
-64
View File
@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data></configuration>
-39
View File
@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="3.0.0" targetFramework="net451" />
<package id="ClientDependency" version="1.8.4" targetFramework="net451" />
<package id="ClientDependency-Mvc" version="1.8.0.0" targetFramework="net451" />
<package id="ClientDependency-Mvc5" version="1.8.0.0" targetFramework="net451" />
<package id="Examine" version="0.1.68.0" targetFramework="net451" />
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net451" />
<package id="ImageProcessor" version="2.3.3.0" targetFramework="net451" />
<package id="ImageProcessor.Web" version="4.5.3.0" targetFramework="net451" />
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net451" />
<package id="Markdown" version="1.14.4" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net451" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="5.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.0.0" targetFramework="net451" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net451" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net451" />
<package id="MySql.Data" version="6.9.8" targetFramework="net451" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" />
<package id="Owin" version="1.0" targetFramework="net451" />
<package id="semver" version="1.1.2" targetFramework="net451" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net451" />
<package id="UmbracoCms.Core" version="7.4.2" targetFramework="net451" />
<package id="UrlRewritingNet" version="2.0.7" targetFramework="net451" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net451" />
</packages>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="url" value="http://dreamingofawhitechristmas.our.umbraco.org/umbraco/plugins/Notifications/SheduledTaskTrigger.aspx"/>
<add key="interval" value="900000"/>
<!--
<add key="configFile" value="C:\Users\Tim Geyssens\Documents\Visual Studio 2008\Umbraco\OUR\NotificationMailer\NotificationMailer.config"/>
-->
</appSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
-24
View File
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<notification name="New forum post" interval="200" assembly="temp" type="temp">
<from>
<name>Our umbraco</name>
<email>robot@umbraco.org</email>
</from>
<subject>There has been a new post</subject>
<body>There has been a new post</body>
</notification>
<notification name="Another forum post" interval="100" assembly="temp" type="temp">
<from>
<name>Our umbraco</name>
<email>robot@umbraco.org</email>
</from>
<subject>There has been a new post</subject>
<body>There has been a new post</body>
</notification>
</configuration>
@@ -1,53 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
using System.Reflection;
using Notifications;
using System.Xml;
namespace NotificationMailer
{
public class NotificationExecuter
{
public string Name { get; set; }
public double Interval { get; set; }
public string Assembly { get; set; }
public string Type { get; set; }
public XmlNode Details { get; set; }
Timer timer = new Timer();
public NotificationExecuter(string name, double interval, string assembly, string type, XmlNode details)
{
this.Name = name;
this.Interval = interval;
this.Assembly = assembly;
this.Type = type;
this.Details = details;
}
public void Start()
{
timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
timer.Interval = Interval;
timer.Enabled = true;
}
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
string assemblyFile =
String.Format("{0}.dll", Assembly);
Assembly nAssembly = System.Reflection.Assembly.LoadFrom(assemblyFile);
Notification n =
(Notification)Activator.CreateInstance(
nAssembly.GetType(Type));
n.SendNotification(Details);
}
}
}
@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F41D51B7-3ECF-4C4C-955E-6E761345E18E}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NotificationMailer</RootNamespace>
<AssemblyName>NotificationMailer</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Management" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="NotificationService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="NotificationService.Designer.cs">
<DependentUpon>NotificationService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="ProjectInstaller.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ProjectInstaller.Designer.cs">
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="NotificationService.resx">
<DependentUpon>NotificationService.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ProjectInstaller.resx">
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</EmbeddedResource>
</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>
-40
View File
@@ -1,40 +0,0 @@
namespace NotificationMailer
{
partial class NotificationService
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// NotificationService
//
this.ServiceName = "NotificationService";
}
#endregion
}
}
-88
View File
@@ -1,88 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Xml;
using System.Configuration;
using System.Threading;
using System.Net;
namespace NotificationMailer
{
public partial class NotificationService : ServiceBase
{
public NotificationService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
System.Timers.Timer timer = new System.Timers.Timer();
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
timer.Interval = double.Parse(ConfigurationSettings.AppSettings["interval"]);
timer.Enabled = true;
timer.Start();
//XmlDocument notifications = new XmlDocument();
//notifications.Load(ConfigurationSettings.AppSettings["configFile"]);
//XmlNode settings = notifications.SelectSingleNode("//global");
//XmlNodeList xnl = notifications.SelectNodes("//sheduled//notification");
//foreach (XmlNode node in xnl)
//{
// XmlDocument details = new XmlDocument();
// XmlNode cont = details.CreateElement("details");
// cont.AppendChild(details.ImportNode(settings, true));
// cont.AppendChild(details.ImportNode(node, true));
// details.AppendChild(cont);
// SheduledNotification n =
// new SheduledNotification(
// node.Attributes["name"].Value,
// double.Parse(node.Attributes["interval"].Value),
// node.Attributes["assembly"].Value,
// node.Attributes["type"].Value,
// details);
// Thread nThread = new Thread(new ThreadStart(n.Start));
// nThread.Start();
//}
}
void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create(ConfigurationSettings.AppSettings["url"]);
HttpWebResponse response = (HttpWebResponse)
request.GetResponse();
}
protected override void OnStop()
{
}
//public static string GetNodeValue(XmlNode n)
//{
// if (n == null || n.FirstChild == null)
// return string.Empty;
// return n.FirstChild.Value;
//}
}
}
-123
View File
@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
-23
View File
@@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
using System.ServiceProcess;
using System.Text;
namespace NotificationMailer
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new NotificationService()
};
ServiceBase.Run(ServicesToRun);
}
}
}
-58
View File
@@ -1,58 +0,0 @@
namespace NotificationMailer
{
partial class ProjectInstaller
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
//
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.serviceProcessInstaller1.Password = null;
this.serviceProcessInstaller1.Username = null;
//
// serviceInstaller1
//
this.serviceInstaller1.ServiceName = "NotificationService";
this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
this.serviceProcessInstaller1,
this.serviceInstaller1});
}
#endregion
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
private System.ServiceProcess.ServiceInstaller serviceInstaller1;
}
}
-19
View File
@@ -1,19 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
namespace NotificationMailer
{
[RunInstaller(true)]
public partial class ProjectInstaller : System.Configuration.Install.Installer
{
public ProjectInstaller()
{
InitializeComponent();
}
}
}
-129
View File
@@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="serviceProcessInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="serviceInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>196, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -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("NotificationMailer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NotificationMailer")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[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("d9a67c91-946c-4774-b7d7-dc4f97a17a1d")]
// 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")]
-31
View File
@@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
namespace NotificationsWeb
{
public class Config
{
private static string _path = umbraco.GlobalSettings.FullpathToRoot + Path.DirectorySeparatorChar + "config" + Path.DirectorySeparatorChar;
private static string _filename = "Notification.config";
public static string AssemblyDir
{
get
{
return umbraco.GlobalSettings.FullpathToRoot + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar;
}
}
public static string ConfigurationFile
{
get
{
return _path + _filename;
}
}
}
}
-318
View File
@@ -1,318 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6CF53D68-BD81-47BB-8F56-350A1B04F114}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NotificationsWeb</RootNamespace>
<AssemblyName>NotificationsWeb</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>4.0</OldToolsVersion>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="AutoMapper.Net4, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="businesslogic, Version=1.0.5921.26492, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\businesslogic.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ClientDependency.Core, Version=1.8.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ClientDependency.1.8.4\lib\net45\ClientDependency.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ClientDependency.Core.Mvc, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ClientDependency-Mvc5.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="cms, Version=1.0.5921.26493, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\cms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="controls, Version=1.0.5921.26494, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\controls.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CookComputing.XmlRpcV2, Version=2.5.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d, processorArchitecture=MSIL">
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Examine, Version=0.1.68.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Examine.0.1.68.0\lib\Examine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ImageProcessor, Version=2.3.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ImageProcessor.2.3.3.0\lib\net45\ImageProcessor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ImageProcessor.Web, Version=4.5.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ImageProcessor.Web.4.5.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="interfaces, Version=1.0.5921.26487, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\log4net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181, processorArchitecture=MSIL">
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MarkdownSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Markdown.1.14.4\lib\net45\MarkdownSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Owin, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Security, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Security.Cookies, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Security.OAuth, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MiniProfiler, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b44f9351044011a3, processorArchitecture=MSIL">
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Semver, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\semver.1.1.2\lib\net451\Semver.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLCE4Umbraco, Version=1.0.5921.26494, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\SQLCE4Umbraco.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\System.Data.SqlServerCe.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Web.Mobile" />
<Reference Include="System.Xml.Linq" />
<Reference Include="TidyNet, Version=1.0.0.0, Culture=neutral">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\TidyNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco, Version=1.0.5921.26497, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Umbraco.Core, Version=1.0.5921.26490, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\Umbraco.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco.DataLayer, Version=1.0.5921.26492, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.DataLayer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco.editorControls, Version=1.0.5921.26499, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.editorControls.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco.MacroEngines, Version=1.0.5921.26500, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.MacroEngines.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="umbraco.providers, Version=1.0.5921.26494, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\umbraco.providers.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Umbraco.Web.UI, Version=1.0.5921.26501, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\Umbraco.Web.UI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="UmbracoExamine, Version=0.7.0.26493, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UmbracoCms.Core.7.4.2\lib\UmbracoExamine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="UrlRewritingNet.UrlRewriter, Version=2.0.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UrlRewritingNet.2.0.7\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Api\NotificationsController.cs" />
<Compile Include="Config.cs" />
<Compile Include="EventHandlers\Forum.cs" />
<Compile Include="Library\Utils.cs" />
<Compile Include="Models\ForumSubscriber.cs" />
<Compile Include="Models\ForumTopicSubscriber.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\NotificationService.cs" />
<Compile Include="Singleton.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Notification\Notification.csproj">
<Project>{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}</Project>
<Name>Notification</Name>
</ProjectReference>
<ProjectReference Include="..\OurUmbraco\OurUmbraco.csproj">
<Project>{a8e5c936-ecab-45b3-bfda-d12f680eb2a6}</Project>
<Name>OurUmbraco</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<!-- 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>
-->
<ProjectExtensions />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -1,35 +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("NotificationsWeb")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NotificationsWeb")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[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("3d5900ae-111a-45be-96b3-d9e4606ca793")]
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
-64
View File
@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data></configuration>
-38
View File
@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="3.0.0" targetFramework="net451" />
<package id="ClientDependency" version="1.8.4" targetFramework="net451" />
<package id="ClientDependency-Mvc" version="1.8.0.0" targetFramework="net451" />
<package id="ClientDependency-Mvc5" version="1.8.0.0" targetFramework="net451" />
<package id="Examine" version="0.1.68.0" targetFramework="net451" />
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net451" />
<package id="ImageProcessor" version="2.3.3.0" targetFramework="net451" />
<package id="ImageProcessor.Web" version="4.5.3.0" targetFramework="net451" />
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net451" />
<package id="Markdown" version="1.14.4" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net451" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="5.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net451" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net451" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net451" />
<package id="MySql.Data" version="6.9.8" targetFramework="net451" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" />
<package id="Owin" version="1.0" targetFramework="net451" />
<package id="semver" version="1.1.2" targetFramework="net451" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net451" />
<package id="UmbracoCms.Core" version="7.4.2" targetFramework="net451" />
<package id="UrlRewritingNet" version="2.0.7" targetFramework="net451" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net451" />
</packages>
+4 -10
View File
@@ -4398,14 +4398,6 @@
<Content Include="xslt\Web.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NotificationsWeb\NotificationsWeb.csproj">
<Project>{6cf53d68-bd81-47bb-8f56-350a1b04f114}</Project>
<Name>NotificationsWeb</Name>
</ProjectReference>
<ProjectReference Include="..\Notification\Notification.csproj">
<Project>{80e5f59d-a7a0-4cee-aeb6-6c626c44b2b2}</Project>
<Name>Notification</Name>
</ProjectReference>
<ProjectReference Include="..\OurUmbraco\OurUmbraco.csproj">
<Project>{A8E5C936-ECAB-45B3-BFDA-D12F680EB2A6}</Project>
<Name>OurUmbraco</Name>
@@ -4423,8 +4415,10 @@
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<VSToolsPath Condition="exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets')">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0</VSToolsPath>
<VSToolsPath Condition="exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets')">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0</VSToolsPath>
<VSToolsPath Condition="exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets')">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0</VSToolsPath>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
@@ -1,4 +1,5 @@
@using OurUmbraco.Forum.Extensions
@using OurUmbraco.NotificationsWeb.Library
@inherits Umbraco.Web.Macros.PartialViewMacroPage
<div class="utility-actions">
@@ -15,7 +16,7 @@
var subscribed = false;
if (mem != null)
{
subscribed = NotificationsWeb.Library.Utils.IsSubscribedToForum(CurrentPage.Id, mem.Id);
subscribed = Utils.IsSubscribedToForum(CurrentPage.Id, mem.Id);
}
if (subscribed)
@@ -2,6 +2,7 @@
@using System.Web.Mvc.Html
@using OurUmbraco.Forum.Extensions
@using OurUmbraco.Forum.Services
@using OurUmbraco.NotificationsWeb.Library
@{
var topicService = new TopicService(ApplicationContext.DatabaseContext);
@@ -98,7 +99,7 @@
var subscribed = false;
if (mem != null)
{
subscribed = NotificationsWeb.Library.Utils.IsSubscribedToForumTopic(topic.Id, mem.Id);
subscribed = Utils.IsSubscribedToForumTopic(topic.Id, mem.Id);
}
if (Members.IsAdmin())
@@ -1,5 +1,6 @@
@using OurUmbraco.Forum.Extensions
@using OurUmbraco.Forum.Services
@using OurUmbraco.NotificationsWeb.Library
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
var topicService = new TopicService(ApplicationContext.DatabaseContext);
@@ -15,7 +16,7 @@
var subscribed = false;
if (mem != null)
{
subscribed = NotificationsWeb.Library.Utils.IsSubscribedToForumTopic(topic.Id, mem.Id);
subscribed = Utils.IsSubscribedToForumTopic(topic.Id, mem.Id);
}
if (Members.IsAdmin())
@@ -1,5 +1,5 @@
@using NotificationsWeb.Services
@using OurUmbraco.Forum.Services
@using OurUmbraco.NotificationsWeb.Services
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
+4 -4
View File
@@ -16,8 +16,8 @@
<instant>
<notification name="NewTopic"
assembly="NotificationsCore"
type="NotificationsCore.NotificationTypes.NewForumTopic">
assembly="OurUmbraco"
type="OurUmbraco.NotificationsCore.NotificationTypes">
<subject>Umbraco community: New topic in '{0}' forum</subject>
<body>{2} just added a new topic to the '{0}' forum.
@@ -41,8 +41,8 @@ You can unsubscribe from your profile on our.umbraco.org
</notification>
<notification name="NewComment"
assembly="NotificationsCore"
type="NotificationsCore.NotificationTypes.NewForumTopicComment">
assembly="OurUmbraco"
type="OurUmbraco.NotificationsCore.NotificationTypes.NewForumTopicComment">
<subject>Umbraco community: New comment in topic '{0}'</subject>
<body>{2} just added a new comment to the '{0}' topic.
@@ -0,0 +1,63 @@
using System;
using System.Reflection;
using System.Xml;
namespace OurUmbraco.NotificationsCore
{
public class InstantNotification
{
private delegate void ExecuteDelegate(string config, string assemblydir, string name, params object[] args);
private readonly ExecuteDelegate _ed;
public InstantNotification()
{
_ed = Execute;
}
public void Invoke(string config, string assemblydir, string name, params object[] args)
{
_ed.BeginInvoke(config, assemblydir, name, args, null, null);
}
public void Execute(string config, string assemblydir, string name, params object[] args)
{
try
{
var notifications = new XmlDocument();
notifications.Load(config);
var settings = notifications.SelectSingleNode("//global");
var node = notifications.SelectSingleNode(string.Format("//instant//notification [@name = '{0}']", name));
var details = new XmlDocument();
var cont = details.CreateElement("details");
cont.AppendChild(details.ImportNode(settings, true));
cont.AppendChild(details.ImportNode(node, true));
details.AppendChild(cont);
if (node != null)
{
var assemblyFile = string.Format("{0}{1}.dll", assemblydir, node.Attributes["assembly"].Value);
var nAssembly = Assembly.LoadFrom(assemblyFile);
var n = (Notification)Activator.CreateInstance(nAssembly.GetType(node.Attributes["type"].Value));
n.SendNotification(details, args);
}
else
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, 666, "not found");
}
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, 666, e.Message);
}
}
}
}
@@ -0,0 +1,9 @@
using System.Xml;
namespace OurUmbraco.NotificationsCore.Interfaces
{
interface INotification
{
bool SendNotification(XmlNode details, params object[] args);
}
}
@@ -0,0 +1,10 @@
using System.Xml;
using OurUmbraco.NotificationsCore.Interfaces;
namespace OurUmbraco.NotificationsCore
{
public abstract class Notification: INotification
{
public virtual bool SendNotification(XmlNode details, params object[] args) { return false; }
}
}
@@ -1,87 +1,87 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Net.Mail;
namespace NotificationsCore.NotificationTypes
{
public class MarkAsSolutionReminder: Notification
{
public MarkAsSolutionReminder()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
SmtpClient c = new SmtpClient(details.SelectSingleNode("//smtp").InnerText);
c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
string subject = details.SelectSingleNode("//subject").InnerText;
string body = details.SelectSingleNode("//body").InnerText;
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);
string select = @"select id, memberId from forumTopics where answer = 0
and created < getdate() - 7
and created > '2010-06-10 00:00:00'
and id not in (select topicId from notificationMarkAsSolution)
order by created desc;";
SqlCommand comm = new SqlCommand(
select, conn);
conn.Open();
SqlDataReader dr = comm.ExecuteReader();
string domain = details.SelectSingleNode("//domain").InnerText;
while (dr.Read())
{
int topicId = dr.GetInt32(0);
string mbody = string.Format(body,
t.Title,
"https://" + domain + args[1].ToString());
Member m = new Member(dr.GetInt32(1));
if (m.getProperty("bugMeNot") != null || m.getProperty("bugMeNot").Value.ToString() != "1")
{
MailMessage mm = new MailMessage();
mm.Subject = subject;
mm.Body = mbody;
mm.To.Add(m.Email);
mm.From = from;
c.Send(mm);
}
string insert =
"Insert into notificationMarkAsSolution(topicId, memberID, timestamp) values(@topicId, @memberID, getdate())";
SqlCommand icomm = new SqlCommand(insert, conn);
icomm.Parameters.AddWithValue("@topicId", topicId);
icomm.Parameters.AddWithValue("@memberID", m.Id);
icomm.ExecuteNonQuery();
}
conn.Close();
return true;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Net.Mail;
namespace NotificationsCore.NotificationTypes
{
public class MarkAsSolutionReminder: Notification
{
public MarkAsSolutionReminder()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
SmtpClient c = new SmtpClient(details.SelectSingleNode("//smtp").InnerText);
c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
string subject = details.SelectSingleNode("//subject").InnerText;
string body = details.SelectSingleNode("//body").InnerText;
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);
string select = @"select id, memberId from forumTopics where answer = 0
and created < getdate() - 7
and created > '2010-06-10 00:00:00'
and id not in (select topicId from notificationMarkAsSolution)
order by created desc;";
SqlCommand comm = new SqlCommand(
select, conn);
conn.Open();
SqlDataReader dr = comm.ExecuteReader();
string domain = details.SelectSingleNode("//domain").InnerText;
while (dr.Read())
{
int topicId = dr.GetInt32(0);
string mbody = string.Format(body,
t.Title,
"https://" + domain + args[1].ToString());
Member m = new Member(dr.GetInt32(1));
if (m.getProperty("bugMeNot") != null || m.getProperty("bugMeNot").Value.ToString() != "1")
{
MailMessage mm = new MailMessage();
mm.Subject = subject;
mm.Body = mbody;
mm.To.Add(m.Email);
mm.From = from;
c.Send(mm);
}
string insert =
"Insert into notificationMarkAsSolution(topicId, memberID, timestamp) values(@topicId, @memberID, getdate())";
SqlCommand icomm = new SqlCommand(insert, conn);
icomm.Parameters.AddWithValue("@topicId", topicId);
icomm.Parameters.AddWithValue("@memberID", m.Id);
icomm.ExecuteNonQuery();
}
conn.Close();
return true;
}
}
}
@@ -1,83 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Data.SqlClient;
using umbraco.cms.businesslogic.member;
namespace NotificationsCore.NotificationTypes
{
public class MarkAsSolutionReminderSingle : Notification
{
public MarkAsSolutionReminderSingle()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
try
{
SmtpClient c = new SmtpClient(details.SelectSingleNode("//smtp").InnerText);
c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
string subject = details.SelectSingleNode("//subject").InnerText;
string body = details.SelectSingleNode("//body").InnerText;
string domain = details.SelectSingleNode("//domain").InnerText;
int topicId = int.Parse(args[0].ToString());
int memberId = int.Parse(args[1].ToString());
uForum.Businesslogic.Topic t = uForum.Businesslogic.Topic.GetTopic(topicId);
Member m = new Member(memberId);
body = string.Format(body,
t.Title,
"https://" + domain + args[2].ToString());
if (m.getProperty("bugMeNot").Value.ToString() != "1")
{
MailMessage mm = new MailMessage();
mm.Subject = subject;
mm.Body = body;
mm.To.Add(m.Email);
mm.From = from;
c.Send(mm);
}
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);
conn.Open();
string insert =
"Insert into notificationMarkAsSolution(topicId, memberID, timestamp) values(@topicId, @memberID, getdate())";
SqlCommand icomm = new SqlCommand(insert, conn);
icomm.Parameters.AddWithValue("@topicId", topicId);
icomm.Parameters.AddWithValue("@memberID", m.Id);
icomm.ExecuteNonQuery();
conn.Close();
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications]" + e.Message);
}
return true;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Data.SqlClient;
using umbraco.cms.businesslogic.member;
namespace NotificationsCore.NotificationTypes
{
public class MarkAsSolutionReminderSingle : Notification
{
public MarkAsSolutionReminderSingle()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
try
{
SmtpClient c = new SmtpClient(details.SelectSingleNode("//smtp").InnerText);
c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
string subject = details.SelectSingleNode("//subject").InnerText;
string body = details.SelectSingleNode("//body").InnerText;
string domain = details.SelectSingleNode("//domain").InnerText;
int topicId = int.Parse(args[0].ToString());
int memberId = int.Parse(args[1].ToString());
uForum.Businesslogic.Topic t = uForum.Businesslogic.Topic.GetTopic(topicId);
Member m = new Member(memberId);
body = string.Format(body,
t.Title,
"https://" + domain + args[2].ToString());
if (m.getProperty("bugMeNot").Value.ToString() != "1")
{
MailMessage mm = new MailMessage();
mm.Subject = subject;
mm.Body = body;
mm.To.Add(m.Email);
mm.From = from;
c.Send(mm);
}
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);
conn.Open();
string insert =
"Insert into notificationMarkAsSolution(topicId, memberID, timestamp) values(@topicId, @memberID, getdate())";
SqlCommand icomm = new SqlCommand(insert, conn);
icomm.Parameters.AddWithValue("@topicId", topicId);
icomm.Parameters.AddWithValue("@memberID", m.Id);
icomm.ExecuteNonQuery();
conn.Close();
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications]" + e.Message);
}
return true;
}
}
}
@@ -1,113 +1,109 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Data.SqlClient;
using umbraco.cms.businesslogic.member;
using umbraco.presentation.nodeFactory;
using umbraco.cms.businesslogic.web;
using System.Web;
using OurUmbraco.Forum.Models;
namespace NotificationsCore.NotificationTypes
{
public class NewForumTopic: Notification
{
public NewForumTopic()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
try
{
var topic = (Topic)args[0];
string url = (string)args[1];
var memberName = (string)args[2];
if (topic.IsSpam)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, string.Format("[Notifications] Topic ID {0} is marked as spam, no notification sent{0}", topic.Id));
return true;
}
SmtpClient c = new SmtpClient();
//c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
string subject = details.SelectSingleNode("//subject").InnerText;
string body = details.SelectSingleNode("//body").InnerText;
//currently using document api instead of nodefactory
Document forum = new Document(topic.ParentId);
subject = string.Format(subject, forum.Text);
var domain = details.SelectSingleNode("//domain").InnerText;
body = string.Format(body, forum.Text, "https://" + domain + url, memberName, topic.Title, HttpUtility.HtmlDecode(umbraco.library.StripHtml(topic.Body)));
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["umbracoDbDSN"].ConnectionString);
SqlCommand comm = new SqlCommand("Select memberId from forumSubscribers where forumId = @forumId", conn);
comm.Parameters.AddWithValue("@forumId", topic.ParentId);
conn.Open();
SqlDataReader dr = comm.ExecuteReader();
while (dr.Read())
{
int mid = dr.GetInt32(0);
try
{
Member m = new Member(mid);
if (m.Id != topic.MemberId
&& (m.getProperty("bugMeNot").Value.ToString() != "1"))
{
MailMessage mm = new MailMessage();
mm.Subject = subject;
mm.Body = body;
mm.To.Add(m.Email);
mm.From = from;
c.Send(mm);
}
}
catch(Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1,
"[Notifications] Error sending mail to " + mid.ToString() + " " + e.Message);
}
}
conn.Close();
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications]" + e.Message);
}
return true;
}
}
}
using System;
using System.Data.SqlClient;
using System.Net.Mail;
using System.Web;
using OurUmbraco.Forum.Models;
using umbraco.cms.businesslogic.member;
using umbraco.cms.businesslogic.web;
namespace OurUmbraco.NotificationsCore.NotificationTypes
{
public class NewForumTopic: Notification
{
public NewForumTopic()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
try
{
var topic = (Topic)args[0];
string url = (string)args[1];
var memberName = (string)args[2];
if (topic.IsSpam)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, string.Format("[Notifications] Topic ID {0} is marked as spam, no notification sent{0}", topic.Id));
return true;
}
SmtpClient c = new SmtpClient();
//c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
string subject = details.SelectSingleNode("//subject").InnerText;
string body = details.SelectSingleNode("//body").InnerText;
//currently using document api instead of nodefactory
Document forum = new Document(topic.ParentId);
subject = string.Format(subject, forum.Text);
var domain = details.SelectSingleNode("//domain").InnerText;
body = string.Format(body, forum.Text, "https://" + domain + url, memberName, topic.Title, HttpUtility.HtmlDecode(umbraco.library.StripHtml(topic.Body)));
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["umbracoDbDSN"].ConnectionString);
SqlCommand comm = new SqlCommand("Select memberId from forumSubscribers where forumId = @forumId", conn);
comm.Parameters.AddWithValue("@forumId", topic.ParentId);
conn.Open();
SqlDataReader dr = comm.ExecuteReader();
while (dr.Read())
{
int mid = dr.GetInt32(0);
try
{
Member m = new Member(mid);
if (m.Id != topic.MemberId
&& (m.getProperty("bugMeNot").Value.ToString() != "1"))
{
MailMessage mm = new MailMessage();
mm.Subject = subject;
mm.Body = body;
mm.To.Add(m.Email);
mm.From = from;
c.Send(mm);
}
}
catch(Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1,
"[Notifications] Error sending mail to " + mid.ToString() + " " + e.Message);
}
}
conn.Close();
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications]" + e.Message);
}
return true;
}
}
}
@@ -1,107 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Data.SqlClient;
using umbraco.cms.businesslogic.member;
using System.Web;
using OurUmbraco.Forum.Models;
using Umbraco.Core.Models;
using Umbraco.Web;
using Umbraco.Core;
using Umbraco.Web.Security;
namespace NotificationsCore.NotificationTypes
{
public class NewForumTopicComment: Notification
{
public NewForumTopicComment()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
try
{
Comment com = (Comment)args[0];
Topic topic = (Topic)args[1];
string url = (string)args[2];
string memberName = (string)args[3];
if (com.IsSpam)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, string.Format("[Notifications] Comment Id {{0}} is marked as spam, no notification sent{0}", com.Id));
return true;
}
//SMTP SETTINGS
SmtpClient c = new SmtpClient();
//c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
//SENDER ADDRESS
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
//Notification details
var domain = details.SelectSingleNode("//domain").InnerText;
var subject = string.Format(details.SelectSingleNode("//subject").InnerText, topic.Title);
var body = details.SelectSingleNode("//body").InnerText;
body = string.Format(body, topic.Title, "https://" + domain + url + "#comment-" + com.Id, memberName, HttpUtility.HtmlDecode(umbraco.library.StripHtml(com.Body)));
//connect to DB
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["umbracoDbDSN"].ConnectionString);
SqlCommand comm = new SqlCommand("Select memberId from forumTopicSubscribers where topicId = @topicId", conn);
comm.Parameters.AddWithValue("@topicId", topic.Id);
conn.Open();
//shit this must be so fucking slow
SqlDataReader dr = comm.ExecuteReader();
while (dr.Read())
{
int mid = dr.GetInt32(0);
try
{
var m = new umbraco.cms.businesslogic.member.Member(mid);
if (m.Id != com.MemberId
&& m.getProperty("bugMeNot").Value.ToString() != "1")
{
MailMessage mm = new MailMessage();
mm.Subject = subject;
mm.Body = body;
mm.To.Add(m.Email);
mm.From = from;
c.Send(mm);
}
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1,
"[Notifications] Error sending mail to " + mid.ToString() + " " + e.Message);
}
}
conn.Close();
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications]" + e.Message);
}
return true;
}
}
}
using System;
using System.Data.SqlClient;
using System.Net.Mail;
using System.Web;
using OurUmbraco.Forum.Models;
using Notification = OurUmbraco.NotificationsCore.Notification;
namespace OurUmbraco.NotificationsCore.NotificationTypes
{
public class NewForumTopicComment: Notification
{
public NewForumTopicComment()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
try
{
Comment com = (Comment)args[0];
Topic topic = (Topic)args[1];
string url = (string)args[2];
string memberName = (string)args[3];
if (com.IsSpam)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, string.Format("[Notifications] Comment Id {{0}} is marked as spam, no notification sent{0}", com.Id));
return true;
}
//SMTP SETTINGS
SmtpClient c = new SmtpClient();
//c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
//SENDER ADDRESS
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
//Notification details
var domain = details.SelectSingleNode("//domain").InnerText;
var subject = string.Format(details.SelectSingleNode("//subject").InnerText, topic.Title);
var body = details.SelectSingleNode("//body").InnerText;
body = string.Format(body, topic.Title, "https://" + domain + url + "#comment-" + com.Id, memberName, HttpUtility.HtmlDecode(umbraco.library.StripHtml(com.Body)));
//connect to DB
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["umbracoDbDSN"].ConnectionString);
SqlCommand comm = new SqlCommand("Select memberId from forumTopicSubscribers where topicId = @topicId", conn);
comm.Parameters.AddWithValue("@topicId", topic.Id);
conn.Open();
//shit this must be so fucking slow
SqlDataReader dr = comm.ExecuteReader();
while (dr.Read())
{
int mid = dr.GetInt32(0);
try
{
var m = new umbraco.cms.businesslogic.member.Member(mid);
if (m.Id != com.MemberId
&& m.getProperty("bugMeNot").Value.ToString() != "1")
{
MailMessage mm = new MailMessage();
mm.Subject = subject;
mm.Body = body;
mm.To.Add(m.Email);
mm.From = from;
c.Send(mm);
}
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1,
"[Notifications] Error sending mail to " + mid.ToString() + " " + e.Message);
}
}
conn.Close();
}
catch (Exception e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications]" + e.Message);
}
return true;
}
}
}
@@ -1,38 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace NotificationsCore.NotificationTypes
{
public class SampleNotification: Notification
{
public SampleNotification()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
//int i = 0;
//while (i < 10)
//{
// HttpWebRequest request = (HttpWebRequest)
// WebRequest.Create("http://www.google.com");
// // execute the request
// HttpWebResponse response = (HttpWebResponse)
// request.GetResponse();
// i++;
//}
return true;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace NotificationsCore.NotificationTypes
{
public class SampleNotification: Notification
{
public SampleNotification()
{
}
public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
{
//int i = 0;
//while (i < 10)
//{
// HttpWebRequest request = (HttpWebRequest)
// WebRequest.Create("http://www.google.com");
// // execute the request
// HttpWebResponse response = (HttpWebResponse)
// request.GetResponse();
// i++;
//}
return true;
}
}
}
@@ -0,0 +1,44 @@
using System;
using System.Timers;
using System.Xml;
namespace OurUmbraco.NotificationsCore
{
public class SheduledNotification
{
public string Name { get; set; }
public double Interval { get; set; }
public string Assembly { get; set; }
public string Type { get; set; }
public XmlNode Details { get; set; }
readonly Timer _timer = new Timer();
public SheduledNotification(string name, double interval, string assembly, string type, XmlNode details)
{
Name = name;
Interval = interval;
Assembly = assembly;
Type = type;
Details = details;
}
public void Start()
{
_timer.Elapsed += timer_Elapsed;
_timer.Interval = Interval;
_timer.Enabled = true;
}
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
var assemblyFile = string.Format("{0}.dll", Assembly);
var nAssembly = System.Reflection.Assembly.LoadFrom(assemblyFile);
var n = (Notification)Activator.CreateInstance(nAssembly.GetType(Type));
n.SendNotification(Details);
}
}
}
@@ -1,11 +1,10 @@
using NotificationsWeb.Services;
using System.Linq;
using System.Web.Http;
using System.Web.Http;
using OurUmbraco.NotificationsWeb.Services;
using Umbraco.Web.WebApi;
namespace NotificationsWeb.Api
namespace OurUmbraco.NotificationsWeb.Api
{
public class NotificationsController:UmbracoApiController
public class NotificationsController : UmbracoApiController
{
public NotificationsController()
{
+25
View File
@@ -0,0 +1,25 @@
namespace OurUmbraco.NotificationsWeb
{
public class Config
{
private static readonly string Path = umbraco.GlobalSettings.FullpathToRoot + System.IO.Path.DirectorySeparatorChar + "config" + System.IO.Path.DirectorySeparatorChar;
private static string _filename = "Notification.config";
public static string AssemblyDir
{
get
{
return umbraco.GlobalSettings.FullpathToRoot + System.IO.Path.DirectorySeparatorChar + "bin" + System.IO.Path.DirectorySeparatorChar;
}
}
public static string ConfigurationFile
{
get
{
return Path + _filename;
}
}
}
}
@@ -1,92 +1,87 @@
using System;
using System.Collections.Generic;
using System.Text;
using NotificationsCore;
using umbraco.presentation.nodeFactory;
using umbraco.cms.businesslogic.member;
using Umbraco.Core;
using NotificationsWeb.Services;
using OurUmbraco.Forum;
using OurUmbraco.Forum.Services;
using Umbraco.Web.Security;
namespace NotificationsWeb.EventHandlers
{
public class Forum : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
//sub comment author to topic
CommentService.Created += CommentService_Created;
//sub owner to topic
TopicService.Created += TopicService_Created;
//If its a project forum, subscribe the owner to all topics
ForumService.Created += ForumService_Created;
//remove all forum subs
ForumService.Deleted += ForumService_Deleted;
}
void ForumService_Deleted(object sender, ForumEventArgs e)
{
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
ns.RemoveAllForumSubscriptions(e.Forum.Id);
}
void ForumService_Created(object sender, ForumEventArgs e)
{
var content = Umbraco.Web.UmbracoContext.Current.Application.Services.ContentService.GetById(e.Forum.ParentId);
if (content.ContentType.Alias == "Project")
{
var owner = content.GetValue<int>("owner");
//NotificationsWeb.BusinessLogic.Forum.Subscribe(e.Forum.Id, owner);
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
ns.SubscribeToForum(e.Forum.Id, owner);
}
}
void TopicService_Created(object sender, TopicEventArgs e)
{
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
ns.SubscribeToForumTopic(e.Topic.Id, e.Topic.MemberId);
//send notification
InstantNotification not = new InstantNotification();
//data for notification:
var membershipHelper = new MembershipHelper(Umbraco.Web.UmbracoContext.Current);
var member = membershipHelper.GetById(e.Topic.MemberId);
var memberName = string.Empty;
if (member != null)
memberName = member.Name;
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewTopic", e.Topic, e.Topic.GetUrl(), memberName);
}
void CommentService_Created(object sender, CommentEventArgs e)
{
var ts = new TopicService(ApplicationContext.Current.DatabaseContext);
//Subscribe to topic
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
ns.SubscribeToForumTopic(e.Comment.TopicId, e.Comment.MemberId);
//data for notification:
var membershipHelper = new MembershipHelper(Umbraco.Web.UmbracoContext.Current);
var member = membershipHelper.GetById(e.Comment.MemberId);
var memberName = string.Empty;
if (member != null)
memberName = member.Name;
var topic = ts.GetById(e.Comment.TopicId);
//send notifications
InstantNotification not = new InstantNotification();
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewComment", e.Comment, topic, topic.GetUrl(), memberName);
}
}
}
using OurUmbraco.Forum;
using OurUmbraco.Forum.Services;
using OurUmbraco.NotificationsCore;
using OurUmbraco.NotificationsWeb.Services;
using Umbraco.Core;
using Umbraco.Web.Security;
namespace OurUmbraco.NotificationsWeb.EventHandlers
{
public class Forum : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
//sub comment author to topic
CommentService.Created += CommentService_Created;
//sub owner to topic
TopicService.Created += TopicService_Created;
//If its a project forum, subscribe the owner to all topics
ForumService.Created += ForumService_Created;
//remove all forum subs
ForumService.Deleted += ForumService_Deleted;
}
void ForumService_Deleted(object sender, ForumEventArgs e)
{
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
ns.RemoveAllForumSubscriptions(e.Forum.Id);
}
void ForumService_Created(object sender, ForumEventArgs e)
{
var content = Umbraco.Web.UmbracoContext.Current.Application.Services.ContentService.GetById(e.Forum.ParentId);
if (content.ContentType.Alias == "Project")
{
var owner = content.GetValue<int>("owner");
//NotificationsWeb.BusinessLogic.Forum.Subscribe(e.Forum.Id, owner);
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
ns.SubscribeToForum(e.Forum.Id, owner);
}
}
void TopicService_Created(object sender, TopicEventArgs e)
{
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
ns.SubscribeToForumTopic(e.Topic.Id, e.Topic.MemberId);
//send notification
InstantNotification not = new InstantNotification();
//data for notification:
var membershipHelper = new MembershipHelper(Umbraco.Web.UmbracoContext.Current);
var member = membershipHelper.GetById(e.Topic.MemberId);
var memberName = string.Empty;
if (member != null)
memberName = member.Name;
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewTopic", e.Topic, e.Topic.GetUrl(), memberName);
}
void CommentService_Created(object sender, CommentEventArgs e)
{
var ts = new TopicService(ApplicationContext.Current.DatabaseContext);
//Subscribe to topic
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
ns.SubscribeToForumTopic(e.Comment.TopicId, e.Comment.MemberId);
//data for notification:
var membershipHelper = new MembershipHelper(Umbraco.Web.UmbracoContext.Current);
var member = membershipHelper.GetById(e.Comment.MemberId);
var memberName = string.Empty;
if (member != null)
memberName = member.Name;
var topic = ts.GetById(e.Comment.TopicId);
//send notifications
InstantNotification not = new InstantNotification();
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewComment", e.Comment, topic, topic.GetUrl(), memberName);
}
}
}
@@ -1,26 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.web;
using NotificationsCore;
namespace NotificationsWeb.EventHandlers
{
public class Test: ApplicationBase
{
public Test()
{
//Document.AfterPublish += new Document.PublishEventHandler(Document_AfterPublish);
}
void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
{
InstantNotification not = new InstantNotification();
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewComment", sender);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.web;
using NotificationsCore;
namespace NotificationsWeb.EventHandlers
{
public class Test: ApplicationBase
{
public Test()
{
//Document.AfterPublish += new Document.PublishEventHandler(Document_AfterPublish);
}
void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
{
InstantNotification not = new InstantNotification();
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewComment", sender);
}
}
}
@@ -1,15 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.XPath;
using System.Xml;
using NotificationsWeb.Services;
using OurUmbraco.NotificationsWeb.Services;
using Umbraco.Core;
namespace NotificationsWeb.Library
namespace OurUmbraco.NotificationsWeb.Library
{
//used from razor //
public class Utils
{
@@ -17,7 +10,6 @@ namespace NotificationsWeb.Library
{
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
return ns.IsSubscribedToForum(forumId, memberId);
}
public static bool IsSubscribedToForumTopic(int topicId, int memberId)
@@ -25,6 +17,5 @@ namespace NotificationsWeb.Library
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
return ns.IsSubscribedToTopic(topicId, memberId);
}
}
}
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence;
namespace NotificationsWeb.Models
namespace OurUmbraco.NotificationsWeb.Models
{
[TableName("forumSubscribers")]
public class ForumSubscriber
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence;
namespace NotificationsWeb.Models
namespace OurUmbraco.NotificationsWeb.Models
{
[TableName("forumTopicSubscribers")]
public class ForumTopicSubscriber
@@ -1,13 +1,9 @@
using NotificationsWeb.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using OurUmbraco.NotificationsWeb.Models;
using Umbraco.Core;
using Umbraco.Core.Persistence;
namespace NotificationsWeb.Services
namespace OurUmbraco.NotificationsWeb.Services
{
public class NotificationService
{
@@ -19,7 +15,6 @@ namespace NotificationsWeb.Services
_databaseContext = dbContext;
}
public void SubscribeToForumTopic(int topicId, int memberId)
{
var r = _databaseContext.Database.SingleOrDefault<ForumTopicSubscriber>(
@@ -29,13 +24,14 @@ namespace NotificationsWeb.Services
if(r == null)
{
var rec = new ForumTopicSubscriber();
rec.MemberId = memberId;
rec.TopicId = topicId;
var rec = new ForumTopicSubscriber
{
MemberId = memberId,
TopicId = topicId
};
_databaseContext.Database.Insert(rec);
}
}
public void UnSubscribeFromForumTopic(int topicId, int memberId)
@@ -43,8 +39,7 @@ namespace NotificationsWeb.Services
_databaseContext.Database.Delete<ForumTopicSubscriber>(
"Where topicId=@0 and memberId=@1",
topicId,
memberId);
memberId);
}
public void RemoveAllTopicSubscriptions(int topicId)
@@ -60,8 +55,8 @@ namespace NotificationsWeb.Services
"SELECT * FROM forumtopicsubscribers WHERE topicId=@0 and memberId=@1",
topicId,
memberId) != null;
}
public void SubscribeToForum(int forumId, int memberId)
{
var r = _databaseContext.Database.SingleOrDefault<ForumSubscriber>(
@@ -101,6 +96,7 @@ namespace NotificationsWeb.Services
forumId,
memberId) != null;
}
public Page<ForumSubscriber> GetForumSubscriptionsFromMember(int memberId, long take = 50, long page = 1)
{
var sql = new Sql()
@@ -110,7 +106,6 @@ namespace NotificationsWeb.Services
sql.Where<ForumSubscriber>(x => x.MemberId == memberId);
return _databaseContext.Database.Page<ForumSubscriber>(page, take, sql);
}
public long GetNumberOfForumSubscriptionsFromMember(int memberId)
@@ -127,13 +122,11 @@ namespace NotificationsWeb.Services
sql.Where<ForumTopicSubscriber>(x => x.MemberId == memberId);
return _databaseContext.Database.Page<ForumTopicSubscriber>(page, take, sql);
}
public long GetNumberOfTopicSubscriptionsFromMember(int memberId)
{
return _databaseContext.Database.ExecuteScalar<long>("SELECT Count(*) FROM forumTopicSubscribers where memberId=@0",memberId);
}
}
}
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NotificationsWeb
namespace OurUmbraco.NotificationsWeb
{
public class Singleton<T> where T : class, new()
{
+20
View File
@@ -361,6 +361,20 @@
<Compile Include="MarketPlace\Providers\ProjectTag.cs" />
<Compile Include="MarketPlace\Providers\UmbracoCategoryProvider.cs" />
<Compile Include="MarketPlace\Providers\UmbracoProjectTagProvider.cs" />
<Compile Include="NotificationsCore\InstantNotification.cs" />
<Compile Include="NotificationsCore\Interfaces\INotification.cs" />
<Compile Include="NotificationsCore\Notification.cs" />
<Compile Include="NotificationsCore\NotificationTypes\NewForumTopic.cs" />
<Compile Include="NotificationsCore\NotificationTypes\NewForumTopicComment.cs" />
<Compile Include="NotificationsCore\SheduledNotification.cs" />
<Compile Include="NotificationsWeb\Api\NotificationsController.cs" />
<Compile Include="NotificationsWeb\Config.cs" />
<Compile Include="NotificationsWeb\EventHandlers\Forum.cs" />
<Compile Include="NotificationsWeb\Library\Utils.cs" />
<Compile Include="NotificationsWeb\Models\ForumSubscriber.cs" />
<Compile Include="NotificationsWeb\Models\ForumTopicSubscriber.cs" />
<Compile Include="NotificationsWeb\Services\NotificationService.cs" />
<Compile Include="NotificationsWeb\Singleton.cs" />
<Compile Include="Our\Api\CommunityController.cs" />
<Compile Include="Our\Api\SearchController.cs" />
<Compile Include="Our\Businesslogic\ProjectContributor.cs" />
@@ -688,6 +702,12 @@
<Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<VSToolsPath Condition="exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets')">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0</VSToolsPath>
<VSToolsPath Condition="exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets')">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0</VSToolsPath>
<VSToolsPath Condition="exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets')">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0</VSToolsPath>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>XCOPY "$(ProjectDir)Project\usercontrols\Deli\*.ascx" "$(ProjectDir)..\OurUmbraco.Site\usercontrols\Deli" /y /s
XCOPY "$(ProjectDir)Our\usercontrols\*.ascx" "$(ProjectDir)..\OurUmbraco.Site\usercontrols\our.umbraco.org" /y</PostBuildEvent>
+2 -26
View File
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OurUmbraco.Site", "OurUmbraco.Site\OurUmbraco.Site.csproj", "{911907FB-3B9D-4E5F-9A45-16700A451A54}"
EndProject
@@ -10,10 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notification", "Notification\Notification.csproj", "{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotificationsWeb", "NotificationsWeb\NotificationsWeb.csproj", "{6CF53D68-BD81-47BB-8F56-350A1B04F114}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{F3A30EFB-C5EA-460A-A591-8FBD7176B131}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.exe = .nuget\NuGet.exe
@@ -41,26 +37,6 @@ Global
{911907FB-3B9D-4E5F-9A45-16700A451A54}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{911907FB-3B9D-4E5F-9A45-16700A451A54}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{911907FB-3B9D-4E5F-9A45-16700A451A54}.Release|x86.ActiveCfg = Release|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Debug|x86.ActiveCfg = Debug|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Release|Any CPU.Build.0 = Release|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}.Release|x86.ActiveCfg = Release|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Debug|x86.ActiveCfg = Debug|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Release|Any CPU.Build.0 = Release|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6CF53D68-BD81-47BB-8F56-350A1B04F114}.Release|x86.ActiveCfg = Release|Any CPU
{A8E5C936-ECAB-45B3-BFDA-D12F680EB2A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8E5C936-ECAB-45B3-BFDA-D12F680EB2A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8E5C936-ECAB-45B3-BFDA-D12F680EB2A6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU