Guest User

Untitled

a guest
Oct 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10. using System.Collections;
  11.  
  12. namespace MetricTool
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void button1_Click(object sender, EventArgs e)
  22.         {
  23.  
  24.         }
  25.  
  26.         public void cWeight()
  27.         {
  28.             var content = File.ReadAllLines(@"C:\Users\Maheshi\Desktop\Tool\" + textBox1.Text + ".txt");    //select the content line by line
  29.  
  30.             foreach (string line in content)        //foreach line
  31.             {
  32.                 char[] separators = { ' ', '\t' };
  33.                 var words = line.Split(separators, StringSplitOptions.RemoveEmptyEntries);   //split into words
  34.  
  35.                 int len = words.Length;
  36.  
  37.                 int j = 0;
  38.                 while (j < len)                     //check each word in the line
  39.                 {
  40.                     string word = words[j];
  41.  
  42.                     if ((word == "public") || (word == "private") || (word == "protected"))
  43.                     {
  44.                         string nxtword = words[j + 1];
  45.                         if (nxtword != "class")
  46.                         {
  47.                             if ((word == "int") || (word == "double") || (word == "byte") || (word == "bool") || (word == "char") || (word == "float") || (word == "long") || (word == "short") || (word == "signed") || (word == "unsigned") || (word == "void"))
  48.                             {
  49.                                 string methodName = words[j + 1];
  50.                                 ArrayList mNames = new ArrayList();
  51.                                 mNames.Add(methodName);
  52.                                 do
  53.                                 {
  54.  
  55.                                 }
  56.                                 while (methodName != methodName);
  57.                             }
  58.                         }
  59.                     }
  60.                 }
  61.             }
  62.         }
  63.     }
  64. }
Add Comment
Please, Sign In to add comment