Ejemplo n.º 1
0
 private void InitComplier(string fileName)
 {
     if (!string.IsNullOrEmpty(fileName))
     {
         complier = null;
         if (fileName.EndsWith("cs", StringComparison.CurrentCultureIgnoreCase))
         {
             complier = new NetCodeComplier(NetDialect.CSharp);
         }
         else if (fileName.EndsWith("vb", StringComparison.CurrentCultureIgnoreCase))
         {
             complier = new NetCodeComplier(NetDialect.VB);
         }
         else if (fileName.EndsWith("java", StringComparison.CurrentCultureIgnoreCase))
         {
             complier = new JavaCodeComplier();
         }
         else
         {
             throw new NotSupportedException("不支持该语言");
         }
         if (complier != null)
         {
             complier.MsgReceivedEvent = this.ShowMsg;
         }
     }
 }
Ejemplo n.º 2
0
 private void InitComplier(string fileName)
 {
     if (!string.IsNullOrEmpty(fileName))
     {
         complier = null;
         if (fileName.EndsWith("cs", StringComparison.CurrentCultureIgnoreCase))
         {
             complier = new NetCodeComplier(NetDialect.CSharp);
         }
         else if (fileName.EndsWith("vb", StringComparison.CurrentCultureIgnoreCase))
         {
             complier = new NetCodeComplier(NetDialect.VB);
         }
         else if (fileName.EndsWith("java", StringComparison.CurrentCultureIgnoreCase))
         {
             complier = new JavaCodeComplier();
         }
         else
         {
             throw new NotSupportedException("不支持该语言");
         }
         if (complier != null)
             complier.MsgReceivedEvent = this.ShowMsg;
     }
 }