本文整理汇总了C#中IActivity.SetCustomDataValue方法的典型用法代码示例。如果您正苦于以下问题:C# IActivity.SetCustomDataValue方法的具体用法?C# IActivity.SetCustomDataValue怎么用?C# IActivity.SetCustomDataValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IActivity
的用法示例。
在下文中一共展示了IActivity.SetCustomDataValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: boGetExported
public bool boGetExported(IActivity activity)
{
if (activity != null)
{
#if !ST_2_1
int? ExportedCustData = (int?)(activity.GetCustomDataValue(FunbeatExportedField) as double?);
#else
int? ExportedCustData = null;
#endif
// Upgrade from old to new method of marking an activity to be exported
if (ExportedCustData == null)
{
// Check if metadata string exists and update the cust data field
bool boExported = (activity.Metadata.Source.IndexOf("Funbeated") >= 0);
#if !ST_2_1
if (boExported)
activity.SetCustomDataValue(FunbeatExportedField, (double?)1.0);
else
activity.SetCustomDataValue(FunbeatExportedField, (double?)0.0);
#endif
return boExported;
}
else
{
return (ExportedCustData != 0);
}
}
else
return false;
}
示例2: SetExported
public void SetExported(IActivity activity, bool boExported)
{
if (activity != null)
{
if (boExported)
{
// Use both old method (metadata string) and new method (cust data field)
activity.Metadata.Source += "Funbeated";
#if !ST_2_1
activity.SetCustomDataValue(FunbeatExportedField, (double?)1.0);
#endif
}
else
{
//TODO: Add code to remove the Funbeated string
#if !ST_2_1
activity.SetCustomDataValue(FunbeatExportedField, (double?)0.0);
#endif
}
}
}
示例3: SetCustomFieldsData
public void SetCustomFieldsData(IActivity activity,
int? RPE,
double? TE,
int? Repetitions,
int? Sets)
{
if (activity != null)
{
int? CurrentRPE, CurrentRepetitions, CurrentSets;
double? CurrentTE;
GetCustomFieldsData(activity,
out CurrentRPE,
out CurrentTE,
out CurrentRepetitions,
out CurrentSets);
if (CurrentRPE != RPE)
activity.SetCustomDataValue(RPEField, (double?)RPE);
if (CurrentTE != TE)
activity.SetCustomDataValue(TEField, TE);
if (CurrentRepetitions != Repetitions)
activity.SetCustomDataValue(RepetitionsField, (double?)Repetitions);
if (CurrentSets != Sets)
activity.SetCustomDataValue(SetsField, (double?)Sets);
}
}