本文整理汇总了C#中Altaxo.Data.AltaxoVariant.ToDouble方法的典型用法代码示例。如果您正苦于以下问题:C# AltaxoVariant.ToDouble方法的具体用法?C# AltaxoVariant.ToDouble怎么用?C# AltaxoVariant.ToDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Altaxo.Data.AltaxoVariant
的用法示例。
在下文中一共展示了AltaxoVariant.ToDouble方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetValueAt
// indexers
public override void SetValueAt(int i, AltaxoVariant val)
{
try
{
this[i] = val.ToDouble();
}
catch (Exception ex)
{
throw new ApplicationException(string.Format("Error: Try to set {0}[{1}] with the string {2}, exception: {3}", this.TypeAndName, i, val.ToString(), ex.Message));
}
}
示例2: ProcessDataBounds
/// <summary>
/// calculates the axis org and end using the databounds
/// the org / end is adjusted only if it is not fixed
/// and the DataBound object contains valid data
/// </summary>
public override void ProcessDataBounds(AltaxoVariant org, bool orgfixed, AltaxoVariant end, bool endfixed)
{
double dorg = org.ToDouble();
double dend = end.ToDouble();
ProcessDataBounds(dorg, orgfixed, dend, endfixed);
}
示例3: SetValueAt
// indexers
public override void SetValueAt(int i, AltaxoVariant val)
{
if(val.IsType(AltaxoVariant.Content.VDouble))
this[i] = val.m_Double;
else if(val.CanConvertedToDouble)
this[i] = val.ToDouble();
else
throw new ApplicationException("Error: Try to set " + this.TypeAndName + "[" + i + "] with the string " + val.ToString());
}
示例4: ProcessDataBounds
/// <summary>
/// calculates the axis org and end using the databounds
/// the org / end is adjusted only if it is not fixed
/// and the DataBound object contains valid data
/// </summary>
public override void ProcessDataBounds(AltaxoVariant org, bool orgfixed, AltaxoVariant end, bool endfixed)
{
DateTime dorg;
DateTime dend;
if (org.IsType(AltaxoVariant.Content.VDateTime))
dorg = (DateTime)org;
else if (org.CanConvertedToDouble)
dorg = new DateTime((long)(org.ToDouble() * 1E7));
else
throw new ArgumentException("Variant org is not a DateTime nor a numeric value");
if (end.IsType(AltaxoVariant.Content.VDateTime))
dend = (DateTime)end;
else if (end.CanConvertedToDouble)
dend = new DateTime((long)(end.ToDouble() * 1E7));
else
throw new ArgumentException("Variant end is not a DateTime nor a numeric value");
ProcessDataBounds(dorg, orgfixed, dend, endfixed);
}