• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Utils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Utils的典型用法代码示例。如果您正苦于以下问题:C# Utils类的具体用法?C# Utils怎么用?C# Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Utils类属于命名空间,在下文中一共展示了Utils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
     }
 }
开发者ID:4nub1s,项目名称:infoGym,代码行数:29,代码来源:frmTermoNovo.cs


示例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();
        }
开发者ID:andersruberg,项目名称:RehabLight,代码行数:28,代码来源:PrintPrimula.cs


示例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
开发者ID:adinauer,项目名称:fh_hagenberg,代码行数:31,代码来源:BinaryTreeLex.cs


示例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);
 }
开发者ID:4nub1s,项目名称:infoGym,代码行数:30,代码来源:frmDespesaNova.cs


示例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;
 }
开发者ID:hsiun,项目名称:yoyo,代码行数:27,代码来源:Digest.cs


示例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();
     }
 }
开发者ID:ricain59,项目名称:fortaff,代码行数:32,代码来源:FormSet.cs


示例7: frmErga_Single

 public frmErga_Single(long fldProjectID, long fldParentProjectID, Utils.enums.formState inState)
 {
     InitializeComponent();
     _fldProjectID = fldProjectID;
     _fldParentProjectID = fldParentProjectID;
     fState = inState;
 }
开发者ID:htsavdaris,项目名称:eProtocol,代码行数:7,代码来源:frmErga_Single.cs


示例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 });
        }
开发者ID:danthomas,项目名称:Parsing,代码行数:28,代码来源:BuilderTests.cs


示例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>");
        }
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:29,代码来源:Program.cs


示例10:

 void IPersistNode.SetState(object state, Utils.Logger logger)
 {
     if (state is DynamicConfigObject)
     {
         _config = (DynamicConfigObject)state;
     }
 }
开发者ID:michyer,项目名称:canape,代码行数:7,代码来源:BaseDynamicPipelineNode.cs


示例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;
        }
开发者ID:mrno,项目名称:AHP,代码行数:25,代码来源:AgregacionPonderada.cs


示例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"]);
 }
开发者ID:ruanzx,项目名称:mausch,代码行数:7,代码来源:UtilsTests.cs


示例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
开发者ID:adinauer,项目名称:fh_hagenberg,代码行数:29,代码来源:Errors.cs


示例14: MakeXMLSAT

 public MakeXMLSAT(DadosSAT _dtSAT, Utils.ConfigureXml _config)
 {
     config = _config;
     dtSAT = _dtSAT;
     
     processXml();
 }
开发者ID:rnmoge,项目名称:nfce-Sat,代码行数:7,代码来源:MakeXMLSAT.cs


示例15: Run

 public override void Run(DataAdapters.IDataAdapter adapter, Utils.Logger logger)
 {
     while (adapter.Read() != null)
     {
         // Do not alot
     }
 }
开发者ID:michyer,项目名称:canape,代码行数:7,代码来源:NullDataEndpoint.cs


示例16: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Utils utils = new Utils();
            InsecureCookieProtocol insecure = new InsecureCookieProtocol();
            FuCookieProtocol fu = new FuCookieProtocol();
            OtherCookieProtocol other = new OtherCookieProtocol();
            OurCookieProtocol our = new OurCookieProtocol();

            Label1.Text = "Fu's cookie creation time = " + utils.calculateAverage("fu_cookie_creation_times").ToString() + "<br/>"
                + "Fu's cookie verification time = " + utils.calculateAverage("fu_cookie_verification_times").ToString() + "<br/>"
                + "Other cookie creation time = " + utils.calculateAverage("other_cookie_creation_times").ToString() + "<br/>"
                + "Other cookie verification time = " + utils.calculateAverage("other_cookie_verification_times").ToString() + "<br/>"
                + "Our cookie creation time = " + utils.calculateAverage("our_cookie_creation_times").ToString() + "<br/>"
                + "Our cookie verification time = " + utils.calculateAverage("our_cookie_verification_times").ToString() + "<br/>"
                + "Insecure cookie creation time = " + utils.calculateAverage("Insecure_cookie_creation_times").ToString() + "<br/>"
                + "Insecure cookie verification time = " + utils.calculateAverage("Insecure_cookie_verification_times").ToString() + "<br/>"
                ;

            /*

            HttpCookie cc = insecure.create();
            HttpCookie fucookie = fu.create();
            HttpCookie othercookie = other.create();
            HttpCookie ourcookie = our.create();

            insecure.verification(Request.Cookies["InsecureCookieProtocol"]);
            fu.verification(Request.Cookies["FuCookieProtocol"]);
            other.verification(Request.Cookies["OtherCookieProtocol"]);
            our.verification(Request.Cookies["OurCookieProtocol"]);
            */
        }
开发者ID:amin-rahimi,项目名称:SecureCookie,代码行数:31,代码来源:index.aspx.cs


示例17: ActionParameters_constants

 public void ActionParameters_constants()
 {
     Expression<Action<string>> a = s => s.Replace("a", "b");
     IDictionary d = new Utils().GetActionParameters(a);
     Assert.AreEqual("a", d["oldValue"]);
     Assert.AreEqual("b", d["newValue"]);
 }
开发者ID:ruanzx,项目名称:mausch,代码行数:7,代码来源:UtilsTests.cs


示例18: GetTVSeriesName

 internal static Hashtable GetTVSeriesName(Utils.Category category)
 {
     var hashtable = new Hashtable();
       try
       {
     var allSeries = DBOnlineSeries.getAllSeries();
     if (allSeries != null)
     {
       foreach (var series in allSeries)
       {
     DBSeries mytv = Helper.getCorrespondingSeries(series[DBOnlineSeries.cID]);
     if (mytv != null)
     {
       var SeriesName = Utils.GetArtist(mytv[DBSeries.cParsedName], category);
       string seriesId = mytv[DBSeries.cID];
       // logger.Debug("*** "+seriesId + " - " + SeriesName + " - " + mytv[DBSeries.cParsedName] + " - " + mytv);
       if (!hashtable.Contains(seriesId))
       {
         // hashtable.Add(seriesId, SeriesName);
         hashtable.Add(seriesId, mytv.ToString());
       }
     }
       }
     }
     if (allSeries != null)
       allSeries.Clear();
       }
       catch (Exception ex)
       {
     logger.Error("GetTVSeriesName: " + ex);
       }
       return hashtable;
 }
开发者ID:BobSilent,项目名称:mediaportal-fanart-handler,代码行数:33,代码来源:UtilsTVSeries.cs


示例19: GetHit

	private IEnumerator GetHit(float amount, GameObject attacker) {
		if (attacker != null) {
			RaycastHit hit;
	
			if (playerScript.isBlocking) {	


					Utils utils = new Utils ();
					Utils.DIRECTION dir = utils.getDirection (transform.position, attacker.transform.position, transform.forward, transform.right);
					if (dir == Utils.DIRECTION.FRONT) {
							playerScript.model.GetComponent<Animation>().wrapMode = WrapMode.Once;
							yield return StartCoroutine (Utils.WaitForAnimation 
	                             (playerScript.shieldBlookAnimation, .2f, true, playerScript.model)
							);
							Soldier soldierScript = attacker.GetComponent<Soldier> ();
							soldierScript.state = Soldier.STATES.GotBlocked;
					} else {
							if (attacker != null)
									GotHitAnimation (attacker.transform.position);
					}
			} else {
					//health -= amount;
					if (attacker != null)
							GotHitAnimation (attacker.transform.position);
			}
		}
	}
开发者ID:tchrisbaker,项目名称:Unity3DRPG,代码行数:27,代码来源:PlayerHealth.cs


示例20: ActionParameters_DataBind_Nested

 public void ActionParameters_DataBind_Nested()
 {
     Expression<Action<SmartTest2Controller>> a =
         c => c.DataBindingNested(new PropertiesNested {Prop = new Properties {SomeValue = 25}});
     IDictionary d = new Utils().GetActionParameters(a);
     Assert.AreEqual(25, d["pre.Prop.SomeValue"]);
 }
开发者ID:ruanzx,项目名称:mausch,代码行数:7,代码来源:UtilsTests.cs



注:本文中的Utils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Utils.ProgressBlock类代码示例发布时间:2022-05-24
下一篇:
C# Utility.VerificationUtility类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap