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


C# UniqueId.ToString方法代码示例

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


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

示例1: 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

示例2: GetSecurity

 public ISecurity GetSecurity(UniqueId uid)
 {
     if (uid.IsLatest)
     {
         var securityDocument = _restTarget.Resolve("securities", uid.ToString()).Get<SecurityDocument>();
         return securityDocument.Security;
     }
     else
     {
         var securityDocument = _restTarget.Resolve("securities", uid.ObjectID.ToString(), "versions", uid.Version).Get<SecurityDocument>();
         return securityDocument.Security;
     }
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:13,代码来源:RemoteSecurityMaster.cs

示例3: GetPortfolioOutputs

        public IAvailableOutputs GetPortfolioOutputs(UniqueId portfolioId, string timeStamp = "now")
        {
            ArgumentChecker.NotNull(portfolioId, "portfolioId");
            ArgumentChecker.NotNull(timeStamp, "timeStamp");

            RestTarget target = _restTarget.Resolve("portfolio").Resolve(timeStamp);
            if (_maxNodes > 0)
                target = target.Resolve("nodes", _maxNodes.ToString());
            if (_maxPositions > 0)
                target = target.Resolve("positions", _maxPositions.ToString());
            target = target.Resolve(portfolioId.ToString());
            return target.Get<IAvailableOutputs>();
        }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:13,代码来源:RemoteAvailableOutputs.cs

示例4: GetHistoricalTimeSeries

 public ILocalDateDoubleTimeSeries GetHistoricalTimeSeries(UniqueId uid, DateTimeOffset start, bool includeStart, DateTimeOffset end, bool includeEnd)
 {
     var args = new List<Tuple<string, string>>();
     if (uid.IsVersioned)
     {
         args.Add(Tuple.Create(uid.ToString(), uid.Version));
     }
     if (start != default(DateTimeOffset))
     {
         args.Add(Tuple.Create("start", DateToString(start.Date)));
         args.Add(Tuple.Create("includeStart", includeStart.ToString()));
     }
     if (end != default(DateTimeOffset))
     {
         args.Add(Tuple.Create("end", DateToString(end.Date)));
         args.Add(Tuple.Create("includeEnd", includeEnd.ToString()));
     }
     RestTarget target = _rest.Resolve("hts")
                               .Resolve(uid.ObjectID.ToString(), args.ToArray());
     return target.Get<ILocalDateDoubleTimeSeries>("timeSeries");
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:21,代码来源:RemoteHistoricalTimeSeriesSource.cs

示例5: GetSecurity

 public ISecurity GetSecurity(UniqueId uid)
 {
     var target = _restTarget.Resolve("securities").Resolve("security").Resolve(uid.ToString());
     return target.Get<ISecurity>();
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:5,代码来源:RemoteSecuritySource.cs

示例6: GetFetchRange

        static string GetFetchRange(UniqueId min, UniqueId? max)
        {
            if (max.HasValue && max.Value.Id == min.Id)
                return min.ToString ();

            var maxValue = max.HasValue ? max.Value.Id.ToString () : "*";

            return string.Format ("{0}:{1}", min.Id, maxValue);
        }
开发者ID:rusoaica,项目名称:MailKit,代码行数:9,代码来源:ImapFolder.cs

示例7: Remove

 public void Remove(UniqueId uniqueId)
 {
     _restTarget.Resolve("definitions").Resolve(uniqueId.ToString()).Delete();
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:4,代码来源:InterpolatedYieldCurveDefinitionMaster.cs

示例8: RenderRelated

		async void RenderRelated (IMailFolder folder, UniqueId uid, BodyPartMultipart related)
		{
			var start = related.ContentType.Parameters["start"];
			BodyPartText root = null;

			if (!string.IsNullOrEmpty (start)) {
				// if the 'start' parameter is set, it overrides the default behavior of using the first
				// body part as the main document.
				root = related.BodyParts.OfType<BodyPartText> ().FirstOrDefault (x => x.ContentId == start);
			} else if (related.BodyParts.Count > 0) {
				// this will generally either be a text/html part (which is what we are looking for) or a multipart/alternative
				var multipart = related.BodyParts[0] as BodyPartMultipart;

				if (multipart != null) {
					if (multipart.ContentType.Matches ("multipart", "alternative") && multipart.BodyParts.Count > 0) {
						// find the last text/html part (which will be the closest to what the sender saw in their WYSIWYG editor)
						// or, failing that, the last text part.
						for (int i = multipart.BodyParts.Count; i > 0; i--) {
							var bodyPart = multipart.BodyParts[i - 1] as BodyPartText;

							if (bodyPart == null)
								continue;

							if (bodyPart.ContentType.Matches ("text", "html")) {
								root = bodyPart;
								break;
							}

							if (root == null)
								root = bodyPart;
						}
					}
				} else {
					root = related.BodyParts[0] as BodyPartText;
				}
			}

			if (root == null)
				return;

			var text = await folder.GetBodyPartAsync (uid, root) as TextPart;

			if (text != null && text.ContentType.Matches ("text", "html")) {
				var doc = new HtmlAgilityPack.HtmlDocument ();
				var saved = new Dictionary<MimePart, string> ();
				TextPart html;

				doc.LoadHtml (text.Text);

				// find references to related MIME parts and replace them with links to links to the saved attachments
				foreach (var img in doc.DocumentNode.SelectNodes ("//img[@src]")) {
					var src = img.Attributes["src"];
					int index;
					Uri uri;

					if (src == null || src.Value == null)
						continue;

					// parse the <img src=...> attribute value into a Uri
					if (Uri.IsWellFormedUriString (src.Value, UriKind.Absolute))
						uri = new Uri (src.Value, UriKind.Absolute);
					else
						uri = new Uri (src.Value, UriKind.Relative);

					// locate the index of the attachment within the multipart/related (if it exists)
					if ((index = related.BodyParts.IndexOf (uri)) != -1) {
						var bodyPart = related.BodyParts[index] as BodyPartBasic;

						if (bodyPart == null) {
							// the body part is not a basic leaf part (IOW it's a multipart or message-part)
							continue;
						}

						var attachment = await folder.GetBodyPartAsync (uid, bodyPart) as MimePart;

						// make sure the referenced part is a MimePart (as opposed to another Multipart or MessagePart)
						if (attachment == null)
							continue;

						string fileName;

						// save the attachment (if we haven't already saved it)
						if (!saved.TryGetValue (attachment, out fileName)) {
							fileName = attachment.FileName;

							if (string.IsNullOrEmpty (fileName))
								fileName = Guid.NewGuid ().ToString ();

							if (!Directory.Exists (uid.ToString ()))
								Directory.CreateDirectory (uid.ToString ());

							fileName = Path.Combine (uid.ToString (), fileName);

							using (var stream = File.Create (fileName))
								attachment.ContentObject.DecodeTo (stream);

							saved.Add (attachment, fileName);
						}

						// replace the <img src=...> value with the local file name
//.........这里部分代码省略.........
开发者ID:jlami,项目名称:MailKit,代码行数:101,代码来源:MainWindow.cs

示例9: OriginateReply

 public OriginateReply(ICommand command, bool result, UniqueId sessionId)
     : base(command, result, sessionId.ToString())
 {
     _sessionId = sessionId;
 }
开发者ID:2594636985,项目名称:griffin.networking,代码行数:5,代码来源:Originate.cs

示例10: RemoveViewDefinition

 public void RemoveViewDefinition(UniqueId id)
 {
     _rest.Resolve("id").Resolve(id.ToString()).Delete();
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:4,代码来源:RemoteManagableViewDefinitionRepository.cs

示例11: GetViewDefinition

 public ViewDefinition GetViewDefinition(UniqueId id)
 {
     return _rest.Resolve("id").Resolve(id.ToString()).Get<ViewDefinition>();
 }
开发者ID:BietteMaxime,项目名称:OG-DotNet,代码行数:4,代码来源:RemoteViewDefinitionRepository.cs


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