本文整理汇总了C#中Modes.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Modes.ToString方法的具体用法?C# Modes.ToString怎么用?C# Modes.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modes
的用法示例。
在下文中一共展示了Modes.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsModeEnabled
public static bool IsModeEnabled(Modes mode)
{
var myXmlDocument = new XmlDocument();
myXmlDocument.Load(Configuration.SettingsGeneral.AbsolutePath + "Web.ModeSettings.config");
var root = myXmlDocument.ChildNodes.OfType<XmlNode>().First(p => p.Name.Equals("modesettings"));
if (root != null)
{
foreach (XmlNode node in root.ChildNodes)
{
if (node.Name == mode.ToString())
{
return Boolean.Parse(node.Attributes["value"].Value);
}
}
}
throw new NotImplementedException("this mode is not configured in ~/Web.ModeSettings.config");
}
示例2: ChangeEditMode
private void ChangeEditMode(Modes newMode)
{
if (!CheckSafety())
return;
this.splitContainerGlobDataControls.Panel1.Visible = false;
CurrentType.EndSelectionMode();
if (Modified)
SaveAll();
UpdateComboLists();
SelectionMode = false;
CurrentType.SavedFullListDuringSelection = null;
SetEditMode(newMode);
cbGlobMode.Text = newMode.ToString();
ShowCurrentCount();
ManageSearchWindow();
this.splitContainerGlobDataControls.Panel1.Visible = true;
}
示例3: CreateRequestPacket
/// <summary>
/// Creates the request packet.
/// </summary>
/// <param name="opCode">The op code.</param>
/// <param name="remoteFile">The remote file.</param>
/// <param name="tftpMode">The TFTP mode.</param>
/// <returns>the ack packet</returns>
private byte[] CreateRequestPacket(Opcodes opCode, string remoteFile, Modes tftpMode)
{
// Create new Byte array to hold Initial
// Read Request Packet
int pos = 0;
string modeAscii = tftpMode.ToString().ToLowerInvariant();
byte[] ret = new byte[modeAscii.Length + remoteFile.Length + 4];
// Set first Opcode of packet to indicate
// if this is a read request or write request
ret[pos++] = 0;
ret[pos++] = (byte)opCode;
// Convert Filename to a char array
pos += Encoding.ASCII.GetBytes(remoteFile, 0, remoteFile.Length, ret, pos);
ret[pos++] = 0;
pos += Encoding.ASCII.GetBytes(modeAscii, 0, modeAscii.Length, ret, pos);
ret[pos] = 0;
return ret;
}