void TimerUpdate() { tim.Stop(); TimeCapsule.FormatHMS(lBegin, tBegin); TimeCapsule.FormatHMS(lEnd, tEnd); UpdateText(); }
public void Part_PresentOnDraft_HaveInfo() { var pastTime = new TimeCapsule(DateTime.Now.AddSeconds(-10)); var page = CreateOneItem <Items.NormalPage>(0, "page", null); persister.Save(page); var part = CreateOneItem <Items.NormalItem>(0, "part", page); part.ZoneName = "TheZone"; persister.Save(part); pastTime.Dispose(); var version = page.Clone(true); version.State = ContentState.Draft; version.VersionOf = page; version.VersionIndex++; var draft = repository.Save(version); var info = drafts.GetDraftInfo(part); info.ItemID.ShouldBe(part.ID); info.VersionIndex.ShouldBe(version.Children[0].VersionIndex); }
public void Part_PresentOnDraft_IsConsideredToHaveADraft() { var pastTime = new TimeCapsule(DateTime.Now.AddSeconds(-10)); var page = CreateOneItem <Items.NormalPage>(0, "page", null); persister.Save(page); var part = CreateOneItem <Items.NormalItem>(0, "part", page); part.ZoneName = "TheZone"; persister.Save(part); pastTime.Dispose(); var version = page.Clone(true); version.State = ContentState.Draft; version.VersionOf = page; version.VersionIndex++; var draft = repository.Save(version); drafts.HasDraft(part).ShouldBe(true); }
public static void Collect_Prefix(TimeCapsule __instance) { var resourceTracker = __instance.gameObject.GetComponent <ResourceTracker>(); if (resourceTracker != null) { resourceTracker.Unregister(); } }
public static void Start_Postfix(TimeCapsule __instance) { var resourceTracker = __instance.gameObject.EnsureComponent <ResourceTracker>(); resourceTracker.prefabIdentifier = __instance.GetComponent <PrefabIdentifier>(); resourceTracker.techType = TechType.TimeCapsule; resourceTracker.overrideTechType = TechType.TimeCapsule; resourceTracker.rb = __instance.gameObject.GetComponent <Rigidbody>(); resourceTracker.pickupable = __instance.gameObject.GetComponent <Pickupable>(); }
static public void FormatHMS(Label linput, TextBox tinput) { TimeCapsule time = new TimeCapsule(); time.HmsfString = tinput.Text; linput.Text = time.TotalSecondsString; linput.ForeColor = !time.HasValue ? System.Drawing.Color.Red : Label.DefaultForeColor; tinput.Text = time.HmsString; time = null; }
public async Task <IActionResult> Update(TimeCapsule tm) { if (!ModelState.IsValid) { return(View("Edit")); } db.TimeCapsule.Update(tm); db.SaveChanges(); List <TimeCapsule> tmCapsule = await db.TimeCapsule.ToListAsync(); return(View("Index", tmCapsule)); }
public async Task <IActionResult> Add(TimeCapsule tc) { if (!ModelState.IsValid) { return(View("Create")); } db.TimeCapsule.Add(tc); db.SaveChanges(); List <TimeCapsule> timecapsules = await db.TimeCapsule.ToListAsync(); return(View("Index", timecapsules)); }
public IActionResult Edit(int id) { TimeCapsule tc = db.TimeCapsule.Where(u => u.id == id).FirstOrDefault(); return(View("Edit", tc)); }