本文整理汇总了C#中Status.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Status.ToString方法的具体用法?C# Status.ToString怎么用?C# Status.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHitStr
public static string GetHitStr(string statusStr,Status status){
StringBuilder str = new StringBuilder();
str.Append("<span");
str.Append(" class=\""+status.ToString()+"-status\" ");
str.Append(">" + statusStr + "</span>");
return str.ToString();
}
示例2: SetAnimationStatus
public void SetAnimationStatus(Status status)
{
if (status != Status.Idle && status != Status.Run)
IsPlaying = true;
else
IsPlaying = false;
animation.CrossFade(status.ToString());
}
示例3: GetGssApiDisplayStatus
private static string GetGssApiDisplayStatus(Status majorStatus, Status minorStatus)
{
string majorError = GetGssApiDisplayStatus(majorStatus, isMinor: false);
string minorError = GetGssApiDisplayStatus(minorStatus, isMinor: true);
return (majorError != null && minorError != null) ?
SR.Format(SR.net_gssapi_operation_failed_detailed, majorError, minorError) :
SR.Format(SR.net_gssapi_operation_failed, majorStatus.ToString("x"), minorStatus.ToString("x"));
}
示例4: TestConstructor
public void TestConstructor()
{
Status status = new Status(0);
Assert.AreEqual(0, status.Value, "Status value is incorrect.");
Assert.AreEqual(false, status.IsBottomTrack3BeamSolution(), "BT 3 Beam Solution is incorrect.");
Assert.AreEqual(false, status.IsBottomTrackHold(), "BT Hold is incorrect.");
Assert.AreEqual(false, status.IsBottomTrackSearching(), "BT Searching is incorrect.");
Assert.AreEqual(false, status.IsHeadingSensorError(), "Heading Sensor is incorrect.");
Assert.AreEqual(false, status.IsNonVolatileDataError(), "NonVolatile Data Error is incorrect.");
Assert.AreEqual(false, status.IsPowerDownFailure(), "Power Down Failure is incorrect.");
Assert.AreEqual(false, status.IsPressureSensorError(), "Pressure Sensor is incorrect.");
Assert.AreEqual(false, status.IsRealTimeClockError(), "Real time clock is incorrect.");
Assert.AreEqual(false, status.IsReceiverDataError(), "Receiver Data Error is incorrect.");
Assert.AreEqual(false, status.IsReceiverTimeout(), "Receiver Timeout is incorrect.");
Assert.AreEqual(false, status.IsTemperatureError(), "Temperature is incorrect.");
Assert.AreEqual(false, status.IsWaterTrack3BeamSolution(), "WT 3 Beam Solution is incorrect.");
Assert.AreEqual("Good", status.ToString(), "ToString is incorrect.");
Assert.AreEqual(true, status == new Status(0), "== is incorrect.");
Assert.AreEqual(true, status != new Status(1), "!= is incorrect.");
Assert.AreEqual(true, new Status(0).Equals(status), "Equal is incorrect.");
}
示例5: GetProjectsWithSpesificGrid
private Project GetProjectsWithSpesificGrid(int archivedGridProjectId, int gridId, Status status)
{
string currentStatus = status.ToString();
using (var model = new fundgridEntities())
{
var selectedProject = (from p in model.projects
where p.id == archivedGridProjectId
select new Project
{
Id = p.id,
Name = p.name,
Description = p.description
}).FirstOrDefault();
selectedProject.Grid = (from g in model.grids
where g.project_id == archivedGridProjectId
&& g.id == gridId
&& g.status == currentStatus
select new Grid
{
Name = g.name,
Description = g.description,
Id = g.id,
DimensionColumns = g.dimension_column,
DimensionRows = g.dimension_rows,
InitialValue = g.item_value,
GridStatus = status,
IncrementValue = g.increment_value,
}).FirstOrDefault();
if (selectedProject.Grid == null) return selectedProject;
selectedProject.Grid.ExistingGridItems = (from gi in model.grid_item
where gi.grid_id == selectedProject.Grid.Id
select new GridItem
{
Id = gi.id,
Owner = gi.owner,
Amount = gi.amount,
Number = gi.number,
}).ToList();
return selectedProject;
}
}
示例6: GetProjectByGridId
public Project GetProjectByGridId(int gridId, Status status)
{
Project selectedProject;
string currentStatus = status.ToString();
using (var model = new fundgridEntities())
{
var archivedGridProjectId = (from g in model.grids
where g.id == gridId
&& g.status == currentStatus
select g.project_id).SingleOrDefault();
selectedProject = GetProjectsWithSpesificGrid((int)archivedGridProjectId, gridId, status);
}
return selectedProject;
}
示例7: updateStatus
/// <summary>
/// Apply any change in status as a status message and
/// update to the internal status header
/// </summary>
/// <param name="myStatus"></param>
private void updateStatus(Status myStatus)
{
try
{
// if the status has changes then do an
// status update
if (m_PubStatus != myStatus)
{
m_PubStatus = myStatus;
m_Status = new K2RHField("STATUS", myStatus.ToString());
m_StatusInfo = new System.Collections.Generic.List<Field>();
m_StatusInfo.Add(m_Status);
applyStatus(m_StatusInfo);
}
// then update the synthetic status field
doUpdate();
}
catch (Exception myE)
{
m_Log.Error("updateStatus", myE);
}
}
示例8: Insert
//voegt een nieuwe tram toe
public static void Insert(string type, int nummer, Status status, string rfid)
{
Database db = new Database();
try
{
//kijkt eerst of de tram niet al bestaat aan de hand van het tramnummer
if (Tram.GetByNummer(nummer) != null)
{
throw new Exception("Tram met dit nummer bestaat al.");
}
db.CreateCommand("INSERT INTO tram(type, nummer, status, rfidcode) VALUES (:type, :nummer, :status, :rfid)");
db.AddParameter("type", type);
db.AddParameter("nummer", nummer);
db.AddParameter("status", status.ToString());
db.AddParameter("rfid", rfid);
db.Execute();
}
catch (Exception ex)
{
throw ex;
}
finally
{
db.Close();
}
}
示例9: Log
private async Task Log(string text, Status status, Guid? correlationId = null)
{
MessageStatus messageStatus;
if (!Enum.TryParse<MessageStatus>(status.ToString(), out messageStatus))
{
messageStatus = MessageStatus.Information;
}
await Log(text, messageStatus, correlationId);
}
示例10: GetDocuments
public static List<Data.Model.Document> GetDocuments(Guid idTransaction, Status status)
{
var strStatus = status.ToString();
using (UpsilabEntities context = new UpsilabEntities())
{
return context.Document.Where(doc => doc.idSignatureTransaction == idTransaction && doc.Status == strStatus)
.ToList();
}
}
示例11: sendPresence
public void sendPresence(Status status, String statusMessage) {
switch(status) {
case Status.unavailable :
sendPresence(null, "unavailable", null, statusMessage, null);
break;
case Status.chat:
case Status.away:
case Status.xa:
case Status.dnd:
sendPresence(null, "available", status.ToString(), statusMessage, null);
break;
}
}
示例12: SetStatus
private void SetStatus(Status status, Status statusBeforeError = Status.Running)
{
if (_status == Status.Error && status != Status.ErrorOk) return;
if (status == Status.ErrorOk) status = statusBeforeError;
var showOutput = _status != status;
_status = status;
switch (status)
{
case Status.Starting:
_running = true;
lblStatus.BackColor = Color.FromArgb(64, 64, 64);
lblStatus.ForeColor = Color.White;
lblStatus.Text = "Starting";
btnRun.Text = "Stop";
if(showOutput) WriteOutput("Iniciando");
break;
case Status.Running:
_running = true;
lblStatus.BackColor = Color.Lime;
lblStatus.ForeColor = Color.White;
lblStatus.Text = "Running";
btnRun.Text = "Stop";
if (showOutput) WriteOutput("Executando");
break;
case Status.Stopped:
_running = false;
lblStatus.BackColor = Color.FromArgb(64, 64, 64);
lblStatus.ForeColor = Color.White;
lblStatus.Text = "Stopped";
btnRun.Text = "Run";
if (showOutput) WriteOutput("Parado");
break;
case Status.Error:
SetStatus(Status.Stopped);
lblStatus.BackColor = Color.Red;
lblStatus.ForeColor = Color.White;
lblStatus.Text = "Error";
btnRun.Text = "Run";
if (showOutput) WriteOutput("Erro");
break;
default:
break;
}
if (showOutput) TaskGenerator("SetGlobal TaskStatus " + _status.ToString());
}
示例13: setStatus
protected void setStatus(Status value)
{
_status = value;
log.info("Status set to " + _status.ToString());
switch (_status)
{
case Status.Idle:
displayStatus = "Idle";
part.stackIcon.SetIconColor(XKCDColors.White);
animDeployed = false;
Events["arm"].active = true;
Events["disarm"].active = false;
Actions["armAction"].active = true;
Actions["disarmAction"].active = false;
break;
case Status.Armed:
displayStatus = "Armed";
part.stackIcon.SetIconColor(XKCDColors.LightCyan);
animDeployed = true;
Events["arm"].active = false;
Events["disarm"].active = true;
Actions["armAction"].active = false;
Actions["disarmAction"].active = true;
break;
case Status.Firing:
displayStatus = "Firing!";
part.stackIcon.SetIconColor(XKCDColors.RadioactiveGreen);
animDeployed = true;
Events["arm"].active = false;
Events["disarm"].active = false;
Actions["armAction"].active = false;
Actions["disarmAction"].active = false;
break;
case Status.Empty:
displayStatus = "Empty";
part.stackIcon.SetIconColor(XKCDColors.DarkGrey);
animDeployed = true;
Events["arm"].active = false;
Events["disarm"].active = false;
Actions["armAction"].active = false;
Actions["disarmAction"].active = false;
break;
}
}
示例14: SetStatus
public void SetStatus(Status _status)
{
if (base.InvokeRequired)
{
base.Invoke(new SetStatusDelegate(this.SetStatus), new object[] {_status});
}
this.txtStatus.Text = _status.ToString();
}
示例15: ContainerStatus
private Boolean ContainerStatus(Status status, int containerId)
{
var request = new RestRequest("containers/{containerid}/" + status.ToString().ToLower(), Method.PUT)
{
RootElement = "Success"
};
request.AddUrlSegment("containerid", containerId.ToString(CultureInfo.InvariantCulture));
PrepareCall(request);
var result = false;
_client.PutAsync<Boolean>(request,
(response, restRequestAsyncHandle) =>
{
if (response.StatusCode == HttpStatusCode.OK)
result = response.Data;
else
if (response.ErrorException != null)
throw response.ErrorException;
}
);
return result;
}