• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TimeEntryModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TimeEntryModel的典型用法代码示例。如果您正苦于以下问题:C# TimeEntryModel类的具体用法?C# TimeEntryModel怎么用?C# TimeEntryModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TimeEntryModel类属于命名空间,在下文中一共展示了TimeEntryModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
 }
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:7,代码来源:EditTimeEntryGroupViewModel.cs


示例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;
            }
        }
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:35,代码来源:TimerNavigationController.cs


示例3: EditTimeEntryFragment

        public EditTimeEntryFragment (TimeEntryModel model)
        {
            var args = new Bundle ();
            args.PutString (TimeEntryIdArgument, model.Id.ToString ());

            Arguments = args;
        }
开发者ID:jblj,项目名称:mobile,代码行数:7,代码来源:EditTimeEntryFragment.cs


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


示例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));
 }
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:7,代码来源:AttributeLookupCacheTest.cs


示例6: RecentTimeEntryContinueDialogFragment

        public RecentTimeEntryContinueDialogFragment (TimeEntryModel model)
        {
            var args = new Bundle ();
            args.PutString (TimeEntryIdArgument, model.Id.ToString ());

            Arguments = args;
        }
开发者ID:jblj,项目名称:mobile,代码行数:7,代码来源:RecentTimeEntryContinueDialogFragment.cs


示例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;
            }
        }
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:30,代码来源:WidgetSyncManager.cs


示例8: ChangeTimeEntryStopTimeDialogFragment

        public ChangeTimeEntryStopTimeDialogFragment (TimeEntryModel model) : base ()
        {
            var args = new Bundle ();
            args.PutString (TimeEntryIdArgument, model.Id.ToString ());

            Arguments = args;
        }
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:7,代码来源:ChangeTimeEntryStopTimeDialogFragment.cs


示例9: BaseDateTimeDialogFragment

        protected BaseDateTimeDialogFragment (TimeEntryModel model) : base ()
        {
            var args = new Bundle ();
            args.PutString (TimeEntryIdArgument, model.Id.ToString ());

            Arguments = args;
        }
开发者ID:jblj,项目名称:mobile,代码行数:7,代码来源:BaseDateTimeDialogFragment.cs


示例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;
        }
开发者ID:jblj,项目名称:mobile,代码行数:9,代码来源:RecentTimeEntryContinueDialogFragment.cs


示例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);
        }
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:9,代码来源:LogTimeEntriesListFragment.cs


示例12: OnCreate

        public override void OnCreate (Bundle state)
        {
            base.OnCreate (state);

            model = Model.ById<TimeEntryModel> (TimeEntryId);
            if (model == null) {
                Dismiss ();
            }
        }
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:9,代码来源:ChangeTimeEntryStopTimeDialogFragment.cs


示例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 ();
            }
        }
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:10,代码来源:CreateProjectDialogFragment.cs


示例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;
     }
 }
开发者ID:karabatov,项目名称:mobile,代码行数:10,代码来源:ChooseTimeEntryProjectDialogFragment.cs


示例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;
     }
 }
开发者ID:jblj,项目名称:mobile,代码行数:10,代码来源:RecentTimeEntryContinueDialogFragment.cs


示例16: OnStart

        public void OnStart ()
        {
            currentEntry = TimeEntryModel.FindRunning () ?? TimeEntryModel.GetDraft ();

            // Start listening for changes model changes
            var bus = ServiceContainer.Resolve<MessageBus> ();
            subscriptionModelChanged = bus.Subscribe<ModelChangedMessage> (OnModelChanged);

            canRebind = true;
            Rebind ();
        }
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:11,代码来源:TimerComponent.cs


示例17: EditTimeEntryGroupViewModel

        EditTimeEntryGroupViewModel (TimeEntryModel model, List<TimeEntryData> timeEntryList)
        {
            this.model = model;
            this.timeEntryList = timeEntryList;
            this.durationTimer = new Timer();

            this.model.PropertyChanged += OnPropertyChange;
            this.durationTimer.Elapsed += DurationTimerCallback;

            ServiceContainer.Resolve<ITracker> ().CurrentScreen = "Edit Grouped Time Entry";
            UpdateView ();
        }
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:12,代码来源:EditTimeEntryGroupViewModel.cs


示例18: EditTimeEntryViewModel

        EditTimeEntryViewModel (TimeEntryModel model, List<TagData> tagList)
        {
            this.model = model;
            durationTimer = new Timer ();
            TagList = tagList;

            model.PropertyChanged += OnPropertyChange;
            durationTimer.Elapsed += DurationTimerCallback;

            ServiceContainer.Resolve<ITracker> ().CurrentScreen = "Edit Time Entry";
            UpdateView ();
        }
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:12,代码来源:EditTimeEntryViewModel.cs


示例19: OnActiveTimeEntryChanged

        private void OnActiveTimeEntryChanged ()
        {
            var data = TimeEntryManager.ActiveTimeEntry;

            if (activeTimeEntryModel == null) {
                activeTimeEntryModel = new TimeEntryModel (data);
            } else {
                activeTimeEntryModel.Data = data;
            }

            SyncNotification ();
        }
开发者ID:BradChang,项目名称:mobile,代码行数:12,代码来源:AndroidNotificationManager.cs


示例20: CreateProjectDialogFragment

        public CreateProjectDialogFragment (TimeEntryModel timeEntry, WorkspaceModel workspace, int color)
        {
            var args = new Bundle ();

            if (timeEntry != null) {
                args.PutString (TimeEntryIdArgument, timeEntry.Id.ToString ());
            }
            args.PutString (WorkspaceIdArgument, workspace.Id.ToString ());
            args.PutInt (ProjectColorArgument, color);

            Arguments = args;
        }
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:12,代码来源:CreateProjectDialogFragment.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TimeInterval类代码示例发布时间:2022-05-24
下一篇:
C# TimeCode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap