本文整理汇总了C#中TimeEntryModel类的典型用法代码示例。如果您正苦于以下问题:C# TimeEntryModel类的具体用法?C# TimeEntryModel怎么用?C# TimeEntryModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimeEntryModel类属于命名空间,在下文中一共展示了TimeEntryModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public static async Task<EditTimeEntryGroupViewModel> Init (List<string> timeEntryIds)
{
var timeEntryList = await GetTimeEntryDataList (timeEntryIds);
var model = new TimeEntryModel (timeEntryList.Last ());
await model.LoadAsync ();
return new EditTimeEntryGroupViewModel (model, timeEntryList);
}
示例2: OnActionButtonTouchUpInside
private async void OnActionButtonTouchUpInside (object sender, EventArgs e)
{
if (isActing) {
return;
}
isActing = true;
try {
if (currentTimeEntry != null && currentTimeEntry.State == TimeEntryState.Running) {
await currentTimeEntry.StopAsync ();
// Ping analytics
ServiceContainer.Resolve<ITracker>().SendTimerStopEvent (TimerStopSource.App);
} else if (timeEntryManager != null) {
currentTimeEntry = (TimeEntryModel)timeEntryManager.Draft;
if (currentTimeEntry == null) {
return;
}
await currentTimeEntry.StartAsync ();
var controllers = new List<UIViewController> (parentController.NavigationController.ViewControllers);
controllers.Add (new EditTimeEntryViewController (currentTimeEntry));
if (ServiceContainer.Resolve<SettingsStore> ().ChooseProjectForNew) {
controllers.Add (new ProjectSelectionViewController (currentTimeEntry));
}
parentController.NavigationController.SetViewControllers (controllers.ToArray (), true);
// Ping analytics
ServiceContainer.Resolve<ITracker>().SendTimerStartEvent (TimerStartSource.AppNew);
}
} finally {
isActing = false;
}
}
示例3: EditTimeEntryFragment
public EditTimeEntryFragment (TimeEntryModel model)
{
var args = new Bundle ();
args.PutString (TimeEntryIdArgument, model.Id.ToString ());
Arguments = args;
}
示例4: RecordTime
bool RecordTime(TimeEntry timeEntry, Task task)
{
var timeEntryModel = new TimeEntryModel
{
Date = GetCompatibleDate(timeEntry).ToString("O"),
Notes = timeEntry.Comment,
TimeString = timeEntry.MinutesSpent + "m",
DurationSeconds = timeEntry.MinutesSpent*60,
ProjectId = timeEntry.Project?.Id,
TaskId = task?.Id,
WorkItems = new List<string>(), // TODO: add functionality for tracking WorkItems
};
var post = new RestRequest
{
Resource = "Time/Save",
Method = Method.POST,
RequestFormat = DataFormat.Json
};
post.AddBody(timeEntryModel);
var result = _api.Execute<TimeEntryModel>(post);
return result != null;
}
示例5: TestSqliteIgnoreOnTimeEntry
public void TestSqliteIgnoreOnTimeEntry ()
{
var cache = new AttributeLookupCache<SQLite.IgnoreAttribute> ();
var entry = new TimeEntryModel ();
Assert.IsTrue (cache.HasAttribute (entry, TimeEntryModel.PropertyWorkspace));
Assert.IsFalse (cache.HasAttribute (entry, TimeEntryModel.PropertyStartTime));
}
示例6: RecentTimeEntryContinueDialogFragment
public RecentTimeEntryContinueDialogFragment (TimeEntryModel model)
{
var args = new Bundle ();
args.PutString (TimeEntryIdArgument, model.Id.ToString ());
Arguments = args;
}
示例7: StartStopTimeEntry
public async void StartStopTimeEntry()
{
if (isActing) {
return;
}
isActing = true;
try {
if (currentTimeEntry != null && currentTimeEntry.State == TimeEntryState.Running) {
await currentTimeEntry.StopAsync ();
// Ping analytics
ServiceContainer.Resolve<ITracker>().SendTimerStopEvent (TimerStopSource.Widget);
} else if (timeEntryManager != null) {
currentTimeEntry = (TimeEntryModel)timeEntryManager.Draft;
if (currentTimeEntry == null) {
return;
}
await currentTimeEntry.StartAsync ();
// Show new screen on platform
widgetUpdateService.ShowNewTimeEntryScreen (currentTimeEntry);
// Ping analytics
ServiceContainer.Resolve<ITracker>().SendTimerStartEvent (TimerStartSource.WidgetNew);
}
} finally {
isActing = false;
}
}
示例8: ChangeTimeEntryStopTimeDialogFragment
public ChangeTimeEntryStopTimeDialogFragment (TimeEntryModel model) : base ()
{
var args = new Bundle ();
args.PutString (TimeEntryIdArgument, model.Id.ToString ());
Arguments = args;
}
示例9: BaseDateTimeDialogFragment
protected BaseDateTimeDialogFragment (TimeEntryModel model) : base ()
{
var args = new Bundle ();
args.PutString (TimeEntryIdArgument, model.Id.ToString ());
Arguments = args;
}
示例10: TryShow
public static bool TryShow (FragmentManager fragmentManager, TimeEntryModel model)
{
var settingsStore = ServiceContainer.Resolve<SettingsStore> ();
if (settingsStore.ReadContinueDialog)
return false;
new RecentTimeEntryContinueDialogFragment (model).Show (fragmentManager, "notice_dialog");
return true;
}
示例11: ContinueTimeEntry
private void ContinueTimeEntry (TimeEntryModel model)
{
var entry = model.Continue ();
var bus = ServiceContainer.Resolve<MessageBus> ();
bus.Send (new UserTimeEntryStateChangeMessage (this, entry));
DurOnlyNoticeDialogFragment.TryShow (FragmentManager);
}
示例12: OnCreate
public override void OnCreate (Bundle state)
{
base.OnCreate (state);
model = Model.ById<TimeEntryModel> (TimeEntryId);
if (model == null) {
Dismiss ();
}
}
示例13: OnCreate
public override void OnCreate (Bundle state)
{
base.OnCreate (state);
timeEntry = Model.ById<TimeEntryModel> (TimeEntryId);
workspace = Model.ById<WorkspaceModel> (WorkspaceId);
if (workspace == null) {
Dismiss ();
}
}
示例14: LoadData
private async void LoadData ()
{
model = new TimeEntryModel (TimeEntryId);
await model.LoadAsync ();
if (model.Workspace == null || model.Workspace.Id == Guid.Empty) {
Dismiss ();
} else {
modelLoaded = true;
}
}
示例15: LoadData
private async void LoadData ()
{
model = new TimeEntryModel (TimeEntryId);
await model.LoadAsync ();
if (model.Workspace == null || model.Workspace.Id == Guid.Empty) {
// Invalid model, do nothing.
} else {
modelLoaded = true;
}
}