Example #1
0
        private void SubItemCallback2(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            var dte = GetDTE();

            if (dte == null)
            {
                return;
            }

            try
            {
                var            activeFile = dte.ActiveDocument.FullName;
                ThriftGenerate ser        = new ThriftGenerateNet45(activeFile);
                ser.GenerateSource(true);
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                VsShellUtilities.ShowMessageBox(
                    this.package,
                    "Thrift Server Net45",
                    message,
                    OLEMSGICON.OLEMSGICON_INFO,
                    OLEMSGBUTTON.OLEMSGBUTTON_OK,
                    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            var thriftList = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.thrift");

            for (var i = 0; i < thriftList.Length; i++)
            {
                Console.WriteLine($"{i},{Path.GetFileName(thriftList[i])}");
            }

            Console.Read();

            foreach (var activefile in thriftList)
            {
                ThriftGenerate thriftGenerate = new ThriftGenerateNet45(activefile);
                thriftGenerate.GenerateProject();

                //ThriftGenerate thriftGenerate = new ThriftGenerateNetCore(activefile);
                //thriftGenerate.GenerateProject();


                Thread.Sleep(1000);
            }

            Console.WriteLine("success");
            Console.ReadLine();
            Console.WriteLine("success");
            Console.ReadLine();
        }