本文整理汇总了C#中Utils类的典型用法代码示例。如果您正苦于以下问题:C# Utils类的具体用法?C# Utils怎么用?C# Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Utils类属于命名空间,在下文中一共展示了Utils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: frmTermoNovo
public frmTermoNovo(Usuario user, String terId)
{
InitializeComponent();
ter = new Termo();
util = new Utils();
this.user = user;
lblUserOn.Text = user.Login;
alu = new Aluno();
if (terId != "") //atualizar
{
lblUltimaAlter.Visible = true;
lblUltimaAlter1.Visible = true;
ter.TerId = terId;
ter = ter.getTermoById();
userTermo = new Usuario();
userTermo.Id = Convert.ToInt32(ter.TerQuemCadastrou);
userTermo = userTermo.getUserById();
lblUltimaAlter.Text = userTermo.Login;
btnSelecionar.Visible = false;
alu.TerId = terId;
ttbAluno.Text = alu.getAlunoByTermo();
pictureBox1.ImageLocation = fotoPath + "" + ter.TerId + ".jpg";
}
else
{
lblUltimaAlter.Visible = false;
lblUltimaAlter1.Visible = false;
}
}
示例2: SetContent
public void SetContent(Utils.PatientNote[] patientNotesArray, int aTotalNrofVisits, int aNrofFreecards, int aNrofPatientPays, int aNrofYouths)
{
StringBuilder s = new StringBuilder();
StringBuilder footer = new StringBuilder();
footer.Append("\n\nTotalt antal besök: " + aTotalNrofVisits);
footer.Append("\nAntal frikkortsbesök: " + aNrofFreecards);
footer.Append("\nAntal besök där patienten betlat själv: " + aNrofPatientPays);
footer.Append("\nAntal besök barn och ungdom: " + aNrofYouths);
foreach(Utils.PatientNote patientNote in patientNotesArray)
{
Charge tmpCharge = patientNote.charge;
Note tmpNote = patientNote.note;
Patient tmpPatient = patientNote.patient;
s.Append("\n" + tmpNote.VisitDateTime.ToShortDateString());
s.Append("\t" + tmpPatient.Surname + " " + tmpPatient.Firstname);
s.Append("\t" + tmpPatient.Personnumber);
s.Append("\t" + tmpNote.PatientFee + " kr");
s.Append("\t" + tmpCharge.PrimulaCharachter);
//TODO: Make sure that if one row is longer than the width of the page, cut some chars from the name
}
contentString = s.ToString();
contentFooter = footer.ToString();
}
示例3: BinaryTreeLexMethod
public static int curLine, curCol; // position of curCh
public static void BinaryTreeLexMethod(Utils.ModuleAction action, out String moduleName) {
//-----------------------------------|----------------------------------------
moduleName = MODULENAME;
switch (action) {
case Utils.ModuleAction.getModuleName:
return;
case Utils.ModuleAction.initModule:
caseSensitive = true;
lt = new LexicalTable();
tokenStrArr = new char[256];
kwHt = CreateHashtable();
nHt = CreateHashtable();
nl = new ArrayList();
break;
case Utils.ModuleAction.resetModule:
kwHt.Clear();
nHt.Clear();
nl.Clear();
break;
case Utils.ModuleAction.cleanupModule:
lt = null;
tokenStrArr = null;
kwHt = null;
nHt = null;
nl = null;
break;
} // switch
} // BinaryTreeLexMethod
示例4: frmDespesaNova
public frmDespesaNova(Usuario user, String despId)
{
InitializeComponent();
this.user = user;
desp = new Despesa();
util = new Utils();
util.moneyMaskFormata(ttbValorPgmto);
util.moneyMaskFormata(ttbValor);
if (despId != "")
{
this.Text = "Alterar Despesa";
desp.Id = despId;
desp = desp.getById();
ttbDesc.Text = desp.Desc;
ttbValor.Text = desp.Valor;
if (desp.DtPgmto != "")
{
rbPaga.Checked = true;
gpbPagamento.Enabled = true;
ttbValorPgmto.Text = desp.ValorPg;
dtpPagamento.Value = DateTime.Parse(desp.DtPgmto);
}
else
rbApagar.Checked = true;
dtpVcmto.Value = DateTime.Parse(desp.DtVcmto);
}
else
rbApagar.Checked = true;
util.setCamposObrigatorios(Controls);
}
示例5: SignRequst
public static string SignRequst(HttpWebRequest request, Utils.RequestHeadType type, string bucket, string key)
{
string Authorization = string.Empty;
string StringToSign = string.Empty;
switch (type) {
case Utils.RequestHeadType.HEAD_FIELD_CHECK:
Authorization += "UCloud ";
Authorization += Config.UCLOUD_PUBLIC_KEY;
Authorization += ":";
StringToSign = request.Method + "\n" + request.Headers.Get ("Content-MD5") + "\n";
StringToSign += request.ContentType;
StringToSign += "\n";
/*
StringToSign += DateTime.Now.ToString ();
*/
StringToSign += "\n";
StringToSign += CanonicalizedUCloudHeaders (request.Headers);
StringToSign += CanonicalizedResource (bucket, key);
break;
default:
break;
}
HMACSHA1 hmac = new HMACSHA1 (Encoding.ASCII.GetBytes (Config.UCLOUD_PRIVATE_KEY));
Byte[] hashValue = hmac.ComputeHash(Encoding.UTF8.GetBytes(StringToSign));
string Signature = Convert.ToBase64String (hashValue);
return Authorization + Signature;
}
示例6: buttonOk_Click
/// <summary>
/// Ao clicar no botão ok mando a informação para o form stoploss
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonOk_Click(object sender, EventArgs e)
{
Int64 hand = new Utils().stringtoInt64(textBoxStopHand.Text);
Double loss = new Utils().stringtoDouble(textBoxStopLoss.Text);
Int32 time = new Utils().stringtoInt32(textBoxStopTime.Text);
Double win = new Utils().stringtoDouble(textBoxStopWin.Text);
Double losspeak = new Utils().stringtoDouble(textBoxStopLossPeak.Text);
Double peakover = new Utils().stringtoDouble(textBoxPeakOver.Text);
Double wininter = new Utils().stringtoDouble(textBoxStopWinIntermediate.Text);
Double lossinter = new Utils().stringtoDouble(textBoxStopLossIntermediate.Text);
Boolean continu = true;
if (wininter >= win && wininter != 0)
{
labelAlertIntermediate.Text = "Stopwin intermediate don't superior at stopwin final";
continu = false;
}
if (lossinter >= loss && lossinter != 0 && continu)
{
labelAlertIntermediate.Text = "StopLoss intermediate don't superior at stopLoss final";
continu = false;
}
if(continu)
{
sl.setNewValue(hand, loss, time, win, losspeak, peakover, checkBoxHideBbbs.Checked, wininter, lossinter);
this.Close();
}
}
示例7: frmErga_Single
public frmErga_Single(long fldProjectID, long fldParentProjectID, Utils.enums.formState inState)
{
InitializeComponent();
_fldProjectID = fldProjectID;
_fldParentProjectID = fldParentProjectID;
fState = inState;
}
示例8: BuildGrammar
public void BuildGrammar()
{
var utils = new Utils();
var builder = new Builder();
var text = GetDef<Core.GrammarDef.Parser>();
Core.GrammarDef.Parser parser = new Core.GrammarDef.Parser();
Node<Core.GrammarDef.NodeType> root = parser.Parse(text);
builder.PreProcess(root);
File.WriteAllText(@"C:\temp\node.txt", utils.NodeToString(root));
Grammar grammar = builder.BuildGrammar(root);
var actual = utils.GrammarToDefString(grammar);
Assert.That(actual, Is.EqualTo(text));
File.WriteAllText(@"C:\temp\parser.cs", builder.BuildParser2(grammar));
//var parser2 = builder.CreateParser(grammar);
//
//var root2 = parser2.GetType().GetMethod("Parse").Invoke(parser2, new object[] { text });
}
示例9: Game_OnGameLoad
public static void Game_OnGameLoad()
{
if (Player.ChampionName != ChampionName)
return;
Spells.Initiate();
Config = MainMenu.AddMenu(string.Format("xQx | {0}", ChampionName), ChampionName);
PlayerSpells.Initialize();
DamageCalc = new DamageCalc();
Utils = new Utils();
Menu = new Menu();
Items = new Items();
Draws = new Draws();
Combo = new Combo();
Harass = new Harass();
LaneClear = new LaneClear();
JungleClear = new JungleClear();
OnUpdate = new OnUpdate();
LogicW.Initiate();
Config.Add("GameMode", new ComboBox("Game Mode:", 0, "AP", "AD", "Hybrid", "Tanky"));
Chat.Print(
"Mordekasier</font> <font color='#ff3232'> How to Train Your Dragon </font> <font color='#FFFFFF'>Loaded!</font>");
}
示例10:
void IPersistNode.SetState(object state, Utils.Logger logger)
{
if (state is DynamicConfigObject)
{
_config = (DynamicConfigObject)state;
}
}
示例11: agregar
public double[,] agregar(List<KRankPonderado> listaKRanking)
{
Utils utils= new Utils();
normalizarPesos(listaKRanking);
int dimension = listaKRanking[1].KRanking.GetLength(0);
double[,] rankAgregado = new double[dimension, 1];
// utils.Cerar(rankAgregado, dimension);
foreach (var kRankPonderado in listaKRanking)
{
for (int i = 0; i < dimension; i++)
{
rankAgregado[i, 0] += kRankPonderado.KRanking[i, 0]*kRankPonderado.PesoPonderado;
}
}
return rankAgregado;
}
示例12: ActionParameters_MethodCall
public void ActionParameters_MethodCall()
{
Expression<Action<string>> a = s => s.Replace("a", GetString());
IDictionary d = new Utils().GetActionParameters(a);
Assert.AreEqual("a", d["oldValue"]);
Assert.AreEqual("something", d["newValue"]);
}
示例13: ErrorsMethod
public static void ErrorsMethod(Utils.ModuleAction action, out String moduleName) {
//-----------------------------------|----------------------------------------
moduleName = MODULENAME;
switch (action) {
case Utils.ModuleAction.getModuleName:
return;
case Utils.ModuleAction.initModule:
aps = new AbortMethod[MAXABORTPROCS];
sp = 0;
PushAbortMethod(DefaultAbort);
stopParsing = null;
eowCnt = new int[4];
curEoW = new ErrorWarn[4];
break;
case Utils.ModuleAction.resetModule:
break;
case Utils.ModuleAction.cleanupModule:
eowl = null;
eowCnt = null;
curEoW = null;
return;
} // switch
// --- for initModule and resetModule ---
eowl = null;
numOfErrs = 0;
numOfWarns = 0;
for (int i = 0; i < 4; i++)
eowCnt[i] = 0;
} // ErrorsMethod
示例14: MakeXMLSAT
public MakeXMLSAT(DadosSAT _dtSAT, Utils.ConfigureXml _config)
{
config = _config;
dtSAT = _dtSAT;
processXml();
}
示例15: Run
public override void Run(DataAdapters.IDataAdapter adapter, Utils.Logger logger)
{
while (adapter.Read() != null)
{
// Do not alot
}
}