本文整理汇总了C#中ServerState.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ServerState.ToString方法的具体用法?C# ServerState.ToString怎么用?C# ServerState.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServerState
的用法示例。
在下文中一共展示了ServerState.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindSiteState
private void BindSiteState(ServerState state)
{
if (state == ServerState.Continuing)
state = ServerState.Started;
litStatus.Text = GetLocalizedString("SiteState." + state.ToString());
cmdStart.Visible = (state == ServerState.Stopped);
cmdContinue.Visible = (state == ServerState.Paused);
cmdPause.Visible = (state == ServerState.Started);
cmdStop.Visible = (state == ServerState.Started || state == ServerState.Paused);
}
示例2: SetState
/// <summary>
/// Public method for updating the Wlb Server state. If the state is ConnectionFailure and
/// a Failure is supplied, it's message is stored in the OtherConfig
/// </summary>
/// <param name="session">The User session use to do this operation</param>
/// <param name="pool">The pool who's Wlb connection state we are updating</param>
/// <param name="state">The current state of the pool's Wlb Server State</param>
/// <param name="failure">The Failure (if any) describing the Connection Error</param>
public static void SetState(Session session, Pool pool, ServerState state, Failure failure)
{
//only update the state if new value if different than current value
// this is to cut down on unneeded Pool_PropertiesChanged events
if (GetState(pool) != state)
{
// set a lock so we are setting state one at a time
lock (_lockObject)
{
Helpers.SetOtherConfig(session, pool, WLB_CONNECTION_STATUS, state.ToString());
if (null != failure && state == ServerState.ConnectionError)
{
string error = String.Empty;
if (failure.Message == FriendlyErrorNames.WLB_INTERNAL_ERROR)
{
error = Messages.ResourceManager.GetString("WLB_ERROR_" + failure.ErrorDescription[1]);
}
else
{
error = failure.Message;
}
Helpers.SetOtherConfig(session, pool, WLB_CONNECTION_ERROR, error);
}
else
{
Helpers.SetOtherConfig(session, pool, WLB_CONNECTION_ERROR, String.Empty);
}
}
}
}
示例3: ServerStateChanged
public static void ServerStateChanged(int clientSubscription, ServerState _state)
{
try
{
if (_state.ToString() != "CONNECTED")
{
logger.Error("KepServer no longer connected: ServerStateChanged error: {0}", _state.ToString());
}
else
{
logger.Info("KepServer re-connected.");
}
}
catch (Exception e)
{
throw e;
}
}
示例4: ShowStatusTray
private void ShowStatusTray(ServerState state)
{
if (!_alwaysShowBalloons && MainForm.Reference.Visible)
return; // if visible and balloons shouldn't be shown always, don't show.
_icon.ShowBalloonTip(BalloonDuration, Locale.Tr("Server") + " " + state,
Locale.Tr("The server is") + " " + state.ToString().ToLower(),
ToolTipIcon.Info);
}