• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DatabaseHandle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DatabaseHandle的典型用法代码示例。如果您正苦于以下问题:C# DatabaseHandle类的具体用法?C# DatabaseHandle怎么用?C# DatabaseHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DatabaseHandle类属于命名空间,在下文中一共展示了DatabaseHandle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:7,代码来源:Entity.GroundVehicle.cs


示例2: EntityEquipmentSensorCBRNAP2Ce

 public EntityEquipmentSensorCBRNAP2Ce(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
 {
     this.WISE = WISE;
     this.Database = databaseHandle;
     this.Object = objectHandle;
     this.Transaction = transactionHandle;
 }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:7,代码来源:EntityEquipment.Sensor.CBRN.AP2Ce.cs


示例3: EntityEquipment

 public EntityEquipment(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle)
 {
     this.WISE = WISE;
     this.Database = databaseHandle;
     this.Object = objectHandle;
     this.Transaction = TransactionHandle.None;
 }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:7,代码来源:EntityEquipment.cs


示例4: WISEObject

 public WISEObject(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
 {
     this.WISE = WISE;
     this.Database = databaseHandle;
     this.Object = objectHandle;
     this.Transaction = transactionHandle;
 }
开发者ID:Durlek,项目名称:SAAB-CM,代码行数:7,代码来源:WISEObject.cs


示例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;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:16,代码来源:CBRNSensorsDriver.cs


示例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;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:27,代码来源:Entity.GroundVehicle.cs


示例7: EntityEquipmentSensorCBRNI28

 public EntityEquipmentSensorCBRNI28(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle)
     : base(WISE, databaseHandle, objectHandle)
 {
 }
开发者ID:Durlek,项目名称:SAAB-CM,代码行数:4,代码来源:EntityEquipment.Sensor.CBRN.I28.cs


示例8: CreateInstance

 public WISE_RESULT CreateInstance(INETWISEDriverSink sink, DatabaseHandle hDatabase)
 {
     return CreateInstance(sink, hDatabase, "");
 }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:4,代码来源:EntityGroundVehicle.cs


示例9: EntityEquipmentSensorCBRNLCD

 public EntityEquipmentSensorCBRNLCD(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
     : base(WISE, databaseHandle, objectHandle, transactionHandle)
 {
 }
开发者ID:Durlek,项目名称:SAAB-CM,代码行数:4,代码来源:EntityEquipment.Sensor.CBRN.LCD.cs


示例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;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:49,代码来源:CBRNSensorsDriver.cs


示例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;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:64,代码来源:CBRNSensorsDriver.cs


示例12: CBRNLCDControl

 public CBRNLCDControl(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, EventHandle eventHandle)
 {
     this.WISE = WISE;
     this.Database = databaseHandle;
     this.Handle = eventHandle;
 }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:6,代码来源:CBRN.LCDControl.cs


示例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;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:27,代码来源:CBRN.LCDControl.cs


示例14: EntityEquipmentSensor

 public EntityEquipmentSensor(INETWISEDriverSink sink, DatabaseHandle databaseHandle, ObjectHandle objectHandle)
 {
     this.WISESink = sink;
     this.Database = databaseHandle;
     this.Handle = objectHandle;
 }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:6,代码来源:EntityEquipmentSensor.cs


示例15: AddToDatabase

		public abstract WISE_RESULT AddToDatabase(DatabaseHandle databaseHandle);
开发者ID:Durlek,项目名称:SAAB-CM,代码行数:1,代码来源:WISEObject.cs


示例16: CreateInstance

		public abstract WISE_RESULT CreateInstance(INETWISEDriverSink2 WISE, DatabaseHandle hDatabase, string objectName);
开发者ID:Durlek,项目名称:SAAB-CM,代码行数:1,代码来源:WISEObject.cs


示例17: OnCommitTransaction

        protected override WISE_RESULT OnCommitTransaction(System.DateTime timeStamp, DatabaseHandle hDatabase, TransactionHandle hTransaction,
                ObjectHandleList newObjects, ObjectHandleList removedObjects, Dictionary<ObjectHandle, List<AttributeHandle>> dictNewAttributes,
                Dictionary<ObjectHandle, List<AttributeHandle>> dictRemovedAttributes,
                Dictionary<ObjectHandle, List<AttributeHandle>> dictUpdatedAttributes, List<EventHandle> newEvents)
        {
            //
            // TODO:
            //      If your protocol handles transactions, process the transaction data here.
            //      Returning WISE_E_NOT_IMPL from this method will trigger the driver base class to use the
            //      fallback behaviour where each change in the transaction is processed individually
            //      through calls to OnAddObject, OnRemoveObject, OnNewAttribute, OnRemoveAttribute,
            //      OnUpdateAttribute and OnSendEvent respectively.
            //

            return WISEError.WISE_E_NOT_IMPL;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:16,代码来源:CBRNSensorsDriver.cs


示例18: SendEventToDatabase

        public uint SendEventToDatabase(DatabaseHandle databaseHandle)
        {
            uint result = WISEError.WISE_ERROR;

            if (this.WISE == null)
            {
                result = WISEError.WISE_E_INVALID_ARG;
                return result;
            }

            result = this.WISE.SendEvent(databaseHandle, this.Handle);

            if (WISEError.CheckCallSucceeded(result))
            {
                this.Database = databaseHandle;
            }
            return result;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:18,代码来源:CBRN.LCDControl.cs


示例19: OnConnectDatabase

        protected override WISE_RESULT OnConnectDatabase(string strDatabaseName, DatabaseHandle hDatabase,
            DatabaseDistType eDatabaseDistType, DatabaseType eDatabaseType, OwnershipMode eModeOwnership,
            AttributeQualityMode eModeAttributeQuality, AttributeTimeMode eModeAttributeTime)
        {
            WISE_RESULT result = WISEError.WISE_OK;

            // Implementation of this method is optional.

            // Call base class implementation
            result = base.OnConnectDatabase(strDatabaseName, hDatabase, eDatabaseDistType, eDatabaseType,
                                eModeOwnership, eModeAttributeQuality, eModeAttributeTime);
            WISEError.CheckCallFailedEx(result);

            if (eDatabaseType == DatabaseType.Application)
            {
                //
                // TODO: Open driver communication for the specified database.
                //
            }

            return WISEError.WISE_OK;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:22,代码来源:CBRNSensorsDriver.cs


示例20: OnUpdateAttribute

        protected override WISE_RESULT OnUpdateAttribute(DateTime timeStamp, DatabaseHandle hDatabase, ObjectHandle hObject,
            ClassHandle hClass, AttributeHandle hAttribute, object value, AttributeQualityCode quality,
            TransactionHandle hTransaction)
        {
            WISE_RESULT result = WISEError.WISE_OK;

            // Call base class implementation
            result = base.OnUpdateAttribute(timeStamp, hDatabase, hObject, hClass, hAttribute, value, quality, hTransaction);
            WISEError.CheckCallFailedEx(result);

            //string myValue = string.Empty;
            //AttributeHandle myAttributeHandle = AttributeHandle.Invalid;
            //this.WISE.GetAttributeHandle(hDatabase, hObject, "SomeAttribute", ref myAttributeHandle);
            //this.WISE.GetAttributeValue(hDatabase, hObject, myAttributeHandle, ref myValue);

            //global::CBRNSensors.EntityEquipmentSensorCBRNLCD stateObject = new global::CBRNSensors.EntityEquipmentSensorCBRNLCD();
            //stateObject.CreateInstance(this.WISE, hDatabase);
            //stateObject.SensorState =
            //stateObject.AddToDatabase(hDatabase);

            return result;
        }
开发者ID:GULPF,项目名称:SAAB-CM,代码行数:22,代码来源:CBRNSensorsDriver.cs



注:本文中的DatabaseHandle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DatabaseHelper类代码示例发布时间:2022-05-24
下一篇:
C# DatabaseEntry类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap