|
using System;
using System.Collections.Generic;
using System.Text;
using System.Workflow.Activities;
using System.Workflow.Runtime;
using System.Data;
namespace MVDataService
{
public sealed class MVDataConnector : IMVDataService
{
private DataSet _dataValue = null;
private static WorkflowMVDataService _service = null;
private static object _syncLock = new object();
public static WorkflowMVDataService MVDataService
{
get { return _service; }
set
{
if (value != null)
{
lock (_syncLock)
{
// Re-verify the service isn't null
// now that we're locked...
if (value != null)
{
_service = value;
} // if
else
{
throw new InvalidOperationException("You must provide a service instance.");
} // else
} // lock
} // if
else
{
throw new InvalidOperationException("You must provide a service instance.");
} // else
}
}
public DataSet MVData
{
get { return _dataValue; }
}
// Workflow to host communication method
public void MVDataUpdate(DataSet mvData)
{
// Assign the field for later recall
_dataValue = mvData;
// Raise the event to trigger host read
_service.RaiseMVDataUpdateEvent();
}
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.