本文整理汇总了C#中IActivity类的典型用法代码示例。如果您正苦于以下问题:C# IActivity类的具体用法?C# IActivity怎么用?C# IActivity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IActivity类属于命名空间,在下文中一共展示了IActivity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
main = new MainBase();
activity = NewMock<IActivity>();
Stub.On(activity).GetProperty("Start").Will(Return.Value(DateTime.Parse("7:00:00")));
Stub.On(activity).GetProperty("Duration").Will(Return.Value(TimeSpan.Parse("0:30:00")));
}
示例2: OnBeforeInsertStep1
public static void OnBeforeInsertStep1( IActivity activity, ISession session)
{
//System.Diagnostics.EventLog appLog = new System.Diagnostics.EventLog() ;
//appLog.Source = "SalesLogix Web Client";
//appLog.WriteEntry("Current ActivityId: " + activity.ActivityId);
//Update the activity id's
if(String.IsNullOrEmpty(activity.ActivityId) == false) {
//update the activityid for each activityAttendee record
foreach(IActivityAttendee aa in activity.ActivityAttendees) {
if(String.IsNullOrEmpty(aa.ActivityId) == true || aa.ActivityId.ToString().Trim() == ""
|| aa.ActivityId == "0") {
aa.ActivityId = activity.ActivityId;
}
}
//update the activityid for each expense record
foreach(IActivityExpense ae in activity.ActivityExpenses) {
if(String.IsNullOrEmpty(ae.ActivityId) == true || ae.ActivityId.ToString().Trim() == ""
||ae.ActivityId == "0") {
ae.ActivityId = activity.ActivityId;
}
}
}
}
示例3: Insert
public void Insert(IActivity activity)
{
if (activity == null)
return;
activity.Queue(NextActivity);
NextActivity = activity;
}
示例4: SwitchActivities
public void SwitchActivities(IActivity newActivity)
{
currentActivity.Unload();
currentActivity = newActivity;
currentActivity.Initalize();
currentActivity.LoadContent();
}
示例5: GetTrailsResultsForActivity
public static Dictionary<string, List<ITrailResult>> GetTrailsResultsForActivity(IActivity activity)
{
object[] parameters = new object[1];
parameters[0] = activity;
Dictionary<string, List<ITrailResult>> list = null;
try
{
Version version;
Type type = GetType("TrailsPlugin.Export.Integration", "TrailsPlugin", out version);
if ((type != null)) //&& (version.CompareTo(this.minVersion) >= 0))
{
list = (Dictionary<string, List<ITrailResult>>)type.GetMethod("GetTrailsResultsForActivity").Invoke(null, parameters);
//throw new Exception(list.Count.ToString() + "fero");
}
}
catch (Exception e)
{
string error = e.Message;
if (e.InnerException != null)
{
error += "\n\n" + e.InnerException.Message;
}
throw new Exception(error);
}
return list;
}
示例6: Queue
public void Queue( IActivity activity )
{
if( NextActivity != null )
NextActivity.Queue( activity );
else
NextActivity = activity;
}
示例7: GetUniqueRoutesForActivity
public static IList<IActivity> GetUniqueRoutesForActivity(IActivity activity, System.Windows.Forms.ProgressBar progressBar)
{
IList<IActivity> results = null;
try
{
if (progressBar == null)
progressBar = new System.Windows.Forms.ProgressBar();
if (GetUniqueRoutes != null)
{
MethodInfo methodInfo = GetUniqueRoutes.GetMethod(findSimilarRoutes);
object resultFromURPlugIn = methodInfo.Invoke(activity, new object[] { activity, progressBar });
results = (IList<IActivity>)resultFromURPlugIn;
}
}
catch (Exception e)
{
// Log error?
throw new Exception(string.Format(IntegrationUtility.OtherPluginExceptionText,
UniquePlugin + ".dll", UniqueRoutesPluginName) + Environment.NewLine, e);
}
if (GetUniqueRoutes == null)
{
throw new Exception(string.Format(IntegrationUtility.OtherPluginExceptionText,
UniquePlugin + ".dll", UniqueRoutesPluginName) + Environment.NewLine);
}
return results;
}
示例8: IntervalResult
public IntervalResult(IActivity activity, IntervalResultCache resultCache, double distance)
{
this.activity = activity;
this.resultCache = resultCache;
this.Distance = distance;
this.factor = 1000.0 / distance;
}
示例9: findSimilarRoutes
public static IList<IActivity> findSimilarRoutes(IActivity refActivity, IList<IActivity> activities, bool activityCompare, bool catCheck, System.Windows.Forms.ProgressBar progressBar)
{
if (refActivity == null ||
refActivity.GPSRoute == null ||
activityCompare && (false/*catCheck && !isAllowedActivity(refActivity)*/))
return new List<IActivity>();
return findSimilarRoutes(refActivity.GPSRoute, refActivity.ReferenceId, activities, activityCompare, progressBar);
}
示例10: TemperatureResult
public TemperatureResult(IActivity activity, float temperature, float actual, TimeSpan time, double dist)
{
this.activity = activity;
double f = getTemperatureFactor(temperature) / getTemperatureFactor(actual);
this.EstimatedTime = Predict.scaleTime(time, f);
this.Distance = dist;
this.Temperature = temperature;
}
示例11: Insert
/// <summary>
/// Inserts an element into the ActivityCollection at the specified index
/// </summary>
/// <param name="index">
/// The index at which the IActivity is to be inserted.
/// </param>
/// <param name="value">
/// The IActivity to insert.
/// </param>
public virtual void Insert(int index, IActivity value)
{
CheckParent();
mList.Insert(index, value);
value.Parent = mParentActivity;
}
示例12: ActivityModel
public ActivityModel(IActivity activity)
{
Properties = activity.Properties;
Type = activity.Type.ToString();
Message = activity.Message;
Id = activity.Id;
}
示例13: Calculate
public static void Calculate(IActivity activity, double vdot, TimeSpan time, double distance, double maxHr)
{
Predict.SetAgeSexFromActivity(activity);
m_zones = getZones();
m_percentages = getPercentages(vdot);
m_hrs = getHeartRates(maxHr, m_percentages);
m_paces = getSpeeds(vdot, time, distance, m_percentages);
}
示例14: TrainingResult
public TrainingResult(IActivity activity, string ZoneDistance, double PercentOfMax, double TrainRaceHR, double Speed)
{
this.activity = activity;
this.ZoneDistance = ZoneDistance;
this.PercentOfMax = PercentOfMax;
this.TrainRaceHR = TrainRaceHR;
this.Speed = Speed;
}
示例15: Cancel
public void Cancel( Actor self )
{
var unit = self.traits.Get<Unit>();
desiredFacing = unit.Facing;
NextActivity = null;
}