Samples Reappend
This commit is contained in:
9
Samples/CrossLamp/Models/ErrorViewModel.cs
Normal file
9
Samples/CrossLamp/Models/ErrorViewModel.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace CrossLamp.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
||||
32
Samples/CrossLamp/Models/Lamp.cs
Normal file
32
Samples/CrossLamp/Models/Lamp.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
public enum LightLamp{Red,Yellow,Green}
|
||||
namespace CrossLampControl.WebApi.Models
|
||||
{
|
||||
public class Lamp
|
||||
{
|
||||
public string MainLamp { get; set; }
|
||||
public string SubLamp { get; set; }
|
||||
public string StartPause { get; set; }
|
||||
|
||||
public Lamp()
|
||||
{
|
||||
MainLamp = LightLamp.Red.ToString();
|
||||
SubLamp = LightLamp.Red.ToString();
|
||||
}
|
||||
|
||||
public void SetLamp(LightLamp mLamp, LightLamp sLamp)
|
||||
{
|
||||
MainLamp = mLamp.ToString();
|
||||
SubLamp = sLamp.ToString();
|
||||
}
|
||||
|
||||
public void SetStart(bool isStart)
|
||||
{
|
||||
StartPause = isStart ? "Start" : "Pause";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user