本文整理汇总了C#中OS类的典型用法代码示例。如果您正苦于以下问题:C# OS类的具体用法?C# OS怎么用?C# OS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OS类属于命名空间,在下文中一共展示了OS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Platform
static Platform()
{
var p = (int) Environment.OSVersion.Platform;
OS = ((p == 4) || (p == 6) || (p == 128)) ? OS.Unix : OS.Windows;
Runtime = (Type.GetType("Mono.Runtime") == null) ? Runtime.Mono : Runtime.DotNet;
}
示例2: Add
/// <summary>
/// 增加一条数据
/// </summary>
public int Add(OS.Model.configs.yl_temp model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into yl_temp(");
strSql.Append("name,title,status)");
strSql.Append(" values (");
strSql.Append("@name,@title,@status)");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@name", SqlDbType.NVarChar,100),
new SqlParameter("@title", SqlDbType.NVarChar,100),
new SqlParameter("@status", SqlDbType.Int,4)};
parameters[0].Value = model.name;
parameters[1].Value = model.title;
parameters[2].Value = model.status;
object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
if (obj == null)
{
return 0;
}
else
{
return Convert.ToInt32(obj);
}
}
示例3: btnSalvar_Click
protected void btnSalvar_Click(object sender, EventArgs e)
{
//validação no servidor
if ( String.IsNullOrEmpty( txtLoja.Text.Trim() ))
{
lblMensagem.Text = "Digite uma loja!";
return;
}
OS os = new OS();
OSBD bd = new OSBD();
os.Loja = txtLoja.Text;
os.Observacao = txtObs.Text;
os.Ativado = true;
if ( bd.Insert(os) )
{
Session["LOJA"] = null;
Session["OBS"] = null;
lblMensagem.Text = "OS Cadastrada com Sucesso!";
txtLoja.Text = "";
txtObs.Text = "";
Session["OS"] = ProximaOs();
txtOs.Text = Convert.ToString(Session["OS"]);
gvAlianca.DataSource = null;
gvAlianca.DataBind();
}
else
{
lblMensagem.Text = "Houve um erro ao cadastrar!";
}
}
示例4: PathItem
public PathItem(OS.OSInformation osInformation, string key, string path)
{
_osName = osInformation.OSName;
_version = osInformation.Version;
_key = key;
_path = path;
}
示例5: NewAzureQuickVMCmdletInfo
public NewAzureQuickVMCmdletInfo(OS os, string name, string serviceName, string imageName, string instanceSize,
string userName, string password, string vNetName, string[] subnetNames, string affinityGroup, string reservedIP)
: this(os, name, serviceName, imageName, userName, password)
{
if (!string.IsNullOrEmpty(affinityGroup))
{
cmdletParams.Add(new CmdletParam("AffinityGroup", affinityGroup));
}
if (!string.IsNullOrEmpty(instanceSize))
{
cmdletParams.Add(new CmdletParam("InstanceSize", instanceSize));
}
if (!string.IsNullOrEmpty(vNetName))
{
cmdletParams.Add(new CmdletParam("VNetName", vNetName));
}
if (subnetNames != null)
{
cmdletParams.Add(new CmdletParam("SubnetNames", subnetNames));
}
if (!string.IsNullOrEmpty(reservedIP))
{
cmdletParams.Add(new CmdletParam("ReservedIPName", reservedIP));
}
}
示例6: Platform
static Platform()
{
int p = (int)Environment.OSVersion.Platform;
_os = ((p == 4) || (p == 128)) ? OS.Linux : OS.Windows;
_runtime = (Type.GetType("System.MonoType", false) != null) ? Runtime.Mono : Runtime.DotNet;
}
示例7: NewAzureQuickVMCmdletInfo
public NewAzureQuickVMCmdletInfo(OS os, string name, string serviceName, string imageName, string userName, string password)
{
cmdletName = Utilities.NewAzureQuickVMCmdletName;
if (os == OS.Windows)
{
cmdletParams.Add(new CmdletParam("Windows", null));
if (!string.IsNullOrWhiteSpace(userName))
{
cmdletParams.Add(new CmdletParam("AdminUsername", userName));
}
}
else
{
cmdletParams.Add(new CmdletParam("Linux", null));
if (!string.IsNullOrWhiteSpace(userName))
{
cmdletParams.Add(new CmdletParam("LinuxUser", userName));
}
}
cmdletParams.Add(new CmdletParam("ImageName", imageName));
cmdletParams.Add(new CmdletParam("Name", name));
cmdletParams.Add(new CmdletParam("ServiceName", serviceName));
if (!string.IsNullOrEmpty(password))
{
cmdletParams.Add(new CmdletParam("Password", password));
}
}
示例8: gvOS_RowCommand
protected void gvOS_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = 0;
switch (e.CommandName)
{
case "fechar":
index = Convert.ToInt32(e.CommandArgument);
OS os = new OS();
OSBD bd = new OSBD();
os = bd.Select(index);
string Data = os.HoraSaida.ToShortDateString();
if (Data == "01/01/0001")
{
Session["OS"] = index;
Response.Redirect("Fechar.aspx");
lblMensagem.Text = "";
}
else
{
lblMensagem.Text = "OS já encerrada!";
}
break;
default:
break;
}
}
示例9: AddAzureVMImageCmdletInfo
public AddAzureVMImageCmdletInfo(
string imageName,
string mediaLocation,
OS os,
string label,
string recommendedSize,
string description,
string eula,
string imageFamily,
Uri privacyUri,
DateTime publishedDate)
: this(imageName, mediaLocation, os, label, recommendedSize)
{
if(!string.IsNullOrEmpty(description))
{
cmdletParams.Add(new CmdletParam("Description", description));
}
if(!string.IsNullOrEmpty(eula))
{
cmdletParams.Add(new CmdletParam("Eula", eula));
}
if(!string.IsNullOrEmpty(imageFamily))
{
cmdletParams.Add(new CmdletParam("ImageFamily", imageFamily));
}
if(privacyUri != null)
{
cmdletParams.Add(new CmdletParam("PrivacyUri", privacyUri.ToString()));
}
if(publishedDate != null)
{
cmdletParams.Add(new CmdletParam("PublishedDate", publishedDate.ToString()));
}
}
示例10: OnViewCreated
public override void OnViewCreated(Views.View p0, OS.Bundle p1)
{
if (DialogAdapter == null) return;
DialogAdapter.List = ListView;
DialogAdapter.RegisterListView();
base.OnViewCreated(p0, p1);
}
示例11: DrawUI
public void DrawUI(Rectangle dest, OS os)
{
var ButtonHeight = (int) (GuiData.ActiveFontConfig.tinyFontCharHeight + 10.0);
if (panel.PanelHeight != ButtonHeight + 4)
panel = new ScrollableSectionedPanel(ButtonHeight + 4, GuiData.spriteBatch.GraphicsDevice);
var items =
BuildDirectoryDrawList(
os.connectedComp == null ? os.thisComputer.files.root : os.connectedComp.files.root, 0, 0, os);
panel.NumberOfPanels = items.Count;
var width = dest.Width - 25;
Action<int, Rectangle, SpriteBatch> DrawSection = (index, bounds, sb) =>
{
var lsItem = items[index];
if (lsItem.IsEmtyDisplay)
{
TextItem.doFontLabel(new Vector2(bounds.X + 5 + lsItem.indent, bounds.Y + 2), "-Empty-",
GuiData.tinyfont, new Color?(), width, ButtonHeight);
}
else
{
if (
!Button.doButton(300000 + index, bounds.X + 5 + lsItem.indent, bounds.Y + 2,
width - lsItem.indent, ButtonHeight, lsItem.DisplayName, new Color?()))
return;
lsItem.Clicked();
}
};
Button.DisableIfAnotherIsActive = true;
panel.Draw(DrawSection, GuiData.spriteBatch, dest);
Button.DisableIfAnotherIsActive = false;
}
示例12: TestSaveLoadOnFile
public static string TestSaveLoadOnFile(ScreenManager screenMan)
{
var text = "__hacknettestaccount";
var pass = "__testingpassword";
SaveFileManager.AddUser(text, pass);
var saveFileNameForUsername = SaveFileManager.GetSaveFileNameForUsername(text);
OS.TestingPassOnly = true;
var text2 = "";
var oS = new OS();
oS.SaveGameUserName = saveFileNameForUsername;
oS.SaveUserAccountName = text;
screenMan.AddScreen(oS, screenMan.controllingPlayer);
oS.threadedSaveExecute();
var nodes = oS.netMap.nodes;
screenMan.RemoveScreen(oS);
OS.WillLoadSave = true;
oS = new OS();
oS.SaveGameUserName = saveFileNameForUsername;
oS.SaveUserAccountName = text;
screenMan.AddScreen(oS, screenMan.controllingPlayer);
var text3 = "Serialization and Integrity Test Report:\r\n";
Console.WriteLine(text3);
text2 += text3;
new List<string>();
new List<string>();
var num = 0;
text2 += getTestingReportForLoadComparison(oS, nodes, num, out num);
text2 = text2 + "\r\n" + TestMissions(oS);
for (var i = 0; i < oS.netMap.nodes.Count; i++)
{
var root = oS.netMap.nodes[i].files.root;
DeleteAllFilesRecursivley(root);
}
oS.SaveGameUserName = saveFileNameForUsername;
oS.SaveUserAccountName = text;
oS.threadedSaveExecute();
nodes = oS.netMap.nodes;
screenMan.RemoveScreen(oS);
OS.WillLoadSave = true;
oS = new OS();
oS.SaveGameUserName = saveFileNameForUsername;
oS.SaveUserAccountName = text;
screenMan.AddScreen(oS, screenMan.controllingPlayer);
var num2 = num;
var testingReportForLoadComparison = getTestingReportForLoadComparison(oS, nodes, num, out num);
if (num2 != num)
{
text2 = text2 + "\r\nAll Files Deleted pass:\r\n" + testingReportForLoadComparison;
}
screenMan.RemoveScreen(oS);
OS.TestingPassOnly = false;
SaveFileManager.DeleteUser(text);
var text4 = string.Concat("\r\nTest complete - ", num, " errors found.\r\nTested ", nodes.Count,
" generated nodes vs ", oS.netMap.nodes.Count, " loaded nodes");
text2 += text4;
Console.WriteLine(text4);
MusicManager.stop();
return text2;
}
示例13: AddAzureVMImageCmdletInfo
public AddAzureVMImageCmdletInfo(string imageName, string mediaLocation, OS os, string label, InstanceSize? recommendedSize)
: this(imageName, mediaLocation, os, label)
{
if (recommendedSize.HasValue)
{
cmdletParams.Add(new CmdletParam("RecommendedVMSize", recommendedSize));
}
}
示例14: OSModel
public OSModel(OS os)
{
this.OSId = os.OSId;
this.Version = os.Version;
this.Desc = os.Desc;
this.ReleaseDate = os.ReleaseDate;
this.ExpirationDate = (os.ExpirationDate.HasValue) ? os.ExpirationDate : null;
}
示例15: NewAzureQuickVMCmdletInfo
public NewAzureQuickVMCmdletInfo(OS os, string name, string serviceName, string imageName, string userName, string password, string locationName, InstanceSize? instanceSize)
: this(os, name, serviceName, imageName, userName, password, locationName)
{
if (instanceSize.HasValue)
{
cmdletParams.Add(new CmdletParam("InstanceSize", instanceSize.ToString()));
}
}