本文整理汇总了C#中Altaxo.IsType方法的典型用法代码示例。如果您正苦于以下问题:C# Altaxo.IsType方法的具体用法?C# Altaxo.IsType怎么用?C# Altaxo.IsType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Altaxo
的用法示例。
在下文中一共展示了Altaxo.IsType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: PhysicalVariantToNormal
/// <summary>
/// PhysicalVariantToNormal translates physical values into a normal value linear along the axis
/// a physical value of the axis origin must return a value of zero
/// a physical value of the axis end must return a value of one
/// the function physicalToNormal must be provided by any derived class
/// </summary>
/// <param name="x">the physical value</param>
/// <returns>
/// the normalized value linear along the axis,
/// 0 for axis origin, 1 for axis end</returns>
public override double PhysicalVariantToNormal(Altaxo.Data.AltaxoVariant x)
{
if (x.IsType(AltaxoVariant.Content.VDateTime))
return PhysicalToNormal((DateTime)x);
else if (x.CanConvertedToDouble)
return PhysicalToNormal(new DateTime((long)(x.ToDouble() * 10000000)));
else throw new ArgumentException("Variant x is neither DateTime nor numeric");
}
示例3: 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;
}
}
示例4: 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;
}