How to hide generated javascript file in visual studio code

In this post I am going to show you a cool trick in visual studio code. Let's suppose you are writing typescript code in visual studio code and you want to hide generated javascript code.

Create .vscode folder in your folder and then create settings.json file and paste following code

{ "files.exclude": { "node_modules":true, "**/.git": true, "**/.DS_Store": true, "**/*.js.map": true, "**/*.js": {"when": "$(basename).ts"}     } }

CSV Parser

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections;
using System.Reflection;

namespace CSVProvider
{
    class Program
    {
        static void Main(string[] args)
        {
            CSVProvider csv = new CSVProvider(@"C:\Student.txt");
            foreach (var item in csv.OfType())
            {
                Console.WriteLine(item.ToString());
            }
            Console.ReadLine();
        }
    }

    public class Student
    {
        public int ID { get; set; }
        public string FullName { get; set; }
        public int Age { get; set; }
        public override string ToString()
        {
            return string.Format(@"ID={0}  FullNam={1} Age={2}", ID, FullName, Age);
        }

    }
    public class CSVProvider : IDisposable, IEnumerable, IEnumerator
    {
        private string fileName = default(string);
        FileStream fsObject = null;
        StreamReader readerObject = null;
        private string currentLine = default(string);
        public CSVProvider(string fileName)
        {
            this.fileName = fileName;
            fsObject = new FileStream(fileName, FileMode.Open, FileAccess.Read);
            readerObject = new StreamReader(fsObject);
            //To skip header line
            readerObject.ReadLine();
        }

        public void Dispose()
        {
            if (readerObject != null)
                readerObject.Close();
            if (fsObject != null)
                fsObject.Close();
        }

        public IEnumerator GetEnumerator()
        {
            return this;
        }
        public object Current
        {
            get
            {
                string[] split = currentLine.Split(',');
                return new Student
                {
                    ID = int.Parse(split[0]),
                    FullName = split[1],
                    Age = int.Parse(split[2])


                };

            }
        }

        public bool MoveNext()
        {
            currentLine = readerObject.ReadLine();
            return currentLine != null;
        }

        public void Reset()
        {
            this.currentLine = default(string);
        }

    }
}

Comments

Popular posts from this blog

How to get cell value of gridview using JQUERY

how to convert web page to pdf

Export Html to Pdf using iTextSharp(GridView)