RegisterCallback() public abstract method

public abstract RegisterCallback ( RecordEventHandler handler ) : void
handler RecordEventHandler
return void
コード例 #1
0
ファイル: NFCUploadModule.cs プロジェクト: zh423328/NFClient
        public void OnClassHandler(NFGUID self, int nContainerID, int nGroupID, NFIObject.CLASS_EVENT_TYPE eType, string strClassName, string strConfigIndex)
        {
            if (eType == NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE)
            {
                NFIObject xObject = NFCKernelModule.Instance.GetObject(self);

                NFIPropertyManager xPropertyManager  = xObject.GetPropertyManager();
                NFDataList         xPropertyNameList = xPropertyManager.GetPropertyList();
                for (int i = 0; i < xPropertyNameList.Count(); i++)
                {
                    string      strPropertyName = xPropertyNameList.StringVal(i);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (xProperty.GetUpload())
                    {
                        xProperty.RegisterCallback(OnPropertyHandler);
                    }
                }

                NFIRecordManager xRecordManager  = xObject.GetRecordManager();
                NFDataList       xRecordNameList = xRecordManager.GetRecordList();
                for (int i = 0; i < xRecordNameList.Count(); i++)
                {
                    string    strRecodeName = xRecordNameList.StringVal(i);
                    NFIRecord xRecord       = xRecordManager.GetRecord(strRecodeName);
                    if (xRecord.GetUpload())
                    {
                        xRecord.RegisterCallback(OnRecordHandler);
                    }
                }
            }
        }
コード例 #2
0
 public override void RegisterCallback(string strRecordName, NFIRecord.RecordEventHandler handler)
 {
     if (mhtRecord.ContainsKey(strRecordName))
     {
         NFIRecord record = (NFIRecord)mhtRecord[strRecordName];
         record.RegisterCallback(handler);
     }
 }