Пример #1
0
         /// <summary>
         /// 模板结束
         /// </summary>
         /// <returns></returns>
         private string end()
         {
             codeBuilder.Append(@"
         if (_isOut_) outEnd();
     }
 }", typeDefinition.End);
             return(codeBuilder.ToString());
         }
Пример #2
0
        private string abbr(string word)
        {
            if (word.Length <= 2)
            {
                return(word);
            }
            stringBuilder sb = new stringBuilder();

            sb.Append(word[0]);
            sb.Append(word.Length - 2);
            sb.Append(word[word.Length - 1]);
            return(sb.Tostring());
        }
Пример #3
0
 public Relatorio(string consulta, string arquivo) {            
     ReportStrip = new ViewerToolstrip(ReportViewer);
     ReportStrip.Viewer = ReportViewer;
     query.Append(consulta);
     nomeArquivo = arquivo;
     emitir();
 }
Пример #4
0
        /// <summary>
        /// if开始代码段
        /// </summary>
        /// <param name="memberName">成员名称</param>
        /// <param name="isSkip">是否跳跃层次</param>
        protected void ifStart(string memberName, bool isSkip)
        {
            bool       isDepth;
            memberNode member = getMember(memberName, out isDepth);

            pushMember(member);
            if (isSkip)
            {
                pushMember(member);
            }
            string name = path(0);

            code.Append(@"
                {
                    ", member.Type.FullName, " ", name, " = ", member.Path, ";");
            ifStart(member.Type, name, null);
        }
Пример #5
0
 public Relatorio(DALConexao conexao, string consulta, string arquivo) {            
     dalConexao = conexao;
     //provavelmente dá para colocar na propriedade mas não posso testar
     ReportStrip = new ViewerToolstrip(ReportViewer);
     ReportStrip.Viewer = ReportViewer;
     query.Append(consulta);
     nomeArquivo = arquivo;
     emitir();
 }
Пример #6
0
        protected string CalculateAccessKey(string accountId, string apiKey)
        {
            MD5 md5 = System.Security.Cryptography.MD5.Create();

            byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(accountId + apiKey);
            byte[] hashBytes  = md5.ComputeHash(inputBytes);

            // Convert the byte array to hexadecimal string
            stringBuilder sb = new stringBuilder();

            for (int i = 0; i < hashBytes.Length; i++)
            {
                sb.Append(hashBytes[i].Tostring("X2"));
            }
            return(sb.Tostring());
        }