* NpgsqlCircleProvider.cs: implements a Circle provider
* NpgsqlContentProvider.csproj: new circle provider * CircleManager.cs: initializes the default provider * CircleProvider.cs: Makes abstract the CircleProvider class
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
2015-06-10 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlCircleProvider.cs: implements a Circle provider
|
||||
|
||||
* NpgsqlContentProvider.csproj: new circle provider
|
||||
|
||||
2015-06-09 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlContentProvider.csproj: Helps to fix packaging, and
|
||||
|
97
NpgsqlContentProvider/NpgsqlCircleProvider.cs
Normal file
97
NpgsqlContentProvider/NpgsqlCircleProvider.cs
Normal file
@ -0,0 +1,97 @@
|
||||
//
|
||||
// NpgsqlCircleProvider.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
using Yavsc.Model.Circles;
|
||||
using System.Collections.Specialized;
|
||||
using System.Configuration;
|
||||
|
||||
namespace WorkFlowProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Npgsql circle provider.
|
||||
/// </summary>
|
||||
public class NpgsqlCircleProvider : CircleProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WorkFlowProvider.NpgsqlCircleProvider"/> class.
|
||||
/// </summary>
|
||||
public NpgsqlCircleProvider ()
|
||||
{
|
||||
}
|
||||
|
||||
#region implemented abstract members of CircleProvider
|
||||
/// <summary>
|
||||
/// Add the specified owner, title and users.
|
||||
/// </summary>
|
||||
/// <param name="owner">Owner.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
/// <param name="users">Users.</param>
|
||||
public override void Add (string owner, string title, string[] users)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Delete the specified owner and title.
|
||||
/// </summary>
|
||||
/// <param name="owner">Owner.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
public override void Delete (string owner, string title)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get the specified owner and title.
|
||||
/// </summary>
|
||||
/// <param name="owner">Owner.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
public override Circle Get (string owner, string title)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
/// <summary>
|
||||
/// List this instance.
|
||||
/// </summary>
|
||||
public override CircleInfoCollection List ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
string cnxstr = null;
|
||||
string applicationName = null;
|
||||
/// <summary>
|
||||
/// Initialize this object using the specified name and config.
|
||||
/// </summary>
|
||||
/// <param name="name">Name.</param>
|
||||
/// <param name="config">Config.</param>
|
||||
public override void Initialize (string name, NameValueCollection config)
|
||||
{
|
||||
if ( string.IsNullOrWhiteSpace(config ["connectionStringName"]))
|
||||
throw new ConfigurationErrorsException ("No name for Npgsql connection string found");
|
||||
|
||||
cnxstr = ConfigurationManager.ConnectionStrings [config ["connectionStringName"]].ConnectionString;
|
||||
applicationName = config["applicationName"] ?? "/";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +47,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="NpgsqlContentProvider.cs" />
|
||||
<Compile Include="NpgsqlCircleProvider.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
@ -1,3 +1,9 @@
|
||||
2015-06-10 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* CircleManager.cs: initializes the default provider
|
||||
|
||||
* CircleProvider.cs: Makes abstract the CircleProvider class
|
||||
|
||||
2015-06-10 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* Circle.cs:
|
||||
|
@ -66,8 +66,10 @@ namespace Yavsc.Model.Circles
|
||||
ProviderSettingsCollection providerSettings =
|
||||
pSection.Providers;
|
||||
if (pSection.DefaultProvider != null) {
|
||||
ConstructorInfo ci = Type.GetType (providerSettings [pSection.DefaultProvider].Type).GetConstructor (Type.EmptyTypes);
|
||||
var pSetDef = providerSettings [pSection.DefaultProvider];
|
||||
ConstructorInfo ci = Type.GetType (pSetDef.Type).GetConstructor (Type.EmptyTypes);
|
||||
defaultProvider = ci.Invoke (Type.EmptyTypes) as CircleProvider;
|
||||
defaultProvider.Initialize (pSection.DefaultProvider,pSetDef.Parameters);
|
||||
}
|
||||
/*
|
||||
|
||||
|
@ -31,43 +31,35 @@ namespace Yavsc.Model.Circles
|
||||
/// <summary>
|
||||
/// Circle provider.
|
||||
/// </summary>
|
||||
public class CircleProvider: ProviderBase
|
||||
public abstract class CircleProvider: ProviderBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Add the specified title and users.
|
||||
/// Add the specified owner, title and users.
|
||||
/// </summary>
|
||||
/// <param name="owner">Owner.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
/// <param name="users">Users.</param>
|
||||
public void Add(string owner, string title, string [] users)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Delete the specified id.
|
||||
/// </summary>
|
||||
/// <param name="title">Title.</param>
|
||||
public void Delete(string owner, string title)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
public abstract void Add(string owner, string title, string [] users);
|
||||
|
||||
/// <summary>
|
||||
/// Get the specified id.
|
||||
/// Delete the specified owner and title.
|
||||
/// </summary>
|
||||
/// <param name="owner">Owner.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
public Circle Get(string owner, string title)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
public abstract void Delete(string owner, string title) ;
|
||||
|
||||
/// <summary>
|
||||
/// Get the specified owner and title.
|
||||
/// </summary>
|
||||
/// <param name="owner">Owner.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
public abstract Circle Get(string owner, string title);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// List this instance.
|
||||
/// </summary>
|
||||
public CircleInfoCollection List()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
public abstract CircleInfoCollection List();
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user