private void RefreshActiveHandles() { foreach (GameObject handleGo in Interactibles) { BoundingBoxHandle handle = handleGo.GetComponent <BoundingBoxHandle>(); OperationEnum handleOperation = GetBoundingBoxOperationFromHandleType(handle.HandleType, handle.HandleTypeFlattened); bool operationPermitted = (handleOperation & permittedOperations) != 0; bool flattenedTypePermitted = (FlattenedAxis == FlattenModeEnum.DoNotFlatten && handle.HandleTypeFlattened == BoundingBoxHandle.HandleTypeFlattenedEnum.None) || (FlattenedAxis != FlattenModeEnum.DoNotFlatten && handle.HandleTypeFlattened != BoundingBoxHandle.HandleTypeFlattenedEnum.None); handleGo.SetActive(operationPermitted & flattenedTypePermitted); switch (FlattenedAxis) { case FlattenModeEnum.DoNotFlatten: default: break; case FlattenModeEnum.FlattenX: handle.RefreshFlattenedPosition(BoundsExtentions.Axis.X); break; case FlattenModeEnum.FlattenY: handle.RefreshFlattenedPosition(BoundsExtentions.Axis.Y); break; case FlattenModeEnum.FlattenZ: handle.RefreshFlattenedPosition(BoundsExtentions.Axis.Z); break; } } }
/// <summary> /// 检查功能权限. /// ldq:2007.10.10重构 /// </summary> /// <param name="u8login">vb的login对象</param> /// <param name="reportIdOrViewId"> /// 报表id或视图id:operation=OperationEnum.Publish时,此参数为 /// 报表id,其他情况此参数为视图id /// </param> /// <param name="operation">权限类型</param> /// <returns></returns> public bool AuthCheck( object u8login, string reportIdOrViewId, OperationEnum operation) { return(this.AuthCheck(u8login, reportIdOrViewId, operation, null)); }
/// <summary> /// Конструктор подвыражения типа "лист" /// </summary> /// <param name="lexemeFirst">Первая лексема</param> /// <param name="operation">Операция</param> /// <param name="lexemeSecond">Вторая лексема</param> /// <param name="expressionLevel">Порядковый номер выражения</param> public Subexpression(Lexeme lexemeFirst, OperationEnum operation, Lexeme lexemeSecond, int expressionLevel) { this.lexemeFirst = lexemeFirst; this.operation = operation; this.lexemeSecond = lexemeSecond; this.expressionLevel = expressionLevel; }
public static double Perform(this OperationEnum operation, double aggregateValue, double sourceValue) { if (operation == OperationEnum.Sum) { return(aggregateValue + sourceValue); } if (operation == OperationEnum.Subtract) { return(aggregateValue - sourceValue); } if (operation == OperationEnum.Multiply) { if (aggregateValue.SafeEquals(0.0d)) { aggregateValue = +1; } return(aggregateValue * sourceValue); } if (operation == OperationEnum.Divide) { if (aggregateValue.SafeEquals(0.0d)) { aggregateValue = +1; return(sourceValue / aggregateValue); } else { return(aggregateValue / sourceValue); } } throw new InvalidOperationException("Unsupported Aggregation Operation"); }
/// <summary> /// Calculation method /// </summary> /// <param name="operand1">The first operand</param> /// <param name="operand2">The second operand</param> /// <param name="operation">Operation enum</param> /// <returns>This is a result</returns> public float Calc(float operand1, float operand2, OperationEnum operation) { float result; switch (operation) { case OperationEnum.Sum: result = operand1 + operand2; break; case OperationEnum.Minus: result = operand1 - operand2; break; case OperationEnum.Mult: result = operand1 * operand2; break; case OperationEnum.Div: result = operand1 / operand2; break; default: throw new ArgumentException("Argument is not correct"); } return(result); }
/// <summary> /// 释放功能权限. /// ldq:2007.10.10重构 /// </summary> /// <param name="u8login">vb的login对象</param> /// <param name="reportIdOrViewId"> /// 报表id或视图id:operation=OperationEnum.Publish时,此参数为 /// 报表id,其他情况此参数为视图id /// </param> /// <param name="operation">权限类型</param> /// <returns></returns> public bool ReleaseAuth( object u8login, string reportIdOrViewId, OperationEnum operation) { return(this.ReleaseAuth(u8login, reportIdOrViewId, operation, null)); }
public bool ReleaseAuth( object u8login, string reportIdOrViewId, OperationEnum operation, string otherAuthString) { Trace.WriteLine("开始释放功能权限,Id:" + reportIdOrViewId); init(u8login); string reportAuthId = this.GetReportAuthId(reportIdOrViewId); if (!string.IsNullOrEmpty(reportAuthId)) { reportAuthId += this.GetOperateCodeBy(operation, otherAuthString); //Logger logger = Logger.GetLogger("zxy"); //logger.Info("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); //logger.Info("reportAuthId = " + reportAuthId); //logger.Info("_u8login.cIYear = " + _u8login.cIYear); bool result = _u8login.TaskExec(reportAuthId, 0, short.Parse(_u8login.cIYear)); //logger.Info("_u8login.TaskID = " + _u8login.get_TaskId()); //logger.Info("result = " + result.ToString()); //logger.Close(); return(result); } return(false); }
public void Handle(char input) { if (input == '+') { _currentOperation = OperationEnum.Plus; Formula = $"{Display} +"; _previousOperand = Display; _canSetNewOperand = true; } else if (input == '=') { switch (_currentOperation) { case OperationEnum.Plus: Display = _previousOperand + Display; break; } Formula = string.Empty; } else { int digit = int.Parse(input.ToString()); if (_canSetNewOperand) { Display = digit; _canSetNewOperand = false; } else { Display = Display * 10 + int.Parse(input.ToString()); } } }
private string GetOperateCodeBy( OperationEnum opType, string otherAuthString) { switch (opType) { case OperationEnum.Other: return(otherAuthString); case OperationEnum.Publish: return("_05"); case OperationEnum.Print: return("_03"); case OperationEnum.Setting: return("_02"); case OperationEnum.Output: return("_04"); default: case OperationEnum.Query: return("_01"); } }
private bool Send2Msmq(string id, OperationEnum operation) { try { var msg = new MessageItem { EntityName = _collectionName, Operation = operation, Type = TypeName2TypeEnum(_collectionName), ChangeTime = DBTimeHelper.DBNowTime(), Data = new List <CustomKeyValue> { new CustomKeyValue() { Key = "Id", Value = id } } }; using (var msmq = ML.BC.Infrastructure.Ioc.GetService <IMsmqProvider>()) { msmq.Send <List <MessageItem> >(new Message(new List <MessageItem> { msg })); return(true); } } catch (Exception ex) { throw ex; } }
/// <summary> /// Method for type checking /// </summary> /// <param name="operation"></param> /// <param name="value"></param> /// <param name="isStatUnit"></param> /// <returns></returns> private Expression <Func <T, bool> > GetUnitTypePredicate(OperationEnum operation, object value, bool isStatUnit) { var parameter = Expression.Parameter(typeof(T), "x"); var types = GetConstantValueArray <StatUnitTypes>(value, operation) .Select(StatisticalUnitsTypeHelper.GetStatUnitMappingType); Expression expression = Expression.Constant(false); if (isStatUnit) { expression = types .Where(x => x != typeof(EnterpriseGroup)) .Aggregate(expression, (current, type) => { var typeIsExp = (Expression)Expression.TypeIs(parameter, type); return(current == null ? typeIsExp : Expression.OrElse(typeIsExp, current)); }); } else { expression = Expression.Constant(types.Any(x => x == typeof(EnterpriseGroup))); } if (operation == OperationEnum.NotEqual || operation == OperationEnum.NotInList) { expression = Expression.Not(expression); } return(Expression.Lambda <Func <T, bool> >(expression, parameter)); }
protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); _mouseLocation = e.Location; if (this.Dock != DockStyle.None) {// Only free floating are allowed to enter this type of operation. return; } if (e.Location.X > this.Width - ResizeMargin) { _operation = OperationEnum.ReSizeHorizontal; } if (e.Location.Y > this.Height - ResizeMargin) { _operation = OperationEnum.ReSizeVertical; } if (e.Location.X > this.Width - ResizeMargin && e.Location.Y > this.Height - ResizeMargin) { _operation = OperationEnum.ReSizeAll; } }
private BitArray ImediateFormat(OperationEnum operation, List <string> parts) { var result = new BitArray(0); result = result.Append(new BitArray(new int[1] { (int)operation }).Trim(6)); var register1String = parts[1].Trim(new char[] { '$', ',' }); if (Enum.TryParse(register1String, true, out RegisterEnum register)) { result = result.Append(new BitArray(new int[1] { (int)register }).Trim(5)); } var register2String = parts[2].Trim(new char[] { '$', ',' }); if (Enum.TryParse(register2String, true, out RegisterEnum register2)) { result = result.Append(new BitArray(new int[1] { (int)register2 }).Trim(5)); } if (Int32.TryParse(parts[3], out int refe)) { result = result.Append(new BitArray(new int[1] { refe }).Trim(16)); } return(result); }
/// <summary> /// Funzione per l'importazione di un corrispondente nella rubrica /// </summary> /// <param name="userInfo">Le informazioni sull'utente che ha lanciato la procedura</param> /// <param name="role">Il ruolo con cui è stata lanciata la procedura</param> /// <param name="operation">L'operazione da compiere sul corrispondente</param> /// <param name="rowData">L'oggetto con le informazioni sul corrispondente su cui compiere l'operazione richiesta</param> /// <returns>Il risultato dell'elaborazione</returns> public static AddressBookImportResult ImportAddressBookElement( InfoUtente userInfo, Ruolo role, OperationEnum operation, AddressBookRowData rowData) { // Il risultato dell'inserimento AddressBookImportResult toReturn; // Riferimento al web service a cui richiedere l'operazione DocsPaWebService ws; // Istanziazione di un riferimento al Web Service e impostazione del timeout infinito ws = new DocsPaWebService(); ws.Timeout = System.Threading.Timeout.Infinite; try { // Esecuzione dell'importazione del corrispondente toReturn = ws.ImportAddressBookElement( userInfo, role, System.Configuration.ConfigurationManager.AppSettings["LISTE_DISTRIBUZIONE"].Equals("1") ? 1 : 0, operation, rowData); } catch (Exception e) { throw e; } // Restituzione del risultato return(toReturn); }
private void Ellipse_MouseDown(object sender, MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Middle && e.ButtonState == MouseButtonState.Pressed) { } else if (e.ChangedButton == MouseButton.Right && e.ButtonState == MouseButtonState.Pressed) { currentOperation = NextOperationEnum(currentOperation); label.Content = GetEnumDescription(currentOperation); label2.Content = GetCurrentOperationValue(currentOperation); } else { if (currentOperation == OperationEnum.Op_Exit) { HandleExitOperation(); } else { if (currentOperation == OperationEnum.Op_WindowLocation) { label2.Content = String.Empty; } this.DragMove(); value_WindowTop = Top; value_WindowLeft = Left; if (currentOperation == OperationEnum.Op_WindowLocation) { label2.Content = DisplayWindowLocation(); } } } }
public CostumeAddBrandForm(Brand brand = null, OperationEnum action = OperationEnum.Add) { InitializeComponent(); this.item = brand; this.action = action; Initialize(); }
private void SetHandleByOperation(OperationEnum operation) { switch (operation) { case OperationEnum.None: ActiveHandle = null; break; case OperationEnum.Drag: foreach (GameObject obj in Interactibles) { BoundingBoxHandle h = obj.GetComponent <BoundingBoxHandle>(); if (h.HandleType == BoundingBoxHandle.HandleTypeEnum.Drag) { ActiveHandle = h; break; } } break; default: foreach (GameObject obj in Interactibles) { BoundingBoxHandle h = obj.GetComponent <BoundingBoxHandle>(); OperationEnum handleOp = GetBoundingBoxOperationFromHandleType(h.HandleType, h.HandleTypeFlattened); if (handleOp == operation) { ActiveHandle = h; break; } } break; } }
private static List <SyncStateDto> GetError2Log4Net(string ent, OperationEnum op, string key) { var logger = log4net.LogManager.GetLogger(ent); logger.Error(string.Format("操作实体:{0},操作类型:{1},关键字:{2}", ent, op, key)); return(new List <SyncStateDto>()); }
/// <summary> /// Конструктор обычного подвыражения /// </summary> /// <param name="subexpressionFirst">Первое подвыражение</param> /// <param name="operation">Операция</param> /// <param name="subexpressionSecond">Второе подвыражение</param> /// <param name="expressionLevel">Порядковый номер выражения</param> public Subexpression(Subexpression subexpressionFirst, OperationEnum operation, Subexpression subexpressionSecond, int expressionLevel) { this.subexpressionFirst = subexpressionFirst; this.operation = operation; this.subexpressionSecond = subexpressionSecond; this.expressionLevel = expressionLevel; }
/// <summary> /// Create notification information /// </summary> /// <param name="name">domain object name</param> /// <param name="operation">operation type</param> /// <param name="source">notification source</param> /// <param name="uri">identifiers</param> public NotifyInfo(string name, OperationEnum operation, SourceEnum source, string[] uri) { this.Name = name; this.Operation = operation; this.Source = source; this.URI = uri; }
public WholesaleBeginningSaveCostumeForm(PfCustomerStore store) { try { InitializeComponent(); this.curStore = store; this.action = OperationEnum.Edit; Costume costume = GlobalCache.GetCostume(store.CostumeID); if (costume != null) { this.CurItem = costume; } else { costume = new Costume(); ReflectionHelper.CopyProperty(store, costume); costume.ID = store.CostumeID; costume.Name = store.CostumeName; costume.Colors = store.ColorName; this.CurItem = costume; this.customerID = store.PfCustomerID; } SetSize(); } catch (Exception ex) { GlobalUtil.ShowError(ex); } }
private void SetHandleByOperation(OperationEnum operation) { switch (operation) { case OperationEnum.None: ActiveHandle = null; break; case OperationEnum.Drag: foreach (GameObject obj in Interactibles) { BoundingBoxHandle h = obj.GetComponent <BoundingBoxHandle>(); if (h.HandleType == BoundingBoxHandle.HandleTypeEnum.Drag) { ActiveHandle = h; break; } } break; default: //TODO link up other operations here break; } }
static Calculation GetCalculation(OperationEnum operationEnum) { var calculation = new Calculation(); calculation.Operation = operationEnum; return(EnterCalculationNumbers(calculation)); }
protected PropertyEventArgs(OGMImpl sender, Property property, OperationEnum operation, object?previousValue, object?assignedValue) : base(sender) { Property = property; Operation = operation; PreviousValueInternalBridge = previousValue; AssignedValueInternalBridge = assignedValue; }
/// <summary> /// 检查报表特定的功能权限 /// </summary> /// <param name="u8login">vb的login对象</param> /// <param name="report">报表ID</param> /// <param name="operation">操作类型</param> /// <returns></returns> public bool AuthCheckSpecifiedOperation( object u8login, string reportID, OperationEnum operation) { Trace.WriteLine("进入AuthCheckSpecifiedOperation"); init(u8login); string reportAuthId = this.GetReportAuthIdByReportID(reportID); if (string.IsNullOrEmpty(reportAuthId)) { throw new Exception("传入的reportID没有对应的ReportAuthId,reportID:" + reportID); } reportAuthId += this.GetOperateCodeBy(operation, null); bool isAuthOk = _u8login.TaskExec(reportAuthId, -1, short.Parse(_u8login.cIYear)); if (!isAuthOk) { Logger log = Logger.GetLogger("KKMETEOR"); log.Info(_u8login.ShareString); throw new Exception(_u8login.ShareString); } return(true); }
public Equation(int left, OperationEnum op, int right, int res) { LeftTerm = left; Operation = op; RightTerm = right; Result = res; }
private void TiDanForm_HangedOrderSelected(PfOrder hangedOrder) { action = OperationEnum.Pick; order = hangedOrder; LoadOrder(hangedOrder); BindingInboundDetailSource(); }
private BitArray RegisterFormat(OperationEnum operation, List <string> parts) { var result = new BitArray(6, false); var register1String = parts[1].Trim(new char[] { '$', ',' }); if (Enum.TryParse(register1String, true, out RegisterEnum register)) { var bits = new BitArray(new byte[1] { (byte)register }); bits = bits.Trim(5); result = result.Append(bits); } var register2String = parts[2].Trim(new char[] { '$', ',' }); if (Enum.TryParse(register2String, true, out RegisterEnum register2)) { var bits = new BitArray(new byte[1] { (byte)register2 }); bits = bits.Trim(5); result = result.Append(bits); } var register3String = parts[3].Trim(new char[] { '$', ',' }); if (Enum.TryParse(register3String, true, out RegisterEnum register3)) { var bits = new BitArray(new byte[1] { (byte)register3 }); bits = bits.Trim(5); result = result.Append(bits); } else if (Int16.TryParse(parts[3], out short resultParse)) // valor constante { result.Append(new BitArray(new int[1] { resultParse })); } result = result.Append(new BitArray(5, false)); var bitsEX = new BitArray(new byte[1] { (byte)operation }); bitsEX = bitsEX.Trim(6); result = result.Append(bitsEX); return(result); }
internal void SetCurrentNodeStatus(OperationEnum status) { if (SelectedNode != null) { OperationType = status; SelectedNode.OperationType = status; } }
public AddCostumeColorForm(CostumeColor color = null, OperationEnum action = OperationEnum.Add) { InitializeComponent(); this.color = color; this.action = action; Initialize(); }
/** <summary>Creates a new action within the given document context.</summary> */ public Render( Screen screen, OperationEnum operation, Rendition rendition ) : base(screen.Document, PdfName.Rendition) { Operation = operation; Screen = screen; Rendition = rendition; }
public virtual bool GetStatus(OperationEnum operationEnum) { throw new NotImplementedException(); }
/// <summary> /// /// </summary> public MatchClause(OperationEnum operation, string fieldName, object value) { _operation = operation; _value = value; _fieldName = fieldName; }
/// <summary> /// Create notification information originating from local server /// </summary> /// <param name="name">domain object name</param> /// <param name="operation">operation type</param> /// <param name="source">notification source</param> /// <param name="uri">identifiers</param> public NotifyInfo(string name, OperationEnum operation, string[] uri) : this(name, operation, SourceEnum.Local, uri) { }
public override string GetProhibitionCondition(OperationEnum operationEnum) { switch (operationEnum) { case OperationEnum.Capture: return ""; case OperationEnum.RecordMovie: MTPDataResponse response = ExecuteReadDataEx(CONST_CMD_GetDevicePropValue, 0xD0A4); if (response.Data != null && response.Data.Length > 0) { Int32 resp = BitConverter.ToInt32(response.Data, 0); if (resp == 0) return string.Empty; if (StaticHelper.GetBit(resp, 0)) return "LabelNoCardInserted"; if (StaticHelper.GetBit(resp, 1)) return "LabelCardError"; if (StaticHelper.GetBit(resp, 2)) return "LabelCardNotFormatted"; if (StaticHelper.GetBit(resp, 3)) return "LabelNoFreeAreaInCard"; if (StaticHelper.GetBit(resp, 7)) return "LabelCardBufferNotEmpty"; if (StaticHelper.GetBit(resp, 8)) return "LabelPcBufferNotEmpty"; if (StaticHelper.GetBit(resp, 9)) return "LabelBufferNotEmpty"; if (StaticHelper.GetBit(resp, 10)) return "LabelRecordInProgres"; if (StaticHelper.GetBit(resp, 11)) return "LabelCardProtected"; if (StaticHelper.GetBit(resp, 12)) return "LabelDuringEnlargedDisplayLiveView"; if (StaticHelper.GetBit(resp, 13)) return "LabelWrongLiveViewType"; if (StaticHelper.GetBit(resp, 14)) return ""; //return "LabelNotInApplicationMode"; } return ""; case OperationEnum.AutoFocus: if (FocusMode != null && FocusMode.Value != null && FocusMode.Value.Contains("[M]")) return "LabelMFError"; // check if not Single AF servo return ""; case OperationEnum.ManualFocus: if (FocusMode != null && FocusMode.Value != null && FocusMode.Value.Contains("[M]")) return "LabelMFError"; MTPDataResponse responselFocus = ExecuteReadDataEx(CONST_CMD_GetDevicePropValue, 0xD061); if (responselFocus != null && (responselFocus.Data != null && responselFocus.Data.Length > 0)) { var resp = responselFocus.Data[0]; if (resp == 2) return "LabelNotAFSError"; } // check if not Single AF servo return ""; case OperationEnum.LiveView: MTPDataResponse responsel = ExecuteReadDataEx(CONST_CMD_GetDevicePropValue, 0xD1A4); if (responsel.Data != null && responsel.Data.Length > 0) { Int32 resp = BitConverter.ToInt32(responsel.Data, 0); if (resp == 0) return string.Empty; if (StaticHelper.GetBit(resp, 0)) return "LabelDestinationCardError"; if (StaticHelper.GetBit(resp, 2)) return "LabelSequenceError"; if (StaticHelper.GetBit(resp, 4)) return "LabelFullyPressedButtonError"; if (StaticHelper.GetBit(resp, 5)) return "LabelApertureValueError"; if (StaticHelper.GetBit(resp, 6)) return "LabelBulbError"; if (StaticHelper.GetBit(resp, 7)) return "LabelDuringCleaningMirror"; if (StaticHelper.GetBit(resp, 8)) return "LabelDuringInsufficiencyBattery"; if (StaticHelper.GetBit(resp, 9)) return "LabelTTLError"; if (StaticHelper.GetBit(resp, 11)) return "LabelNonCPULEnseError"; if (StaticHelper.GetBit(resp, 12)) return "LabelImageInRAM"; if (StaticHelper.GetBit(resp, 13)) return "LabelMirrorUpError2"; if (StaticHelper.GetBit(resp, 14)) return "LabelNoCardInsertedError"; if (StaticHelper.GetBit(resp, 15)) return "LabelCommandProcesingError"; if (StaticHelper.GetBit(resp, 16)) return "LabelShoutingInProgress"; if (StaticHelper.GetBit(resp, 17)) return "LabelOverHeatedError"; if (StaticHelper.GetBit(resp, 18)) return "LabelCardProtectedError"; if (StaticHelper.GetBit(resp, 19)) return "LabelCardError"; if (StaticHelper.GetBit(resp, 20)) return "LabelCardNotFormatted"; if (StaticHelper.GetBit(resp, 21)) return "LabelBulbError"; if (StaticHelper.GetBit(resp, 22)) return "LabelMirrorUpError"; } return ""; default: throw new ArgumentOutOfRangeException("operationEnum"); } }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (_operation != OperationEnum.None) { _operation = OperationEnum.None; } }
public virtual string GetProhibitionCondition(OperationEnum operationEnum) { return ""; }
public override string GetProhibitionCondition(OperationEnum operationEnum) { return ""; }
public override string GetProhibitionCondition(OperationEnum operationEnum) { switch (operationEnum) { case OperationEnum.Capture: break; case OperationEnum.RecordMovie: if (Camera.GetProperty(Edsdk.PropID_Record) == 4) return "LabelRecordInProgres"; if (Camera.LiveViewDevice==EosLiveViewDevice.None) return "LabelWrongLiveViewType"; break; case OperationEnum.AutoFocus: break; case OperationEnum.ManualFocus: break; case OperationEnum.LiveView: break; default: throw new ArgumentOutOfRangeException("operationEnum", operationEnum, null); } return ""; }