- publisher.zip
- Sumeru.Publisher.FTPPublisher
- Sumeru.Publisher.Loader
- Sumeru.Publisher
|
using System;
namespace Sumeru.Publisher.FTPPublisher
{
/// <summary>
/// A Simple Plugin Class
/// </summary>
public class FTPPublisherPlugin : Sumeru.Publisher.Framework.IPublisher
{
private System.Collections.Hashtable ht=new System.Collections.Hashtable();
/// <summary>
/// To publish data
/// </summary>
public void Put()
{
//Put your data
//Note: Implement proper error handling for invalid parameters
string host=(string)ht["Host"];
string port=(string)ht["Port"];
System.Windows.Forms.MessageBox.Show("Putting File To " + host + "," + port);
//Write Your own ftp code to put file
}
/// <summary>
/// To retreive data
/// </summary>
public void Get()
{
//Get your data
//Note: Implement proper error handling for invalid parameters
string host=(string)ht["Host"];
string port=(string)ht["Port"];
System.Windows.Forms.MessageBox.Show("Getting File from " + host + "," + port);
//Write Your own ftp code to get file
}
/// <summary>
/// Function called by publisher factory to pass the settings
/// </summary>
/// <param name="settings">
/// </param>
public void Init(Sumeru.Publisher.Framework.Data.SettingCollection settings)
{
//Keep our settings locally in a hash table
//Implement proper error handling for duplicate keys
foreach(Framework.Data.Setting s in settings)
{
ht.Add(s.Key,s.Value);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#