本文整理汇总了C#中DatabaseHandle类的典型用法代码示例。如果您正苦于以下问题:C# DatabaseHandle类的具体用法?C# DatabaseHandle怎么用?C# DatabaseHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseHandle类属于命名空间,在下文中一共展示了DatabaseHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EntityGroundVehicle
public EntityGroundVehicle(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Object = objectHandle;
this.Transaction = transactionHandle;
}
示例2: EntityEquipmentSensorCBRNAP2Ce
public EntityEquipmentSensorCBRNAP2Ce(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Object = objectHandle;
this.Transaction = transactionHandle;
}
示例3: EntityEquipment
public EntityEquipment(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Object = objectHandle;
this.Transaction = TransactionHandle.None;
}
示例4: WISEObject
public WISEObject(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Object = objectHandle;
this.Transaction = transactionHandle;
}
示例5: OnCloseDatabase
protected override WISE_RESULT OnCloseDatabase(DatabaseHandle hDatabase)
{
WISE_RESULT result = WISEError.WISE_OK;
// Call base class implementation
result = base.OnCloseDatabase(hDatabase);
WISEError.CheckCallFailedEx(result);
//
// TODO: Close driver communication for the specified database.
//
_serviceHost.Close();
return WISEError.WISE_OK;
}
示例6: CreateInstance
public uint CreateInstance(INETWISEDriverSink2 WISE, DatabaseHandle hDatabase, string objectName)
{
uint result = WISEError.WISE_ERROR;
ObjectHandle objectHandle = this.Object;
if (WISE == null)
{
result = WISEError.WISE_E_INVALID_ARG;
return result;
}
if (objectHandle == WISEConstants.WISE_INVALID_HANDLE)
{
// Create object from template, if none exist.
Dictionary<string, AttributeHandle> attributes = new Dictionary<string, AttributeHandle>(); // it's set from Template
result = WISE.CreateObjectFromTemplate(hDatabase, objectName, EntityGroundVehicle.ClassName, ref objectHandle, ref attributes);
}
if (WISEError.CheckCallSucceeded(result))
{
this.WISE = WISE;
this.Database = WISEConstants.WISE_INVALID_HANDLE;
this.Object = objectHandle;
}
return result;
}
示例7: EntityEquipmentSensorCBRNI28
public EntityEquipmentSensorCBRNI28(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle)
: base(WISE, databaseHandle, objectHandle)
{
}
示例8: CreateInstance
public WISE_RESULT CreateInstance(INETWISEDriverSink sink, DatabaseHandle hDatabase)
{
return CreateInstance(sink, hDatabase, "");
}
示例9: EntityEquipmentSensorCBRNLCD
public EntityEquipmentSensorCBRNLCD(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
: base(WISE, databaseHandle, objectHandle, transactionHandle)
{
}
示例10: OnSendEvent
protected override WISE_RESULT OnSendEvent(DateTime timeStamp, DatabaseHandle hDatabase, EventHandle hEvent,
ClassHandle hClass, TransactionHandle hTransaction)
{
WISE_RESULT result = WISEError.WISE_OK;
// Call base class implementation
result = base.OnSendEvent(timeStamp, hDatabase, hEvent, hClass, hTransaction);
WISEError.CheckCallFailedEx(result);
try
{
//
// TODO: Send event on driver communication interface.
//
// This method typically needs to perform the following steps;
// 1. Identify the type of event.
// 2. Based on the event type, extract event attributes.
// 3. Fill event attribute values into the protocol container associated with the event.
// 4. Send the event on the underlying protocol.
//
#region Sample code: Check event type
//ClassHandle hTestEventClass = ClassHandle.Invalid;
//// Get handle corresponding to class "TEST_EVENT" (this can be done once and then cached)
//result = this.WISETypeInfo.GetWISEClassHandle(hDatabase, "TEST_EVENT", ref hTestEventClass);
//WISEError.CheckCallFailedEx(result);
//if (hClass == hTestEventClass)
//{
// #region Sample code: Access TEST_EVENT attributes
// string stringAttributeValue = "";
// AttributeHandle hAttr = AttributeHandle.Invalid;
// result = this.Sink.GetEventAttributeHandle(hDatabase, hEvent, "TEST_STRING", ref hAttr);
// WISEError.CheckCallFailedEx(result);
// result = this.Sink.GetEventAttributeValue(hDatabase, hEvent, hAttr, ref stringAttributeValue);
// WISEError.CheckCallFailedEx(result);
// #endregion
//}
#endregion
}
catch (WISEException ex)
{
result = ex.Error.ErrorCode;
}
return result;
}
示例11: OnCreateDatabase
protected override WISE_RESULT OnCreateDatabase(string strDatabaseName, DatabaseHandle hDatabase,
DatabaseHandle hTemplateDatabase, DatabaseDistType eDatabaseDistType, DatabaseType eDatabaseType,
OwnershipMode eModeOwnership, AttributeQualityMode eModeAttributeQuality,
AttributeTimeMode eModeAttributeTime)
{
WISE_RESULT result = WISEError.WISE_OK;
// Call base class implementation
result = base.OnCreateDatabase(strDatabaseName, hDatabase, hTemplateDatabase, eDatabaseDistType,
eDatabaseType, eModeOwnership, eModeAttributeQuality, eModeAttributeTime);
WISEError.CheckCallFailedEx(result);
if (eDatabaseType == DatabaseType.Application)
{
//
// TODO: Open driver communication for the specified database.
//
Uri baseAddress = new Uri(string.Format("{0}:{1}", _baseAddress, _port));
IService service = new Service(this.WISE, hDatabase);
_serviceHost = new WebServiceHost(service, baseAddress);
ServiceEndpoint serviceEndpoint = _serviceHost.AddServiceEndpoint(typeof(IService), new WebHttpBinding(), "");
WebHttpBehavior webHttpBehavior = _serviceHost.Description.Behaviors.Find<WebHttpBehavior>();
if (webHttpBehavior != null)
{
webHttpBehavior.AutomaticFormatSelectionEnabled = true;
}
else
{
WebHttpBehavior webBehavior = new WebHttpBehavior();
webBehavior.AutomaticFormatSelectionEnabled = true;
serviceEndpoint.Behaviors.Add(webBehavior);
}
//
// Enable metadata
//
//ServiceMetadataBehavior metadataBehavior = new ServiceMetadataBehavior();
//metadataBehavior.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
//metadataBehavior.HttpGetEnabled = true;
//_serviceHost.Description.Behaviors.Add(metadataBehavior);
//_serviceHost.AddServiceEndpoint(typeof(IMetadataExchange),
//MetadataExchangeBindings.CreateMexHttpBinding(), "mex");
//WebHttpBinding webHttpBinding = new WebHttpBinding();
//webHttpBinding.
//_serviceHost.AddServiceEndpoint(typeof(IService), webHttpBinding, "");
// Initialize generated code.
// TODO: handle error code
Model.InitializeModel(this.WISE);
_serviceHost.Open();
}
return WISEError.WISE_OK;
}
示例12: CBRNLCDControl
public CBRNLCDControl(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, EventHandle eventHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Handle = eventHandle;
}
示例13: CreateInstance
public uint CreateInstance(INETWISEDriverSink2 WISE, DatabaseHandle hDatabase)
{
uint result = WISEError.WISE_ERROR;
EventHandle eventHandle = this.Handle;
if (WISE == null)
{
result = WISEError.WISE_E_INVALID_ARG;
return result;
}
if (eventHandle == WISEConstants.WISE_INVALID_HANDLE)
{
// Create event from template, if none exist.
Dictionary<string, AttributeHandle> attributes = new Dictionary<string, AttributeHandle>();
result = WISE.CreateEventFromTemplate(hDatabase, CBRNLCDControl.ClassName, ref eventHandle, ref attributes);
}
if (WISEError.CheckCallSucceeded(result))
{
this.WISE = WISE;
this.Database = WISEConstants.WISE_INVALID_HANDLE;
this.Handle = eventHandle;
}
return result;
}
示例14: EntityEquipmentSensor
public EntityEquipmentSensor(INETWISEDriverSink sink, DatabaseHandle databaseHandle, ObjectHandle objectHandle)
{
this.WISESink = sink;
this.Database = databaseHandle;
this.Handle = objectHandle;
}
示例15: AddToDatabase
public abstract WISE_RESULT AddToDatabase(DatabaseHandle databaseHandle);