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

C# UniqueId类代码示例

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

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



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

示例1: RegionServer

        /// <summary>
        ///     Constructor taking the path to the configuration file. 
        ///     Starts the lidgren server to start listening for connections, and 
        ///     initializes all data structres and such.
        /// </summary>
        /// <param name="configpath"></param>
        public RegionServer(string configpath)
        {
            //Load this region server's junk from xml
            XmlSerializer deserializer = new XmlSerializer(typeof(RegionConfig));
            RegionConfig regionconfig = (RegionConfig)deserializer.Deserialize(XmlReader.Create(configpath));

            //Create the server
            var config = new NetPeerConfiguration(regionconfig.ServerName);
            config.Port = regionconfig.ServerPort;
            LidgrenServer = new NetServer(config);
            LidgrenServer.Start();

            //Initizlie our data structures
            Characters = new Dictionary<Guid, Character>();
            UserIdToMasterServer = new Dictionary<Guid, NetConnection>();
            TeleportEnters = new List<TeleportEnter>(regionconfig.TeleportEnters);
            TeleportExits = new List<TeleportExit>(regionconfig.TeleportExits);
            ItemSpawns = new List<ItemSpawn>(regionconfig.ItemSpawns);
            ItemSpawnIdGenerator = new UniqueId();
            ItemSpawnsWaitingForSpawn = new Dictionary<ItemSpawn, DateTime>();

            foreach(ItemSpawn spawn in ItemSpawns)
                ItemSpawnIdGenerator.RegisterId(spawn.Id);

            RegionId = regionconfig.RegionId;
        }
开发者ID:addiem7c5,项目名称:Old-Stability-Stuff,代码行数:32,代码来源:RegionServer.cs


示例2: TryParseUidSet

		/// <summary>
		/// Attempts to parse an atom token as a set of UIDs.
		/// </summary>
		/// <returns><c>true</c> if the UIDs were successfully parsed, otherwise <c>false</c>.</returns>
		/// <param name="atom">The atom string.</param>
		/// <param name="uids">The UIDs.</param>
		public static bool TryParseUidSet (string atom, out UniqueId[] uids)
		{
			var ranges = atom.Split (new [] { ',' }, StringSplitOptions.RemoveEmptyEntries);
			var list = new List<UniqueId> ();

			uids = null;

			for (int i = 0; i < ranges.Length; i++) {
				var minmax = ranges[i].Split (':');
				uint min;

				if (!uint.TryParse (minmax[0], out min) || min == 0)
					return false;

				if (minmax.Length == 2) {
					uint max;

					if (!uint.TryParse (minmax[1], out max) || max == 0)
						return false;

					for (uint uid = min; uid <= max; uid++)
						list.Add (new UniqueId (uid));
				} else if (minmax.Length == 1) {
					list.Add (new UniqueId (min));
				} else {
					return false;
				}
			}

			uids = list.ToArray ();

			return true;
		}
开发者ID:yijunwu,项目名称:scheduledmailsender,代码行数:39,代码来源:ImapUtils.cs


示例3: ManageableSecurity

 protected ManageableSecurity(string name, string securityType, UniqueId uniqueId, ExternalIdBundle identifiers)
 {
     _name = name;
     _securityType = string.Intern(securityType); // Should be a small static set
     _uniqueId = uniqueId;
     _identifiers = identifiers;
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:7,代码来源:ManageableSecurity.cs


示例4: ChangeEvent

 public ChangeEvent(ChangeType type, UniqueId beforeId, UniqueId afterId, Instant versionInstant)
 {
     _type = type;
     _beforeId = beforeId;
     _afterId = afterId;
     _versionInstant = versionInstant;
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:7,代码来源:ChangeEvent.cs


示例5: PortfolioNode

 internal PortfolioNode(UniqueId uniqueId, string name, IList<PortfolioNode> subNodes, IList<IPosition> positions)
 {
     _uniqueId = uniqueId;
     _name = name;
     _subNodes = subNodes;
     _positions = positions;
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:7,代码来源:PortfolioNode.cs


示例6: SimplePosition

 public SimplePosition(UniqueId identifier, decimal quantity, ExternalIdBundle securityKey, IList<ITrade> trades)
 {
     _securityKey = securityKey;
     _trades = trades;
     _identifier = identifier;
     _quantity = quantity;
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:7,代码来源:SimplePosition.cs


示例7: SimpleTrade

 public SimpleTrade(UniqueId uniqueId, DateTimeOffset tradeDate, ExternalIdBundle securityKey, CounterpartyImpl counterparty, decimal quantity)
 {
     _uniqueId = uniqueId;
     _quantity = quantity;
     _securityKey = securityKey;
     _counterparty = counterparty;
     _tradeDate = tradeDate;
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:8,代码来源:SimpleTrade.cs


示例8: UidSearchQuery

		/// <summary>
		/// Initializes a new instance of the <see cref="T:MailKit.Search.UidSearchQuery"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new unique identifier-based search query.
		/// </remarks>
		/// <param name="uid">The unique identifier to match against.</param>
		/// <exception cref="System.ArgumentException">
		/// <paramref name="uid"/> is an invalid unique identifier.
		/// </exception>
		public UidSearchQuery (UniqueId uid) : base (SearchTerm.Uid)
		{
			if (!uid.IsValid)
				throw new ArgumentException ("Cannot search for an invalid unique identifier.", nameof (uid));

			Uids = new UniqueIdSet (SortOrder.Ascending);
			Uids.Add (uid);
		}
开发者ID:jstedfast,项目名称:MailKit,代码行数:18,代码来源:UidSearchQuery.cs


示例9: Deflect

        /// <summary>
        /// Initializes a new instance of the <see cref="Deflect"/> class.
        /// </summary>
        /// <param name="id">Channel id</param>
        /// <param name="address">Sip address to deflect to</param>
        public Deflect(UniqueId id, SipAddress address)
        {
            if (id == null) throw new ArgumentNullException("id");
            if (address == null) throw new ArgumentNullException("address");

            _id = id;
            _address = address;
        }
开发者ID:2594636985,项目名称:griffin.networking,代码行数:13,代码来源:Deflect.cs


示例10: StartRecording

 /// <summary>
 /// Initializes a new instance of the <see cref="StartRecording"/> class.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="path">FreeSwitch relative path (directory + filename).</param>
 public StartRecording(UniqueId id, string path)
 {
     if (id == null) throw new ArgumentNullException("id");
     if (path == null) throw new ArgumentNullException("path");
     _id = id;
     _path = path;
     RecordingLimit = TimeSpan.MinValue;
 }
开发者ID:2594636985,项目名称:griffin.networking,代码行数:13,代码来源:StartRecording.cs


示例11: Get

 public YieldCurveDefinitionDocument Get(UniqueId uniqueId)
 {
     var resp = _restTarget.Resolve("definitions", uniqueId.ToString()).Get<YieldCurveDefinitionDocument>();
     if (resp == null || resp.UniqueId == null || resp.YieldCurveDefinition == null)
     {
         throw new ArgumentException("Not found", "uniqueId");
     }
     return resp;
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:9,代码来源:InterpolatedYieldCurveDefinitionMaster.cs


示例12: SetVariable

 /// <summary>
 /// Initializes a new instance of the <see cref="SetVariable"/> class.
 /// </summary>
 /// <param name="id">Channel id.</param>
 /// <param name="name">Variable name as declared by FreeSWITCH.</param>
 /// <param name="value">Variable value, <see cref="string.Empty"/> if you which to unset it.</param>
 public SetVariable(UniqueId id, string name, string value)
 {
     if (id == null) throw new ArgumentNullException("id");
     if (name == null) throw new ArgumentNullException("name");
     if (value == null) throw new ArgumentNullException("value");
     _channelId = id;
     _name = name;
     _value = value;
 }
开发者ID:2594636985,项目名称:griffin.networking,代码行数:15,代码来源:SetVariable.cs


示例13: Sleep

        /// <summary>
        /// Initializes a new instance of the <see cref="Sleep"/> class.
        /// </summary>
        /// <param name="id">Channel id.</param>
        /// <param name="duration">The duration.</param>
        public Sleep(UniqueId id, TimeSpan duration)
        {
            if (id == null) throw new ArgumentNullException("id");
            if (_duration == TimeSpan.MinValue)
                throw new ArgumentException("Duration must be larger than 0 ms.", "duration");

            _id = id;
            _duration = duration;
        }
开发者ID:2594636985,项目名称:griffin.networking,代码行数:14,代码来源:Sleep.cs


示例14: Get

 public PortfolioDocument Get(UniqueId uniqueId)
 {
     ArgumentChecker.NotNull(uniqueId, "uniqueId");
     var resp = _restTarget.Resolve("portfolios").Resolve(uniqueId.ObjectID.ToString()).Get<PortfolioDocument>();
     if (resp == null || resp.UniqueId == null || resp.Portfolio == null)
     {
         throw new ArgumentException("Not found", "uniqueId");
     }
     return resp;
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:10,代码来源:RemotePortfolioMaster.cs


示例15: SendMsg

        /// <summary>
        /// Initializes a new instance of the <see cref="SendMsg"/> class.
        /// </summary>
        /// <param name="id">Channel UUID.</param>
        /// <param name="callCommand">The call command.</param>
        protected SendMsg(UniqueId id, string callCommand)
        {
            if (id == null)
                throw new ArgumentNullException("id");
            if (string.IsNullOrEmpty(callCommand))
                throw new ArgumentNullException("callCommand");

            _callCommand = callCommand;
            _id = id;
        }
开发者ID:2594636985,项目名称:griffin.networking,代码行数:15,代码来源:SendMsg.cs


示例16: TestFormattingNonSequentialUids

		public void TestFormattingNonSequentialUids ()
		{
			UniqueId[] uids = new UniqueId[] {
				new UniqueId (1), new UniqueId (3), new UniqueId (5),
				new UniqueId (7), new UniqueId (9)
			};
			string expect = "1,3,5,7,9";
			string actual;

			actual = ImapUtils.FormatUidSet (uids);
			Assert.AreEqual (expect, actual, "Formatting a non-sequential list of uids.");
		}
开发者ID:yijunwu,项目名称:scheduledmailsender,代码行数:12,代码来源:ImapUtilsTests.cs


示例17: PixelShader

        internal PixelShader(SlimDX.Direct3D11.PixelShader pixelShader)
        {
            #if ASSERT
            if (pixelShader == null)
            {
                throw new ArgumentNullException("pixelShader");
            }
            #endif

            resourceOwner = false;
            this.pixelShader = pixelShader;
            uniqueId = new UniqueId<PixelShader>();
        }
开发者ID:HaKDMoDz,项目名称:WorldRender,代码行数:13,代码来源:PixelShader.cs


示例18: Texture2d

        internal Texture2d(SlimDX.Direct3D11.Device device, string fileName)
        {
            #if ASSERT
            if (device == null)
            {
                throw new ArgumentNullException("device");
            }
            #endif

            texture2d = SlimDX.Direct3D11.Texture2D.FromFile(device, fileName);
            shaderResourceView = new SlimDX.Direct3D11.ShaderResourceView(device, texture2d);
            uniqueId = new UniqueId<Texture2d>();
        }
开发者ID:HaKDMoDz,项目名称:WorldRender,代码行数:13,代码来源:Texture2d.cs


示例19: TestFormattingSimpleUidRange

		public void TestFormattingSimpleUidRange ()
		{
			UniqueId[] uids = new UniqueId[] {
				new UniqueId (1), new UniqueId (2), new UniqueId (3),
				new UniqueId (4), new UniqueId (5), new UniqueId (6),
				new UniqueId (7), new UniqueId (8), new UniqueId (9)
			};
			string expect = "1:9";
			string actual;

			actual = ImapUtils.FormatUidSet (uids);
			Assert.AreEqual (expect, actual, "Formatting a simple range of uids failed.");
		}
开发者ID:yijunwu,项目名称:scheduledmailsender,代码行数:13,代码来源:ImapUtilsTests.cs


示例20: RenderTarget

        internal RenderTarget(SlimDX.Direct3D11.RenderTargetView renderTargetView)
        {
            #if ASSERT
            if (renderTargetView == null)
            {
                throw new ArgumentNullException("renderTargetView");
            }
            #endif

            this.renderTargetView = renderTargetView;
            resourceOwner = false;
            uniqueId = new UniqueId<RenderTarget>();
        }
开发者ID:HaKDMoDz,项目名称:WorldRender,代码行数:13,代码来源:RenderTarget.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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