Beispiel #1
0
        public void Compile(CompileMethod method)
        {
            try
            {
                ThreadHelper.ThrowIfNotOnUIThread();

                _method = method;

                if (_compileThread == null || !_compileThread.IsAlive)
                {
                    if (_pane == null)
                    {
                        _pane = Shell.CreateOutputPane(_paneGuid, Constants.CompileOutputPaneTitle);
                    }
                    _pane.Clear();
                    _pane.Show();

                    StartCompile();
                }
                else
                {
                    if (_pane != null)
                    {
                        _pane.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                WriteLine(string.Concat("Exception when starting compile:\r\n", ex));
                Log.WriteEx(ex);
            }
        }
Beispiel #2
0
        private void InstallTestRPCCallback(object sender, EventArgs e)
        {
            OutputPane pane = package.TrufflePane;

            pane.Clear();
            pane.AddLine("Checking Node.JS and NPM installation...");

            TruffleENV.CheckNPMInstalled((isNPMInstalled) =>
            {
                if (isNPMInstalled == false)
                {
                    pane.AddLine("Cannot install TestRPC. It appears you don't have Node.JS or NPM installed on your system. Please visit http://nodejs.org for more information.");
                    return;
                }

                pane.AddLine("Installing TestRPC... (this may take a minute)");

                pane.RunInProject("npm install ethereumjs-testrpc", () =>
                {
                    pane.AddLine("Done! Checking installation...");

                    if (TruffleENV.CheckTestRPCInstalled(package.ProjectPath) == true)
                    {
                        ((TrufflePackage)this.package).RecheckEnvironment();
                        pane.AddLine("Completed successfully.");
                    }
                    else
                    {
                        pane.AddLine("Installation failed. Please see error messages above and try again.");
                    }
                });
            });
        }
        void BeginGetQuotes(HashSet <Security> toFetch)
        {
            if (_services.Count == 0 || toFetch.Count == 0)
            {
                return;
            }

            UiDispatcher.BeginInvoke(new Action(() =>
            {
                OutputPane output = (OutputPane)provider.GetService(typeof(OutputPane));
                output.Clear();
                output.AppendHeading(Walkabout.Properties.Resources.StockQuoteCaption);
            }));

            List <string> batch = new List <string>();

            foreach (Security s in toFetch)
            {
                if (string.IsNullOrEmpty(s.Symbol))
                {
                    continue; // skip it.
                }
                batch.Add(s.Symbol);
            }

            bool foundService             = false;
            IStockQuoteService service    = GetHistoryService();
            HistoryDownloader  downloader = GetDownloader(service);

            if (service != null)
            {
                downloader.BeginFetchHistory(batch);
                foundService = true;
            }

            service = GetQuoteService();
            if (service != null)
            {
                foundService = true;
                if (service.SupportsBatchQuotes)
                {
                    service.BeginFetchQuotes(batch);
                }
                else
                {
                    foreach (var item in batch)
                    {
                        service.BeginFetchQuote(item);
                    }
                }
            }

            if (!foundService)
            {
                AddError(Walkabout.Properties.Resources.ConfigureStockQuoteService);
                UiDispatcher.BeginInvoke(new Action(UpdateUI));
            }
        }
Beispiel #4
0
 public void QueueProjectsForBuilding(ICollection <IVsProject> projects)
 {
     BuildContext(true);
     OutputPane.Clear();
     OutputPane.Activate();
     foreach (IVsProject p in projects)
     {
         _buildProjects.Add(p);
     }
     BuildNextProject();
 }
Beispiel #5
0
        private void TestCallback(object sender, EventArgs e)
        {
            OutputPane pane = package.TrufflePane;

            pane.Clear();
            pane.AddLine("Running tests...");
            pane.RunTruffleCommand("test", () =>
            {
                pane.AddLine("Done.");
            });
        }
Beispiel #6
0
        private void MigrateCallback(object sender, EventArgs e)
        {
            OutputPane pane = package.TrufflePane;

            pane.Clear();
            pane.AddLine("Migrating...");
            pane.RunTruffleCommand("migrate --reset", () =>
            {
                pane.AddLine("Done.");
            });
        }
Beispiel #7
0
        private void CompileCallback(object sender, EventArgs e)
        {
            OutputPane pane = package.TrufflePane;

            pane.Clear();
            pane.AddLine("Compiling...");
            pane.RunTruffleCommand("compile --all", () =>
            {
                pane.AddLine("Done.");
            });
        }
Beispiel #8
0
        private void InitializeProjectCallback(object sender, EventArgs e)
        {
            OutputPane pane = package.TrufflePane;

            pane.Clear();
            pane.AddLine("Initializing project...");
            pane.RunTruffleCommand("init", () =>
            {
                pane.AddLine("Done");
                this.package.RecheckEnvironment();
            });
        }
 public void InitializeProjects()
 {
     //
     // Postpone project initialization until the AddIn has been
     // removed.
     //
     if (!File.Exists(AddinPath))
     {
         OutputPane.Clear();
         InitializeProjects(DTEUtil.GetProjects(DTE.Solution));
     }
 }
 public void InitializeProjects()
 {
     OutputPane.Clear();
     InitializeProjects(DTEUtil.GetProjects(DTE.Solution));
 }