private void ReceiveTouchInformation(Int32 deviceId, Int32 deviceStatus, Int32 packetID, Int32 touches, Int32 ghostTouches) { //Check if we have received touch information. if (deviceStatus == (int)DeviceStatus.DS_TOUCH_INFO) { lock (m_lock) { this.FTouches.Clear(); this.FpacketID = packetID; this.FCurrentTouches = touches; for (int tch = 0; tch < Imports.MAX_TOUCHES; tch++) { if ((this.FCurrentTouches & (1 << tch)) > 0) { //Get the touch information. NWTouchPoint touchPt = new NWTouchPoint(); SuccessCode retCode = (SuccessCode)Imports.GetTouch(myDeviceID, FpacketID, out touchPt, (1 << tch), 0); if (retCode == SuccessCode.SUCCESS) { if (touchPt.TouchEventType == (int)TouchEventType.TE_TOUCH_DOWN || touchPt.TouchEventType == (int)TouchEventType.TE_TOUCHING) { this.FTouches[touchPt.TouchID] = touchPt; } } } } this.FInvalidateTouches = true; } } }
public SuccessCode AssignDocToAsm(string asmName, string docName, string rootMemberDocs) { SuccessCode success = 0; //make sure the Asm Item exists, has assembly, but no doc if (_allItems.Exists(m => m.ItemName() == asmName)) { success |= SuccessCode.AsmItemExists; } var properAsmItem = _allItems.Find(m => m.ItemName() == asmName); if (properAsmItem.GetAssemblyDataItem() != null) { success |= SuccessCode.AsmItemHasAsm; } if (properAsmItem.GetDocumentDataItem() == null) { success |= SuccessCode.AsmItemHasNoDoc; } //make sure the doc item exists, has a doc, but no assembly if (_allItems.Exists(m => m.ItemName() == docName)) { success |= SuccessCode.DocItemExists; } var properDocItem = _allItems.Find(m => m.ItemName() == docName); if (properDocItem.GetDocumentDataItem() != null) { success |= SuccessCode.DocItemHasDoc; } if (properDocItem.GetAssemblyDataItem() == null) { success |= SuccessCode.DocItemHasNoAsm; } DirectoryWithLangUtil.RenameMemFile(docName, asmName, rootMemberDocs); var actualDoc = properDocItem.GetDocumentDataItem(); properAsmItem.SetDocumentDataItem(actualDoc); //remove the dead doc item. _allItems.Remove(properDocItem); return(success); }
/// <summary> /// 创建错误结果 /// </summary> /// <param name="code"></param> /// <param name="msg"></param> /// <returns></returns> public static SuccessResult Init(SuccessCode code) { return(new SuccessResult(code)); }
public SuccessResult(SuccessCode code) { this.SuccessCode = (int)code; this.SuccessMsg = EnumExtension.GetEnumDescriptionName(code); }