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


C# IActivity.SetCustomDataValue方法代码示例

本文整理汇总了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;
        }
开发者ID:TheProjecter,项目名称:st2funbeat,代码行数:31,代码来源:FitnessDataHandler.cs

示例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
         }
     }
 }
开发者ID:TheProjecter,项目名称:st2funbeat,代码行数:21,代码来源:FitnessDataHandler.cs

示例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);
     }
 }
开发者ID:TheProjecter,项目名称:st2funbeat,代码行数:25,代码来源:FitnessDataHandler.cs


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