示例#1
0
        /// <summary>
        /// Flags Unity projects for debugging with this addin
        /// </summary>
        protected override bool CanExecute(SolutionEntityItem item, ExecutionContext context, ConfigurationSelector configuration)
        {
            // HACK: Poll for attachable processes so the players processes are available when trying to attach for the first time.
            if (!processesPolled)
            {
                DispatchService.ThreadDispatch(delegate {
                    // Hack: Poll twice, this increases the chances of iOS USB being ready
                    UnityDebuggerEngine.GetAttachableProcesses();
                    System.Threading.Thread.Sleep(250);
                    UnityDebuggerEngine.GetAttachableProcesses();
                });
                processesPolled = true;
            }

            if (context.ExecutionHandler != null)
            {
                context.ExecutionHandler.CanExecute(executionCommand);
            }

            if (CanExecuteProject(item as Project))
            {
                return(true);
            }

            return(base.CanExecute(item, context, configuration));
        }
        void UpdateReferences(IList <WebReferenceItem> items)
        {
            try {
                UpdateReferenceContext = IdeApp.Workbench.StatusBar.CreateContext();
                UpdateReferenceContext.BeginProgress(GettextCatalog.GetPluralString("Updating web reference", "Updating web references", items.Count));

                DispatchService.ThreadDispatch(() => {
                    for (int i = 0; i < items.Count; i++)
                    {
                        DispatchService.GuiDispatch(() => UpdateReferenceContext.SetProgressFraction(Math.Max(0.1, (double)i / items.Count)));
                        items [i].Update();
                    }

                    DispatchService.GuiDispatch(() => {
                        // Make sure that we save all relevant projects, there should only be 1 though
                        foreach (var project in items.Select(i => i.Project).Distinct())
                        {
                            IdeApp.ProjectOperations.Save(project);
                        }

                        IdeApp.Workbench.StatusBar.ShowMessage(GettextCatalog.GetPluralString("Updated Web Reference {0}", "Updated Web References", items.Count, items[0].Name));
                        DisposeUpdateContext();
                    });
                });
            } catch {
                DisposeUpdateContext();
                throw;
            }
        }
示例#3
0
        public IAsyncOperation SignPackage(ConfigurationSelector configSel)
        {
            TaskService.Errors.ClearByOwner(this);

            var monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor();

            DispatchService.ThreadDispatch(delegate {
                SignPackageAsync(monitor, configSel);
            }, null);

            return(monitor.AsyncOperation);
        }