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


C# UniqueId类代码示例

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


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


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