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

C# UpdateType类代码示例

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

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



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

示例1: DocumentRequest

        protected DocumentRequest(UpdateType type, string id)
        {
            if (id == null) throw new ArgumentNullException(nameof(id));

            Type = type;
            Id = id;
        }
开发者ID:roberthannon,项目名称:Comb,代码行数:7,代码来源:DocumentRequest.cs


示例2: UpdateRequest

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateRequest" /> class.
 /// </summary>
 /// <param name="updateType">The update type.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="update">The update.</param>
 public UpdateRequest(UpdateType updateType, BsonDocument filter, BsonDocument update)
     : base(WriteRequestType.Update)
 {
     _updateType = updateType;
     _filter = Ensure.IsNotNull(filter, nameof(filter));
     _update = Ensure.IsNotNull(update, nameof(update));
 }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:14,代码来源:UpdateRequest.cs


示例3: UpdateRequest

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateRequest" /> class.
 /// </summary>
 /// <param name="updateType">The type.</param>
 /// <param name="criteria">The criteria.</param>
 /// <param name="update">The update.</param>
 public UpdateRequest(UpdateType updateType, BsonDocument criteria, BsonDocument update)
     : base(WriteRequestType.Update)
 {
     _updateType = updateType;
     _criteria = Ensure.IsNotNull(criteria, "criteria");
     _update = Ensure.IsNotNull(update, "update");
 }
开发者ID:bollinim,项目名称:mongo-csharp-driver,代码行数:14,代码来源:UpdateRequest.cs


示例4: SetRowState

 /// <summary>
 /// 更新记录状态
 /// </summary>
 /// <param name="dataRow">记录</param>
 /// <param name="updateType">操作类型</param>
 private void SetRowState(DataRow dataRow, UpdateType updateType)
 {
     if (dataRow.RowState != DataRowState.Unchanged) return;
     if (updateType == UpdateType.Add)
         dataRow.SetAdded();
     if (updateType == UpdateType.Modify)
         dataRow.SetModified();
 }
开发者ID:wuhuayun,项目名称:JieLi_Cord,代码行数:13,代码来源:bllBase.cs


示例5: Reset

 public override void Reset()
 {
     gameObject = null;
     targetObject = null;
     maxSpeed = 10f;
     finishDistance = 1f;
     finishEvent = null;
     updateType = UpdateType.Update;
 }
开发者ID:TerribleProductions,项目名称:BREACH,代码行数:9,代码来源:MoveTowards2.cs


示例6: GetUpdateBlocks

		/// <summary>
		/// Gets the last received update blocks of the object with the given id and of the given Type
		/// </summary>
		/// <param name="type"></param>
		/// <returns></returns>
		public ICollection<UpdateBlock> GetUpdateBlocks(EntityId id, UpdateType type)
		{
			var blocks = new List<UpdateBlock>();
			foreach (var packet in UpdatePackets)
			{
				packet.GetBlocks(id, type, blocks);
			}
			return blocks;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:14,代码来源:TestFakeClient.cs


示例7: CreateDataset

 /// <summary>
 /// 创建原始数据用于更新. 由DataTable转换为DataSet
 /// </summary>
 protected DataSet CreateDataset(DataTable data, UpdateType updateType)
 {
     DataSet ds = new DataSet();
     data.AcceptChanges(); //保存缓存数据
     foreach (DataRow row in data.Rows)
         this.SetRowState(row, updateType); //设置记录状态
     ds.Tables.Add(data.Copy()); //加到新的DataSet
     return ds;
 }
开发者ID:wuhuayun,项目名称:JieLi_Cord,代码行数:12,代码来源:bllBase.cs


示例8: ImportToSitecore

		/// <summary>
		/// This method will import / update a list of videos into the Brightcove Video Library
		/// </summary>
		/// <param name="Videos">
		/// The Videos to import / update
		/// </param>
		/// <returns>
		/// returns a list of the new videos imported
		/// </returns>
		public static UpdateInsertPair<VideoItem> ImportToSitecore(this AccountItem account, List<BCVideo> Videos, UpdateType utype) {

			UpdateInsertPair<VideoItem> uip = new UpdateInsertPair<VideoItem>();

			//set all BCVideos into hashtable for quick access
			Hashtable ht = new Hashtable();
			foreach (VideoItem exVid in account.VideoLib.Videos) {
				if (!ht.ContainsKey(exVid.VideoID.ToString())) {
					//set as string, Item pair
					ht.Add(exVid.VideoID.ToString(), exVid);
				}
			}

			//Loop through the data source and add them
			foreach (BCVideo vid in Videos) {

				try {
					//remove access filter
					using (new Sitecore.SecurityModel.SecurityDisabler()) {

						VideoItem currentItem;

						//if it exists then update it
						if (ht.ContainsKey(vid.id.ToString()) && (utype.Equals(UpdateType.BOTH) || utype.Equals(UpdateType.UPDATE))) {
							currentItem = (VideoItem)ht[vid.id.ToString()];

							//add it to the new items
							uip.UpdatedItems.Add(currentItem);

							using (new EditContext(currentItem.videoItem, true, false)) {
								SetVideoFields(ref currentItem.videoItem, vid);
							}
						}
							//else just add it
						else if (!ht.ContainsKey(vid.id.ToString()) && (utype.Equals(UpdateType.BOTH) || utype.Equals(UpdateType.NEW))) {
							//Create new item
							TemplateItem templateType = account.Database.Templates["Modules/Brightcove/Brightcove Video"];

							currentItem = new VideoItem(account.VideoLib.videoLibraryItem.Add(vid.name.StripInvalidChars(), templateType));

							//add it to the new items
							uip.NewItems.Add(currentItem);

							using (new EditContext(currentItem.videoItem, true, false)) {
								SetVideoFields(ref currentItem.videoItem, vid);
							}
						}
					}
				} catch (System.Exception ex) {
					//HttpContext.Current.Response.Write(vid.name + "<br/>");
					throw new Exception("Failed on video: " + vid.name + ". " + ex.ToString());
				}
			}

			return uip;
		}
开发者ID:cryptoRebel,项目名称:sukiyoshi,代码行数:65,代码来源:VideoExtensions.cs


示例9: Update

        public Update(string theTitle, string theAuthor, UIImage theAvatar, UpdateType theType, string theText)
        {
            title = theTitle;
            author = theAuthor;
            avatar = theAvatar;
            updateText = theText;

            string picture = string.Format ("{0}.png", theType == UpdateType.FacebookUpdate ? "fb" : "tweet");

            updateTypeImage = UIImage.FromFile (picture);
        }
开发者ID:meetdpanda,项目名称:Gala,代码行数:11,代码来源:Update.cs


示例10: RaiseStatusUpdate

        internal void RaiseStatusUpdate(UpdateType type, uint processedItems)
        {
            if (StatusUpdate == null)
                return;

            if(type == UpdateType.Output)
                StatusUpdate(UpdateType.Output, this, processedItems);

            if (type == UpdateType.Input)
                StatusUpdate(UpdateType.Input, this, processedItems);
        }
开发者ID:techtronics,项目名称:mapreduce-net,代码行数:11,代码来源:IOPlugin.cs


示例11: WorkOrderUpdate

 public WorkOrderUpdate(int _workOrderId, UpdateType _updateType, int _modifiedBy, DateTime? _compStartTime, DateTime? _compEndTime, String _resultJson = "", decimal? _requestDeserialisation = null, decimal? _resultSerialisation = null)
 {
     this.WorkOrderId = _workOrderId;
     this.WorkOrderUpdateType = _updateType;
     this.ModifiedBy = _modifiedBy;
     this.ResultJson = _resultJson;
     this.ComputationStartTime = _compStartTime;
     this.ComputationEndTime = _compEndTime;
     this.RequestDeserialisationTime = _requestDeserialisation;
     this.ResultSerialisationTime = _resultSerialisation;
 }
开发者ID:mmfraser,项目名称:dissertation,代码行数:11,代码来源:WorkOrderUpdate.cs


示例12: ImportToSitecore

		public static UpdateInsertPair<PlaylistItem> ImportToSitecore(this AccountItem account, List<BCPlaylist> Playlists, UpdateType utype) {

			UpdateInsertPair<PlaylistItem> uip = new UpdateInsertPair<PlaylistItem>();

			//set all BCVideos into hashtable for quick access
			Hashtable ht = new Hashtable();
			foreach (PlaylistItem exPlay in account.PlaylistLib.Playlists) {
				if (!ht.ContainsKey(exPlay.playlistItem.ToString())) {
					//set as string, Item pair
					ht.Add(exPlay.PlaylistID.ToString(), exPlay);
				}
			}

			//Loop through the data source and add them
			foreach (BCPlaylist play in Playlists) {

				try {
					//remove access filter
					using (new Sitecore.SecurityModel.SecurityDisabler()) {

						PlaylistItem currentItem;

						//if it exists then update it
						if (ht.ContainsKey(play.id.ToString()) && (utype.Equals(UpdateType.BOTH) || utype.Equals(UpdateType.UPDATE))) {
							currentItem = (PlaylistItem)ht[play.id.ToString()];

							//add it to the new items
							uip.UpdatedItems.Add(currentItem);

							using (new EditContext(currentItem.playlistItem, true, false)) {
								SetPlaylistFields(ref currentItem.playlistItem, play);
							}
						}
							//else just add it
						else if (!ht.ContainsKey(play.id.ToString()) && (utype.Equals(UpdateType.BOTH) || utype.Equals(UpdateType.NEW))) {
							//Create new item
							TemplateItem templateType = account.Database.Templates["Modules/Brightcove/Brightcove Playlist"];
							currentItem = new PlaylistItem(account.PlaylistLib.playlistLibraryItem.Add(play.name.StripInvalidChars(), templateType));

							//add it to the new items
							uip.NewItems.Add(currentItem);

							using (new EditContext(currentItem.playlistItem, true, false)) {
								SetPlaylistFields(ref currentItem.playlistItem, play);
							}
						}
					}
				} catch (System.Exception ex) {
					throw new Exception("Failed on playlist: " + play.name + ". " + ex.ToString());
				}
			}

			return uip;
		}
开发者ID:cryptoRebel,项目名称:sukiyoshi,代码行数:54,代码来源:PlaylistExtensions.cs


示例13: UpdateRequest

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateRequest" /> class.
 /// </summary>
 /// <param name="updateType">The update type.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="update">The update.</param>
 public UpdateRequest(UpdateType updateType, BsonDocument filter, BsonDocument update)
     : base(WriteRequestType.Update)
 {
     _updateType = updateType;
     _filter = Ensure.IsNotNull(filter, nameof(filter));
     _update = Ensure.IsNotNull(update, nameof(update));
     if (updateType == UpdateType.Update && _update.ElementCount == 0)
     {
         throw new ArgumentException("Updates must have at least 1 update operator.", nameof(update));
     }
 }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:18,代码来源:UpdateRequest.cs


示例14: UpdateBlock

        public UpdateBlock(ParsedUpdatePacket parser, int index)
        {
            this.index = index;
            packet = parser;
            //Offset = parser.index;

            Type = (UpdateType)ReadByte();

            if (!Enum.IsDefined(typeof(UpdateType), (byte)Type))
            {
                throw new Exception("Invalid UpdateType '" + Type + "' in Block " + this);
            }

            // Console.WriteLine("Reading {0}-Block...", Type);

            if (Type == UpdateType.OutOfRange ||
                Type == UpdateType.Near)
            {
                var count = ReadUInt();
                EntityIds = new EntityId[count];
                for (var i = 0; i < count; i++)
                {
                    EntityIds[i] = ReadPackedEntityId();
                }
            }
            else
            {
                EntityId = ReadPackedEntityId();

                if (Type == UpdateType.Create ||
                    Type == UpdateType.CreateSelf)
                {
                    ObjectType = (ObjectTypeId)ReadByte();
                }

                if (Type == UpdateType.Create ||
                    Type == UpdateType.CreateSelf ||
                    Type == UpdateType.Movement)
                {
                    m_movement = ReadMovementBlock();
                }

                if (Type != UpdateType.Movement)
                {
                    Values = ReadValues();
                }
            }

            if (Type != UpdateType.Create && Type != UpdateType.CreateSelf)
            {
                ObjectType = EntityId.ObjectType;
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:53,代码来源:UpdateBlock.cs


示例15: PrepareUpdateData

        public override void PrepareUpdateData( byte []data, ref int offset, UpdateType type, bool forOther )
        {
            int o = offset;
            /*			int offset = 4;
            Converter.ToBytes( 1, tempBuff, ref offset );
            Converter.ToBytes( (byte)0, tempBuff, ref offset );	*/
            tempBuff[ offset++ ] = 2;
            Converter.ToBytes( Guid, tempBuff, ref offset );
            ResetBitmap();
            Converter.ToBytes( (byte)7, tempBuff, ref offset );
            Converter.ToBytes( (int)0, tempBuff, ref offset );
            Converter.ToBytes( (int)0, tempBuff, ref offset );//	Movement flags
            Converter.ToBytes( X, tempBuff, ref offset );
            Converter.ToBytes( Y, tempBuff, ref offset );
            Converter.ToBytes( Z, tempBuff, ref offset );
            Converter.ToBytes( Orientation, tempBuff, ref offset );
            Converter.ToBytes( 0, tempBuff, ref offset );
            Converter.ToBytes( 2.5f, tempBuff, ref offset );
            Converter.ToBytes( 7f, tempBuff, ref offset );
            Converter.ToBytes( 2.5f, tempBuff, ref offset );
            Converter.ToBytes( (float)4.5f, tempBuff, ref offset );//	vitesse encore ?
            Converter.ToBytes( (float)4.7222f, tempBuff, ref offset );//	vitesse encore ?
            Converter.ToBytes( (float)Math.PI, tempBuff, ref offset );//	turn rate
            Converter.ToBytes( (uint)0, tempBuff, ref offset );
            Converter.ToBytes( (uint)1, tempBuff, ref offset );

            Converter.ToBytes( (uint)0, tempBuff, ref offset );
            Converter.ToBytes( (uint)0, tempBuff, ref offset );
            Converter.ToBytes( (uint)0, tempBuff, ref offset );

            setUpdateValue( Const.OBJECT_FIELD_GUID, Guid );
            setUpdateValue( Const.OBJECT_FIELD_TYPE, 0x81 );
            setUpdateValue( Const.OBJECT_FIELD_SCALE_X, (float)1.0f );
            setUpdateValue( 6, owner );
            setUpdateValue( 8, Orientation );
            setUpdateValue( 9, X );
            setUpdateValue( 10, Y );
            setUpdateValue( 11, Z );
            int last = 0;
            setUpdateValue( last = (int)UpdateFields.CORPSE_FIELD_DISPLAY_ID, Model );
            setUpdateValue( (int)UpdateFields.CORPSE_FIELD_BYTES_1, bytes2 );
            setUpdateValue( (int)UpdateFields.CORPSE_FIELD_BYTES_2, bytes3 );
            setUpdateValue( last = (int)UpdateFields.CORPSE_FIELD_FLAGS, 4 );

            FlushUpdateData( tempBuff, ref offset, 2 + ( last / 32 ) );
            /*Console.WriteLine("teleport");
            string s = "";
            for(int t = o;t < offset;t++ )
                s += tempBuff[ t ].ToString( "X2" ) + " ";
            Debug.WriteLine(s);
            */
            //World.ToNearestPlayer( this, tempBuff, offset );
        }
开发者ID:karliky,项目名称:wowwow,代码行数:53,代码来源:Corps.cs


示例16: ForUpdateType

 public static IElementNameValidator ForUpdateType(UpdateType updateType)
 {
     switch (updateType)
     {
         case UpdateType.Replacement:
             return CollectionElementNameValidator.Instance;
         case UpdateType.Update:
             return UpdateElementNameValidator.Instance;
         default:
             return new UpdateOrReplacementElementNameValidator();
     }
 }
开发者ID:bollinim,项目名称:mongo-csharp-driver,代码行数:12,代码来源:ElementNameValidatorFactory.cs


示例17: UpdateTypeFilter

        public UpdateTypeFilter(FilterBehaviour behaviour, IMicroblog blog, UpdateType updateType)
        {
            IsIncluded = behaviour;
            Microblog = blog;
            UpdateType = updateType;

            MicroblogAccountName = blog.Credentials.AccountName;
            MicroblogName = blog.Protocol;
            UpdateTypeName = UpdateType.GetType().AssemblyQualifiedName;

            if (UpdateType.SaveType)
                UpdateTypeParameter = UpdateType.Type;
        }
开发者ID:nickhodge,项目名称:MahTweets.LawrenceHargrave,代码行数:13,代码来源:UpdateTypeFilter.cs


示例18: Update

 public ReturnValue Update(UpdateType What)
 {
     ReturnValue returnValue = ReturnValue.Success;
     if (What == UpdateType.All || What == UpdateType.FileSystem)
     {
         //update file system
         returnValue = updateFileSystem(DeployFolder, Path.GetFullPath("\\" + IpAddress), Credential);
     }
     if (What == UpdateType.All || What == UpdateType.Registry)
     {
         //todo: update registry
     }
     return(returnValue);
 }
开发者ID:johnakki,项目名称:Projects,代码行数:14,代码来源:computer.cs


示例19: LevenbergMarquardt

 public LevenbergMarquardt(Function func, JFunc Jfunc, NVector p_min, NVector p_max, NVector dp, double[] eps, UpdateType updateType)
 {
     this.func = func;
     this.Jfunc = Jfunc;
     n = p_min.N;
     this.p_min = p_min;
     if (p_max.N != n) throw new Exception("LevenbergMarquardt: size mismatch p_max");
     this.p_max = p_max;
     if (Jfunc == null)
     {
         if (dp.N != n) throw new Exception("LevenbergMarquardt: size mismatch dp");
         this.dp = dp;
     }
     MaxIter = 50 * n;
     this.eps = eps;
     this.updateType = updateType;
 }
开发者ID:DOPS-CCI,项目名称:CCI_project,代码行数:17,代码来源:LevenbergMarquardt.cs


示例20: CheckUpdate

        public async Task<UpdateType> CheckUpdate(UpdateType locked = UpdateType.None)
        {
            var releases = await _releaseClient.GetAll(RepositoryOwner, RepostoryName);

            SemVersion lockedVersion;
            switch (locked)
            {
                case UpdateType.Major:
                    lockedVersion = new SemVersion(CurrentVersion.Major + 1);
                    LatestRelease = releases.FirstOrDefault(
                        release => !release.Prerelease &&
                        Helper.StripInitialV(release.TagName) > CurrentVersion &&
                        Helper.StripInitialV(release.TagName) < lockedVersion
                    );
                    break;
                case UpdateType.Minor:
                    lockedVersion = new SemVersion(CurrentVersion.Major, CurrentVersion.Minor + 1);
                    LatestRelease = releases.FirstOrDefault(
                        release => !release.Prerelease &&
                        Helper.StripInitialV(release.TagName) > CurrentVersion &&
                        Helper.StripInitialV(release.TagName) < lockedVersion
                    );
                    break;
                default:
                    LatestRelease = releases.FirstOrDefault(
                        release => !release.Prerelease &&
                        Helper.StripInitialV(release.TagName) > CurrentVersion
                    );
                    break;
            }

            if (LatestRelease == null) return UpdateType.None;

            var tagName = LatestRelease.TagName;
            var latestVersion = Helper.StripInitialV(tagName);

            if (latestVersion.Major != CurrentVersion.Major)
                return UpdateType.Major;
            if (latestVersion.Minor != CurrentVersion.Minor)
                return UpdateType.Minor;
            if (latestVersion.Patch != CurrentVersion.Patch)
                return UpdateType.Patch;

            return UpdateType.None;
        }
开发者ID:nixxquality,项目名称:GitHubUpdate,代码行数:45,代码来源:UpdateChecker.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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