当前位置: 首页>>代码示例>>C#>>正文


C# OperationType类代码示例

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


OperationType类属于命名空间,在下文中一共展示了OperationType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Add

 public void Add(List<XObject> objects, bool checkUploadFile = false)
 {
     if (objects == null)
         throw new ArgumentNullException("objects", "Can not be null.");
     if (objects.Count == 0)
         return;
     CurrentOperationType = OperationType.Add;
     var data = new { objects };
     var arrList = ExecuteTemplate<ArrayList>(EndPoint.object_array, XHttpMethod.POST, data);
     // Parse arrayList. Item of array can contains id object or error
     var errors = new Dictionary<int, object>();
     int i = 0;
     foreach (var obj in objects){
         int id = -1;
         if (arrList[i] is string && int.TryParse(arrList[i] as string, out id)){
             obj.Id = id;
             if (checkUploadFile)
                 CheckNeedUploadFiles(obj);
         }
         else
             errors.Add(i, arrList[i]);
         i++;
     }
     if (errors.Count > 0){
         var concatErrors = new StringBuilder();
         foreach (var error in errors)
             if (error.Value is ArrayList && (error.Value as ArrayList).Count > 0 && arrList.Count > error.Key)
                 concatErrors.AppendLine("Index object: " + error.Key + ". Error: " + (arrList[error.Key] as ArrayList)[0] + "; ");
         throw new FxServerException("FlexiDB server error." + concatErrors);
     }
 }
开发者ID:FlexiDB,项目名称:PublicCSharpLib,代码行数:31,代码来源:ObjectService.cs

示例2: Operation

 public Operation(OperationType type, int fileNumber, int start, int length)
 {
     Type = type;
     FileNumber = fileNumber;
     Start = start;
     Length = length;
 }
开发者ID:peters,项目名称:PersistentQueue,代码行数:7,代码来源:Operation.cs

示例3: SetAuditTrail

 public void SetAuditTrail(string un, OperationType op, string cat, string msg)
 {
     UserName = un;
     Operation = op;
     Category = cat;
     Message = msg;
 }
开发者ID:zql62191,项目名称:website-bed,代码行数:7,代码来源:AuditTrail.cs

示例4: AddAfter

        public virtual void AddAfter(IQueryPart part, OperationType operation)
        {
            var first = Parts.LastOrDefault(p => p.OperationType == operation);
            var index = Parts.IndexOf(first) + 1;

            Parts.Insert(index, part);
        }
开发者ID:chriswalpen,项目名称:PersistenceMap,代码行数:7,代码来源:QueryPartsContainer.cs

示例5: Token

 public Token(Regex match, TokenType tokenType, OperationType operationType = OperationType.Operator, TokenDiscardPolicy discardPolicy = TokenDiscardPolicy.Keep)
 {
     m_TokenType = tokenType;
     m_DiscardPolicy = discardPolicy;
     m_OperationType = operationType;
     m_Regex = match;
 }
开发者ID:JoshuaSmyth,项目名称:SimpleExpressionParser,代码行数:7,代码来源:Token.cs

示例6: SyncOperationHistroy

 /// <summary>
 /// 同步计划的运营历史操作
 /// </summary>
 /// <param name="StartDate">开始时间</param>
 /// <param name="planHistoryID">计划明细ID</param>
 /// <param name="tag">标志</param>
 /// <param name="dbContext">域上下文</param>
 public static void SyncOperationHistroy(FleetEntities dbContext, Guid planHistoryID, OperationType tag)
 {
     //当前计划历史
     var currentPlanHisotry = dbContext.PlanHistories.FirstOrDefault(p => p.PlanHistoryID == planHistoryID);
     if (currentPlanHisotry == null || currentPlanHisotry.ApprovalHistoryID == null) return;
     //运行日期
     DateTime? StartDate = GetOperationDateByApprovalHistory(currentPlanHisotry.ApprovalHistoryID, dbContext);
     if (StartDate == null) return;
     //当前有效的年度
     var currentOpenAnnual = (from t in dbContext.Plans.Include("Annuals")
                              from r in dbContext.PlanHistories
                              where
                                  t.PlanID == r.PlanID &&
                                  r.PlanHistoryID == currentPlanHisotry.PlanHistoryID
                              select t.Annual).FirstOrDefault();
     if (currentOpenAnnual == null) return;
     switch (tag)
     {
         case OperationType.OperationLastYearPlan:
             SynOperationLastYearPlan(dbContext, currentPlanHisotry, (DateTime)StartDate, currentOpenAnnual);
             break;
         case OperationType.OperationNextYearPlan:
             SynOperationNextYearPlan(dbContext, currentPlanHisotry, currentOpenAnnual);
             break;
         default:
             break;
     }
 }
开发者ID:unicloud,项目名称:AFRP,代码行数:35,代码来源:OperationHistorySync.cs

示例7: TextChangedEventArgs

 public TextChangedEventArgs(OperationType operation, int start, int length, string text)
 {
     _operation = operation;
     _start = start;
     _length = length;
     _text = text;
 }
开发者ID:mbrezu,项目名称:synpl,代码行数:7,代码来源:TextChangedEventArgs.cs

示例8: QueryPart

 public QueryPart(OperationType operation, Type entityType, string id)
 {
     OperationType = operation;
     ID = id ?? operation.ToString();
     EntityType = entityType;
     _parts = new Lazy<List<IQueryPart>>(() => new List<IQueryPart>());
 }
开发者ID:chriswalpen,项目名称:PersistenceMap,代码行数:7,代码来源:QueryPart.cs

示例9: GetLogOrderEntity

        public static LogOrder GetLogOrderEntity(OrderTask orderTask,OperationType operationType,string objectId)
        {
            LogOrder logEntity = new LogOrder();

            string hostname = Dns.GetHostName();
            IPHostEntry localhost = Dns.GetHostEntry(hostname);
            IPAddress localaddr = localhost.AddressList[0];
            logEntity.IP = localaddr.ToString();

            logEntity.UserId = ConsoleClient.Instance.User.UserId;
            logEntity.UserName = ConsoleClient.Instance.User.UserName;
            logEntity.Event = objectId;// "ExecuteOrder";
            logEntity.ExchangeCode = orderTask.ExchangeCode;
            logEntity.OperationType = operationType;
            logEntity.OrderId = orderTask.OrderId;
            logEntity.OrderCode = orderTask.Code;
            logEntity.AccountCode = orderTask.AccountCode;
            logEntity.InstrumentCode = orderTask.InstrumentCode;
            logEntity.IsBuy = orderTask.IsBuy == BuySell.Buy;
            logEntity.IsOpen = orderTask.IsOpen == OpenClose.Open;
            logEntity.Lot = orderTask.Lot.Value;
            logEntity.SetPrice = orderTask.SetPrice;
            logEntity.OrderType = orderTask.OrderType;
            logEntity.OrderRelation = null;
            logEntity.TransactionCode = orderTask.Transaction.Code;

            return logEntity;
        }
开发者ID:BlueSky007,项目名称:ExchangeManager,代码行数:28,代码来源:LogEntityConvert.cs

示例10: Token

 public Token(TokenType type, OperationType operationType, string value, TokenPosition position)
 {
     OperationType = operationType;
     Type = type;
     Value = value;
     Position = position;
 }
开发者ID:RainsSoft,项目名称:GossipScript,代码行数:7,代码来源:Token.cs

示例11: EnqueueMessage

		public NetSendResult EnqueueMessage(OperationType opType, PacketPayload payload, DeliveryMethod method, bool encrypt, byte channel, int connectionId)
		{
			outgoingMessageQueue.syncRoot.EnterWriteLock();
			try
			{
				//This is similar to how Photon works on the Unity client.
				//They enqueue actions
				outgoingMessageQueue.Enqueue(() =>
				{
					INetworkMessageRouterService sender = sendServiceStrategy.GetRouterService(connectionId);

					sender.TrySendMessage(opType, payload, method, encrypt, channel);
				});

				//signal any handlers that a message is in the queue
				//it is important to do this in a lock. Reset could be called after Set
				//in the other thread and we'd end up with potential unhandled messages in that race condition
				outgoingMessageQueue.QueueSemaphore.Set();
			}
			finally
			{
				outgoingMessageQueue.syncRoot.ExitWriteLock();
			}

			return NetSendResult.Queued;
		}
开发者ID:HelloKitty,项目名称:GladNet2-Lidgren,代码行数:26,代码来源:ManagedLidgrenNetworkThread.cs

示例12: Calculate

        public IVariable Calculate(IMilpManager milpManager, OperationType type, params IVariable[] arguments)
        {
            if (!SupportsOperation(type, arguments)) throw new NotSupportedException(SolverUtilities.FormatUnsupportedMessage(type, arguments));
            if (arguments.All(a => a.IsConstant()))
            {
                var constantResult = (int) arguments[0].ConstantValue.Value%(int) arguments[1].ConstantValue.Value;
                return milpManager.FromConstant((int)constantResult);
            }
            IVariable numerator = arguments[0];
            IVariable denominator = arguments[1];

            var one = milpManager.FromConstant(1);
            var any = milpManager.CreateAnonymous(Domain.PositiveOrZeroInteger);
            any.Operation(OperationType.Multiplication, denominator).Set(ConstraintType.LessOrEqual, numerator);
            any.Operation(OperationType.Addition, one)
                .Operation(OperationType.Multiplication, denominator)
                .Set(ConstraintType.GreaterOrEqual, numerator.Operation(OperationType.Addition, one));

            IVariable result = milpManager.CreateAnonymous(Domain.PositiveOrZeroInteger);
            result.Set(ConstraintType.LessOrEqual, denominator);
            result.Set(ConstraintType.Equal,
                numerator.Operation(OperationType.Subtraction,
                    denominator.Operation(OperationType.Multiplication, any)));

            result.ConstantValue = numerator.ConstantValue%denominator.ConstantValue;
            result.Expression = $"{numerator.FullExpression()} % {denominator.FullExpression()}";
            return result;
        }
开发者ID:afish,项目名称:MilpManager,代码行数:28,代码来源:RemainderCalculator.cs

示例13: GceOperation

 public GceOperation(OperationType operationType, string projectId, string zoneName, string name)
 {
     OperationType = operationType;
     ProjectId = projectId;
     ZoneName = zoneName;
     Name = name;
 }
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-visualstudio,代码行数:7,代码来源:GceOperation.cs

示例14: TokenRule

		public TokenRule( OperationType op, Symbol tokenID, string symbol )
		{
			this.operation = op;
			this.tokenID = tokenID;
			this.symbol = symbol;
			this.errorID = 0;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:7,代码来源:Structures.cs

示例15: DesktopChangeEventArgs

 public DesktopChangeEventArgs(int x1, int y1, int x2, int y2, OperationType type) {
     this.x = x1;
     this.y = y1;
     this.w = x2 - x1;
     this.h = y2 - y1;
     this.type = type;
 }
开发者ID:mobilipia,项目名称:Win7,代码行数:7,代码来源:DesktopMirror.cs


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