當前位置: 首頁>>代碼示例>>C#>>正文


C# Altaxo.ToString方法代碼示例

本文整理匯總了C#中Altaxo.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# Altaxo.ToString方法的具體用法?C# Altaxo.ToString怎麽用?C# Altaxo.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Altaxo的用法示例。


在下文中一共展示了Altaxo.ToString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FormatItem

		protected override string FormatItem(Altaxo.Data.AltaxoVariant item)
		{
			if (item.IsType(Altaxo.Data.AltaxoVariant.Content.VDouble))
				return FormatItem((double)item);
			else
				return item.ToString();
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:7,代碼來源:NumericLabelFormattingFixed.cs

示例2: FormatItem

		protected override string FormatItem(Altaxo.Data.AltaxoVariant item)
		{
			const double tolerance = 1E-8;
			int denominator = 1440; // this allows for resolution of a quarter of a degree

			if (!item.CanConvertedToDouble)
				return item.ToString();

			double value = (double)item;
			double multipvalue = value * denominator / Math.PI;
			double multipround = Math.Round(multipvalue, 0);

			if (Math.Abs(multipvalue - multipround) < tolerance && Math.Abs(multipround) < int.MaxValue) // then it is a ratio of pi
			{
				int nominator = (int)multipround;
				Shorten(ref nominator, ref denominator);
				if (nominator == 0)
					return "0";
				else
				{
					string pre;
					if (nominator == 1)
						pre = string.Empty;
					else if (nominator == -1)
						pre = "-";
					else
						pre = nominator.ToString();

					string post;
					if (denominator == 1)
						post = string.Empty;
					else
						post = "/" + denominator.ToString();

					return pre + '\u03c0' + post;
				}
			}

			return item.ToString();
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:40,代碼來源:NumericLabelFormattingRadian.cs

示例3: FormatItem

		protected override string FormatItem(Altaxo.Data.AltaxoVariant item)
		{
			return item.ToString();
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:4,代碼來源:NumericLabelFormattingAuto.cs

示例4: PhysicalVariantToNormal

		public override double PhysicalVariantToNormal(Altaxo.Data.AltaxoVariant x)
		{
			if (x.IsType(Altaxo.Data.AltaxoVariant.Content.VString))
			{
				int idx = _dataBounds.IndexOf(x.ToString());
				return idx < 0 ? double.NaN : (1 + idx - _cachedAxisOrg) * _cachedOneByAxisSpan;
			}
			else if (x.CanConvertedToDouble)
			{
				return (x.ToDouble() - _cachedAxisOrg) * _cachedOneByAxisSpan;
			}
			else
			{
				return double.NaN;
			}
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:16,代碼來源:TextScale.cs

示例5: Add

    /// <summary>
    /// Processes a single value .
    /// If the data value is text, the boundaries are
    /// updated and the number of items is increased by one (if not contained already). The function returns true
    /// in this case. On the other hand, if the value is outside the range, the function has to
    /// return false.
    /// </summary>
    /// <param name="item">The data item.</param>
    /// <returns>True if data is in the tracked range, false if the data is not in the tracked range.</returns>
    public  bool Add(Altaxo.Data.AltaxoVariant item)
    {
      if(item.IsType(Altaxo.Data.AltaxoVariant.Content.VString))
      {
        string s = item.ToString();
        if (!_itemList.Contains(s))
        {
          _itemList.Add(s);

          if (_eventSuspendCount == 0)
          {
            OnNumberOfItemsChanged();
            OnBoundaryChanged(false, true);
          }

          return true;
        }
      }
      return false;
    }
開發者ID:xuchuansheng,項目名稱:GenXSource,代碼行數:29,代碼來源:TextBoundaries.cs


注:本文中的Altaxo.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。