示例#1
0
        private void Action_CustomizeStartEditPopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            var note = new InfoNote {
                ObjectSpace = new NonPersistentObjectSpace(new TypesInfo())
            };

            e.View = Application.CreateDetailView(note);
            var startTimeUtc = RecordCurrentStartUtc();

            if (startTimeUtc == null)
            {
                note.Text = "Unexpected result";
            }
            else
            {
                var startTime = ((DateTime)startTimeUtc).ToLocalTime();
                note.Text = $"Started at {startTime}";
            }
        }
示例#2
0
        private void Action_CustomizeMinsPopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            var note = new InfoNote {
                ObjectSpace = new NonPersistentObjectSpace(new TypesInfo())
            };

            e.View = Application.CreateDetailView(note);
            var secs = GetSecsDuringLastEdit();

            if (secs == null)
            {
                note.Text = "There is no prior edit";
                return;
            }

            double secsperMin = 60;
            var    mins       = Math.Round((int)secs / secsperMin, 2, MidpointRounding.AwayFromZero);

            note.Text = $" Last edit took {mins} mins";
        }