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

C# OperationType类代码示例

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

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



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


示例16: 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(x => x.IsConstant()))
            {
                if (arguments[0].IsInteger())
                {
                    return milpManager.FromConstant(Math.Abs((int)arguments[0].ConstantValue.Value));
                }
                return milpManager.FromConstant(Math.Abs(arguments[0].ConstantValue.Value));
            }

            var number = arguments[0];
            var numberNegated = number.Operation(OperationType.Negation);
            var result = milpManager.CreateAnonymous(number.IsInteger() ? Domain.PositiveOrZeroInteger : Domain.PositiveOrZeroReal);

            result.Set(ConstraintType.GreaterOrEqual, number)
                .Set(ConstraintType.GreaterOrEqual, numberNegated);

            milpManager.Operation(OperationType.Addition,
                    result.Operation(OperationType.IsEqual, number),
                    result.Operation(OperationType.IsEqual, numberNegated))
                .Set(ConstraintType.GreaterOrEqual, milpManager.FromConstant(1));

            result.ConstantValue = number.ConstantValue.HasValue ? Math.Abs(number.ConstantValue.Value) : number.ConstantValue;
            result.Expression = $"|{number.FullExpression()}|";
            return result;
        }
开发者ID:afish,项目名称:MilpManager,代码行数:28,代码来源:AbsoluteValueCalculator.cs


示例17: BaseProcessor

 protected BaseProcessor(Stream inputStream, Stream outputStream, OperationType operationType, HashTypes hashType = HashTypes.Undefined)
 {
     this.hashType = hashType;
     this.inputStream = inputStream;
     this.outputStream = outputStream;
     this.operationType = operationType;
 }
开发者ID:SealTV,项目名称:VeeamTest,代码行数:7,代码来源:BaseProcessor.cs


示例18: Operation

 internal Operation(int id, string name, string desc, OperationType type)
 {
     _operationId = id;
     _name = name;
     _description = desc;
     _type = type;
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:Operation.cs


示例19: GetProductDetailsXml

		private async Task<String> GetProductDetailsXml(String asins, OperationType type = OperationType.ItemLookup)
		{
			var requestParameters = new Dictionary<String, String>
			{
				{ "IdType", "ASIN" },
				{ "ResponseGroup", "Large" },
				{ "Service", "AWSECommerceService" },
				{ "AssociateTag", _associateTag }
			};

		    if (type == OperationType.ItemLookup)
		    {
                requestParameters.Add("Operation", "ItemLookup");
                requestParameters.Add("ItemId", asins);
            }
            else if (type == OperationType.ItemSearch)
            {
                requestParameters.Add("Operation", "ItemSearch");
                requestParameters.Add("SearchIndex", "All");
                requestParameters.Add("Keywords", asins);
            }

			var amazonRequestUri = _requestSigner.Sign(requestParameters);
		    var httpClient = new HttpClient
		                        {
		                            Timeout = TimeSpan.FromSeconds(5)
		                        };

		    return await httpClient.GetStringAsync(amazonRequestUri);
		}
开发者ID:Zoltu,项目名称:bags-amazon-synchronizer,代码行数:30,代码来源:AmazonUtilities.cs


示例20: DependencyPropertyChangedEventArgs

        internal DependencyPropertyChangedEventArgs(
            DependencyProperty  property, 
            PropertyMetadata    metadata,
            bool                isAValueChange, 
            EffectiveValueEntry oldEntry, 
            EffectiveValueEntry newEntry,
            OperationType       operationType) 
        {
            _property             = property;
            _metadata             = metadata;
            _oldEntry             = oldEntry; 
            _newEntry             = newEntry;
 
            _flags = 0; 
            _operationType        = operationType;
            IsAValueChange        = isAValueChange; 

            // This is when a mutable default is promoted to a local value. On this operation mutable default
            // value acquires a freezable context. However this value promotion operation is triggered
            // whenever there has been a sub property change to the mutable default. Eg. Adding a TextEffect 
            // to a TextEffectCollection instance which is the mutable default. Since we missed the sub property
            // change due to this add, we flip the IsASubPropertyChange bit on the following change caused by 
            // the value promotion to coalesce these operations. 
            IsASubPropertyChange = (operationType == OperationType.ChangeMutableDefaultValue);
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:25,代码来源:DependencyPropertyChangedEventArgs.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Operations类代码示例发布时间:2022-05-24
下一篇:
C# OperationStatus类代码示例发布时间: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