/// <summary> /// SCORM Engine Service constructor that takes a single configuration parameter /// </summary> /// <param name="config">The Configuration object to be used to configure the Scorm Engine Service client</param> public ScormEngineService(Configuration config) { System.Net.ServicePointManager.Expect100Continue = false; configuration = config; courseService = new CourseService(configuration, this); dispatchService = new DispatchService(configuration, this); registrationService = new RegistrationService(configuration, this); invitationService = new InvitationService(configuration, this); uploadService = new UploadService(configuration, this); ftpService = new FtpService(configuration, this); exportService = new ExportService(configuration, this); reportingService = new ReportingService(configuration, this); debugService = new DebugService(configuration, this); }
static void Cleanup() { DebuggerSession currentSession; StatusBarIcon currentIcon; OperationConsole currentConsole; lock (cleanup_lock) { if (!IsDebugging) { return; } currentIcon = busyStatusIcon; currentSession = session; currentConsole = console; nextStatementLocations.Clear(); currentBacktrace = null; busyStatusIcon = null; session = null; console = null; pinnedWatches.InvalidateAll(); } UnsetDebugLayout(); currentSession.BusyStateChanged -= OnBusyStateChanged; currentSession.TargetEvent -= OnTargetEvent; currentSession.TargetStarted -= OnStarted; currentSession.BreakpointTraceHandler = null; currentSession.GetExpressionEvaluator = null; currentSession.TypeResolverHandler = null; currentSession.OutputWriter = null; currentSession.LogWriter = null; currentDebugOperation.Cleanup(); if (currentConsole != null) { cancelRegistration.Dispose(); currentConsole.Dispose(); } DispatchService.GuiDispatch(delegate { HideExceptionCaughtDialog(); if (currentIcon != null) { currentIcon.Dispose(); currentIcon = null; } if (StoppedEvent != null) { StoppedEvent(null, new EventArgs()); } NotifyCallStackChanged(); NotifyCurrentFrameChanged(); NotifyLocationChanged(); }); currentSession.Dispose(); }
public void ReportStatus(string resultMessage) { DispatchService.GuiDispatch(delegate { outputPad.ReportStatus(resultMessage); }); }
public void Pulse() { DispatchService.AssertGuiThread(); OnProgressPulse(EventArgs.Empty); }
protected override void Initialize() { finishedBuildingTreeHandler = (ClassPadEventHandler)DispatchService.GuiDispatch(new ClassPadEventHandler(OnFinishedBuildingTree)); // FinishedBuildingTree += finishedBuildingTreeHandler; TagDatabaseManager.Instance.FileUpdated += finishedBuildingTreeHandler; }
protected virtual void GuiDispatch(Action handler) { DispatchService.GuiDispatch(handler); }
public ProjectNodeBuilder() { projectNameChanged = (SolutionItemRenamedEventHandler)DispatchService.GuiDispatch(new SolutionItemRenamedEventHandler(OnProjectRenamed)); }
public void EncryptWithNullPropertiesOK() { // all of these objects should have null properties, this should not cause secret to blow up var secret = Guid.NewGuid().ToString("n"); try { var generic = new GenericService(); generic.Encrypt(secret); generic.Decrypt(secret); } catch (Exception) { Assert.Fail("generic failed with empty values"); } try { var file = new FileService(); file.Encrypt(secret); file.Decrypt(secret); } catch (Exception) { Assert.Fail("file failed with empty values"); } try { var luis = new LuisService(); luis.Encrypt(secret); luis.Decrypt(secret); } catch (Exception) { Assert.Fail("luis failed with empty values"); } try { var dispatch = new DispatchService(); dispatch.Encrypt(secret); dispatch.Decrypt(secret); } catch (Exception) { Assert.Fail("dispatch failed with empty values"); } try { var insights = new AppInsightsService(); insights.Encrypt(secret); insights.Decrypt(secret); } catch (Exception) { Assert.Fail("insights failed with empty values"); } try { var bot = new BotService(); bot.Encrypt(secret); bot.Decrypt(secret); } catch (Exception) { Assert.Fail("bot failed with empty values"); } try { var cosmos = new CosmosDbService(); cosmos.Encrypt(secret); cosmos.Decrypt(secret); } catch (Exception) { Assert.Fail("cosmos failed with empty values"); } try { var qna = new QnAMakerService(); qna.Encrypt(secret); qna.Decrypt(secret); } catch (Exception) { Assert.Fail("qna failed with empty values"); } try { var blob = new BlobStorageService(); blob.Encrypt(secret); blob.Decrypt(secret); } catch (Exception) { Assert.Fail("blob failed with empty values"); } try { var endpoint = new EndpointService(); endpoint.Encrypt(secret); endpoint.Decrypt(secret); } catch (Exception) { Assert.Fail("endpoint failed with empty values"); } }
public static Stetic.CodeGenerationResult GenerateSteticCode(IProgressMonitor monitor, DotNetProject project, ConfigurationSelector configuration) { if (generating || !GtkDesignInfo.HasDesignedObjects(project)) { return(null); } using (var timer = Counters.SteticFileGeneratedTimer.BeginTiming()) { timer.Trace("Checking references"); GtkDesignInfo info = GtkDesignInfo.FromProject(project); DateTime last_gen_time = File.Exists(info.SteticGeneratedFile) ? File.GetLastWriteTime(info.SteticGeneratedFile) : DateTime.MinValue; bool ref_changed = false; // Disabled check for changes in referenced assemblies, since it cause too much // regeneration of code. If a component has changed in a referenced project, this // project may not build, but this can be solved by editing some file in the // designer and saving. /* foreach (ProjectReference pref in project.References) { * if (!pref.IsValid) * continue; * foreach (string filename in pref.GetReferencedFileNames (configuration)) { * if (File.GetLastWriteTime (filename) > last_gen_time) { * ref_changed = true; * break; * } * } * if (ref_changed) * break; * }*/ // Check if generated code is already up to date. if (!ref_changed && last_gen_time >= File.GetLastWriteTime(info.SteticFile)) { return(null); } if (info.GuiBuilderProject.HasError) { monitor.ReportError(GettextCatalog.GetString("GUI code generation failed for project '{0}'. The file '{1}' could not be loaded.", project.Name, info.SteticFile), null); monitor.AsyncOperation.Cancel(); return(null); } if (info.GuiBuilderProject.IsEmpty) { return(null); } monitor.Log.WriteLine(GettextCatalog.GetString("Generating GUI code for project '{0}'...", project.Name)); timer.Trace("Copy support files"); // Make sure the referenced assemblies are up to date. It is necessary to do // it now since they may contain widget libraries. project.CopySupportFiles(monitor, configuration); timer.Trace("Update libraries"); info.GuiBuilderProject.UpdateLibraries(); ArrayList projects = new ArrayList(); projects.Add(info.GuiBuilderProject.File); generating = true; Stetic.CodeGenerationResult generationResult = null; Exception generatedException = null; bool canGenerateInProcess = IsolationMode != Stetic.IsolationMode.None || info.GuiBuilderProject.SteticProject.CanGenerateCode; if (!canGenerateInProcess) { timer.Trace("Generating out of process"); // Run the generation in another thread to avoid freezing the GUI System.Threading.ThreadPool.QueueUserWorkItem(delegate { try { // Generate the code in another process if stetic is not isolated CodeGeneratorProcess cob = (CodeGeneratorProcess)Runtime.ProcessService.CreateExternalProcessObject(typeof(CodeGeneratorProcess), false); using (cob) { generationResult = cob.GenerateCode(projects, info.GenerateGettext, info.GettextClass, info.ImageResourceLoaderClass, project.UsePartialTypes); } } catch (Exception ex) { generatedException = ex; } finally { generating = false; } }); while (generating) { DispatchService.RunPendingEvents(); System.Threading.Thread.Sleep(100); } } else { timer.Trace("Generating in-process"); // No need to create another process, since stetic has its own backend process // or the widget libraries have no custom wrappers try { Stetic.GenerationOptions options = new Stetic.GenerationOptions(); options.UseGettext = info.GenerateGettext; options.GettextClass = info.GettextClass; options.ImageResourceLoaderClass = info.ImageResourceLoaderClass; options.UsePartialClasses = project.UsePartialTypes; options.GenerateSingleFile = false; options.GenerateModifiedOnly = true; generationResult = SteticApp.GenerateProjectCode(options, info.GuiBuilderProject.SteticProject); info.GuiBuilderProject.SteticProject.ResetModifiedWidgetFlags(); } catch (Exception ex) { generatedException = ex; } generating = false; } timer.Trace("Writing code units"); if (generatedException != null) { LoggingService.LogError("GUI code generation failed", generatedException); throw new UserException("GUI code generation failed: " + generatedException.Message); } if (generationResult == null) { return(null); } CodeDomProvider provider = project.LanguageBinding.GetCodeDomProvider(); if (provider == null) { throw new UserException("Code generation not supported for language: " + project.LanguageName); } string basePath = Path.GetDirectoryName(info.SteticGeneratedFile); string ext = Path.GetExtension(info.SteticGeneratedFile); var pol = project.Policies.Get <TextStylePolicy> (); var codeGeneratorOptions = new CodeGeneratorOptions() { IndentString = pol.TabsToSpaces? new string (' ', pol.TabWidth) : "\t", BlankLinesBetweenMembers = true }; foreach (Stetic.SteticCompilationUnit unit in generationResult.Units) { string fname; if (unit.Name.Length == 0) { fname = info.SteticGeneratedFile; } else { fname = Path.Combine(basePath, unit.Name) + ext; } StringWriter sw = new StringWriter(); try { foreach (CodeNamespace ns in unit.Namespaces) { ns.Comments.Add(new CodeCommentStatement("This file has been generated by the GUI designer. Do not modify.")); } timer.Trace("Generating code for " + unit.Name); provider.GenerateCodeFromCompileUnit(unit, sw, codeGeneratorOptions); string content = sw.ToString(); timer.Trace("Formatting code"); content = FormatGeneratedFile(fname, content, project, provider); timer.Trace("Writing code"); File.WriteAllText(fname, content); } finally { timer.Trace("Notifying changes"); FileService.NotifyFileChanged(fname); } } timer.Trace("Updating GTK folder"); // Make sure the generated files are added to the project if (info.UpdateGtkFolder()) { Gtk.Application.Invoke(delegate { IdeApp.ProjectOperations.Save(project); }); } return(generationResult); } }
/// <summary> /// Ctor. /// </summary> /// <param name="statementResultServiceImpl">handles result delivery</param> /// <param name="dispatchService">for performing the dispatch</param> public UpdateDispatchViewNonBlocking(StatementResultService statementResultServiceImpl, DispatchService dispatchService) : base(statementResultServiceImpl, dispatchService) { }
public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string menuPath) { base.Initialize(builders, options, menuPath); testChangedHandler = (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnDetailsTestChanged)); testService.TestSuiteChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnTestSuiteChanged)); paned = new VPaned(); VBox vbox = new VBox(); DockItemToolbar topToolbar = Window.GetToolbar(PositionType.Top); buttonRunAll = new Button(new Gtk.Image(Gtk.Stock.GoUp, IconSize.Menu)); buttonRunAll.Clicked += new EventHandler(OnRunAllClicked); buttonRunAll.Sensitive = true; buttonRunAll.TooltipText = GettextCatalog.GetString("Run all tests"); topToolbar.Add(buttonRunAll); buttonRun = new Button(new Gtk.Image(Gtk.Stock.Execute, IconSize.Menu)); buttonRun.Clicked += new EventHandler(OnRunClicked); buttonRun.Sensitive = true; buttonRun.TooltipText = GettextCatalog.GetString("Run test"); topToolbar.Add(buttonRun); buttonStop = new Button(new Gtk.Image(Gtk.Stock.Stop, IconSize.Menu)); buttonStop.Clicked += new EventHandler(OnStopClicked); buttonStop.Sensitive = false; buttonStop.TooltipText = GettextCatalog.GetString("Cancel running test"); topToolbar.Add(buttonStop); topToolbar.ShowAll(); vbox.PackEnd(base.Control, true, true, 0); vbox.FocusChain = new Gtk.Widget [] { base.Control }; paned.Pack1(vbox, true, true); detailsPad = new VBox(); EventBox eb = new EventBox(); HBox header = new HBox(); eb.Add(header); detailLabel = new HeaderLabel(); detailLabel.Padding = 6; Button hb = new Button(new Gtk.Image("gtk-close", IconSize.SmallToolbar)); hb.Relief = ReliefStyle.None; hb.Clicked += new EventHandler(OnCloseDetails); header.PackEnd(hb, false, false, 0); hb = new Button(new Gtk.Image("gtk-go-back", IconSize.SmallToolbar)); hb.Relief = ReliefStyle.None; hb.Clicked += new EventHandler(OnGoBackTest); header.PackEnd(hb, false, false, 0); header.Add(detailLabel); Gdk.Color hcol = eb.Style.Background(StateType.Normal); hcol.Red = (ushort)(((double)hcol.Red) * 0.9); hcol.Green = (ushort)(((double)hcol.Green) * 0.9); hcol.Blue = (ushort)(((double)hcol.Blue) * 0.9); // eb.ModifyBg (StateType.Normal, hcol); detailsPad.PackStart(eb, false, false, 0); VPaned panedDetails = new VPaned(); panedDetails.BorderWidth = 3; VBox boxPaned1 = new VBox(); chart = new TestChart(); chart.ButtonPressEvent += OnChartButtonPress; chart.SelectionChanged += new EventHandler(OnChartDateChanged); chart.HeightRequest = 50; Toolbar toolbar = new Toolbar(); toolbar.IconSize = IconSize.SmallToolbar; toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.ShowArrow = false; ToolButton but = new ToolButton("gtk-zoom-in"); but.Clicked += new EventHandler(OnZoomIn); toolbar.Insert(but, -1); but = new ToolButton("gtk-zoom-out"); but.Clicked += new EventHandler(OnZoomOut); toolbar.Insert(but, -1); but = new ToolButton("gtk-go-back"); but.Clicked += new EventHandler(OnChartBack); toolbar.Insert(but, -1); but = new ToolButton("gtk-go-forward"); but.Clicked += new EventHandler(OnChartForward); toolbar.Insert(but, -1); but = new ToolButton("gtk-goto-last"); but.Clicked += new EventHandler(OnChartLast); toolbar.Insert(but, -1); boxPaned1.PackStart(toolbar, false, false, 0); boxPaned1.PackStart(chart, true, true, 0); panedDetails.Pack1(boxPaned1, false, false); // Detailed test information -------- infoBook = new ButtonNotebook(); infoBook.PageLoadRequired += new EventHandler(OnPageLoadRequired); // Info - Group summary Frame tf = new Frame(); ScrolledWindow sw = new ScrolledWindow(); detailsTree = new TreeView(); detailsTree.HeadersVisible = true; detailsTree.RulesHint = true; detailsStore = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string)); CellRendererText trtest = new CellRendererText(); CellRendererText tr; TreeViewColumn col3 = new TreeViewColumn(); col3.Expand = false; // col3.Alignment = 0.5f; col3.Widget = new Gtk.Image(CircleImage.Success); col3.Widget.Show(); tr = new CellRendererText(); // tr.Xalign = 0.5f; col3.PackStart(tr, false); col3.AddAttribute(tr, "markup", 2); detailsTree.AppendColumn(col3); TreeViewColumn col4 = new TreeViewColumn(); col4.Expand = false; // col4.Alignment = 0.5f; col4.Widget = new Gtk.Image(CircleImage.Failure); col4.Widget.Show(); tr = new CellRendererText(); // tr.Xalign = 0.5f; col4.PackStart(tr, false); col4.AddAttribute(tr, "markup", 3); detailsTree.AppendColumn(col4); TreeViewColumn col5 = new TreeViewColumn(); col5.Expand = false; // col5.Alignment = 0.5f; col5.Widget = new Gtk.Image(CircleImage.NotRun); col5.Widget.Show(); tr = new CellRendererText(); // tr.Xalign = 0.5f; col5.PackStart(tr, false); col5.AddAttribute(tr, "markup", 4); detailsTree.AppendColumn(col5); TreeViewColumn col1 = new TreeViewColumn(); // col1.Resizable = true; // col1.Expand = true; col1.Title = "Test"; col1.PackStart(trtest, true); col1.AddAttribute(trtest, "markup", 1); detailsTree.AppendColumn(col1); detailsTree.Model = detailsStore; sw.Add(detailsTree); tf.Add(sw); tf.ShowAll(); TestSummaryPage = infoBook.AddPage(GettextCatalog.GetString("Summary"), tf); // Info - Regressions list tf = new Frame(); sw = new ScrolledWindow(); tf.Add(sw); regressionTree = new TreeView(); regressionTree.HeadersVisible = false; regressionTree.RulesHint = true; regressionStore = new ListStore(typeof(object), typeof(string), typeof(Pixbuf)); CellRendererText trtest2 = new CellRendererText(); var pr = new CellRendererPixbuf(); TreeViewColumn col = new TreeViewColumn(); col.PackStart(pr, false); col.AddAttribute(pr, "pixbuf", 2); col.PackStart(trtest2, false); col.AddAttribute(trtest2, "markup", 1); regressionTree.AppendColumn(col); regressionTree.Model = regressionStore; sw.Add(regressionTree); tf.ShowAll(); TestRegressionsPage = infoBook.AddPage(GettextCatalog.GetString("Regressions"), tf); // Info - Failed tests list tf = new Frame(); sw = new ScrolledWindow(); tf.Add(sw); failedTree = new TreeView(); failedTree.HeadersVisible = false; failedTree.RulesHint = true; failedStore = new ListStore(typeof(object), typeof(string), typeof(Pixbuf)); trtest2 = new CellRendererText(); pr = new CellRendererPixbuf(); col = new TreeViewColumn(); col.PackStart(pr, false); col.AddAttribute(pr, "pixbuf", 2); col.PackStart(trtest2, false); col.AddAttribute(trtest2, "markup", 1); failedTree.AppendColumn(col); failedTree.Model = failedStore; sw.Add(failedTree); tf.ShowAll(); TestFailuresPage = infoBook.AddPage(GettextCatalog.GetString("Failed tests"), tf); // Info - results tf = new Frame(); sw = new ScrolledWindow(); tf.Add(sw); resultView = new TextView(); resultView.Editable = false; sw.Add(resultView); tf.ShowAll(); TestResultPage = infoBook.AddPage(GettextCatalog.GetString("Result"), tf); // Info - Output tf = new Frame(); sw = new ScrolledWindow(); tf.Add(sw); outputView = new TextView(); outputView.Editable = false; sw.Add(outputView); tf.ShowAll(); TestOutputPage = infoBook.AddPage(GettextCatalog.GetString("Output"), tf); panedDetails.Pack2(infoBook, true, true); detailsPad.PackStart(panedDetails, true, true, 0); paned.Pack2(detailsPad, true, true); paned.ShowAll(); infoBook.HidePage(TestResultPage); infoBook.HidePage(TestOutputPage); infoBook.HidePage(TestSummaryPage); infoBook.HidePage(TestRegressionsPage); infoBook.HidePage(TestFailuresPage); detailsPad.Sensitive = false; detailsPad.Hide(); detailsTree.RowActivated += new Gtk.RowActivatedHandler(OnTestActivated); regressionTree.RowActivated += new Gtk.RowActivatedHandler(OnRegressionTestActivated); failedTree.RowActivated += new Gtk.RowActivatedHandler(OnFailedTestActivated); foreach (UnitTest t in testService.RootTests) { TreeView.AddChild(t); } }
private void ProcessPreviewImageWork(object state) { PreviewImageJob imageJob; bool workLeft = true; while (workLeft) { lock (this.imageSync) { if (this.previewImageWorkQueue.Count == 0) { this.previewImageQueueProcessing = false; return; } imageJob = this.previewImageWorkQueue.Dequeue(); } string imagePath = Path.Combine( Utilities.ImageCacheFolder, Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture), imageJob.UpdateVersion.ToString(CultureInfo.InvariantCulture), imageJob.PreviewNumber + ".bmp"); BitmapSource imageSource = null; // Check the disc cache for the image lock (imageJob.ImageFileSync) { if (File.Exists(imagePath)) { // When we read from disc cache the image is already transformed. var bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.CacheOption = BitmapCacheOption.OnLoad; bitmapImage.UriSource = new Uri(imagePath); bitmapImage.EndInit(); bitmapImage.Freeze(); imageSource = bitmapImage; } } if (imageSource == null) { // Make a HandBrake call to get the image imageSource = imageJob.ScanInstance.GetPreview(imageJob.EncodeJob.HbJob, imageJob.PreviewNumber); // Transform the image as per rotation and reflection settings VCProfile profile = imageJob.EncodeJob.EncodingProfile; if (profile.FlipHorizontal || profile.FlipVertical || profile.Rotation != VCPictureRotation.None) { imageSource = CreateTransformedBitmap(imageSource, profile); } // Start saving the image file in the background and continue to process the queue. ThreadPool.QueueUserWorkItem( this.BackgroundFileSave, new SaveImageJob { PreviewNumber = imageJob.PreviewNumber, UpdateVersion = imageJob.UpdateVersion, FilePath = imagePath, Image = imageSource, ImageFileSync = imageJob.ImageFileSync }); } lock (this.imageSync) { if (imageJob.UpdateVersion == updateVersion) { this.previewImageCache[imageJob.PreviewNumber] = imageSource; if (this.SelectedPreview == imageJob.PreviewNumber) { DispatchService.BeginInvoke(() => { this.previewBitmapSource = imageSource; this.RefreshFromBitmapImage(); }); } } if (this.previewImageWorkQueue.Count == 0) { workLeft = false; this.previewImageQueueProcessing = false; } } } }
private void previewImageRefreshTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { this.waitingOnRefresh = false; this.lastImageRefreshTime = DateTime.MinValue; DispatchService.BeginInvoke(this.RefreshPreviews); }
public EPServicesContext( IContainer container, AggregationServiceFactoryService aggregationServiceFactoryService, BeanEventTypeFactoryPrivate beanEventTypeFactoryPrivate, BeanEventTypeStemService beanEventTypeStemService, ClassForNameProvider classForNameProvider, ParentClassLoader classLoaderParent, PathRegistry <string, ClassProvided> classProvidedPathRegistry, Configuration configSnapshot, ContextManagementService contextManagementService, PathRegistry <string, ContextMetaData> contextPathRegistry, ContextServiceFactory contextServiceFactory, EPDataFlowServiceImpl dataflowService, DataFlowFilterServiceAdapter dataFlowFilterServiceAdapter, DatabaseConfigServiceRuntime databaseConfigServiceRuntime, DeploymentLifecycleService deploymentLifecycleService, DispatchService dispatchService, RuntimeEnvContext runtimeEnvContext, RuntimeSettingsService runtimeSettingsService, string runtimeURI, ImportServiceRuntime importServiceRuntime, EPStatementFactory epStatementFactory, PathRegistry <string, ExpressionDeclItem> exprDeclaredPathRegistry, IReaderWriterLock eventProcessingRWLock, EPServicesHA epServicesHA, EPRuntimeSPI epRuntime, EventBeanService eventBeanService, EventBeanTypedEventFactory eventBeanTypedEventFactory, EPRenderEventServiceImpl eventRenderer, EventSerdeFactory eventSerdeFactory, EventTableIndexService eventTableIndexService, EventTypeAvroHandler eventTypeAvroHandler, EventTypeFactory eventTypeFactory, EventTypeIdResolver eventTypeIdResolver, PathRegistry <string, EventType> eventTypePathRegistry, EventTypeRepositoryImpl eventTypeRepositoryBus, EventTypeResolvingBeanFactory eventTypeResolvingBeanFactory, EventTypeSerdeRepository eventTypeSerdeRepository, ExceptionHandlingService exceptionHandlingService, ExpressionResultCacheService expressionResultCacheService, FilterBooleanExpressionFactory filterBooleanExpressionFactory, FilterServiceSPI filterService, FilterSharedBoolExprRepository filterSharedBoolExprRepository, FilterSharedLookupableRepository filterSharedLookupableRepository, HistoricalDataCacheFactory historicalDataCacheFactory, InternalEventRouterImpl internalEventRouter, MetricReportingService metricReportingService, MultiMatchHandlerFactory multiMatchHandlerFactory, NamedWindowConsumerManagementService namedWindowConsumerManagementService, NamedWindowDispatchService namedWindowDispatchService, NamedWindowFactoryService namedWindowFactoryService, NamedWindowManagementService namedWindowManagementService, PathRegistry <string, NamedWindowMetaData> namedWindowPathRegistry, PatternFactoryService patternFactoryService, PatternSubexpressionPoolRuntimeSvc patternSubexpressionPoolEngineSvc, ResultSetProcessorHelperFactory resultSetProcessorHelperFactory, RowRecogStateRepoFactory rowRecogStateRepoFactory, RowRecogStatePoolRuntimeSvc rowRecogStatePoolEngineSvc, SchedulingServiceSPI schedulingService, PathRegistry <NameAndParamNum, ExpressionScriptProvided> scriptPathRegistry, ScriptCompiler scriptCompiler, StageRecoveryService stageRecoveryService, StatementLifecycleService statementLifecycleService, StatementAgentInstanceLockFactory statementAgentInstanceLockFactory, StatementResourceHolderBuilder statementResourceHolderBuilder, TableExprEvaluatorContext tableExprEvaluatorContext, TableManagementService tableManagementService, PathRegistry <string, TableMetaData> tablePathRegistry, ThreadingService threadingService, TimeAbacus timeAbacus, TimeSourceService timeSourceService, TimerService timerService, VariableManagementService variableManagementService, PathRegistry <string, VariableMetaData> variablePathRegistry, ViewableActivatorFactory viewableActivatorFactory, ViewFactoryService viewFactoryService, ViewServicePreviousFactory viewServicePreviousFactory, XMLFragmentEventTypeFactory xmlFragmentEventTypeFactory) { _container = container; _aggregationServiceFactoryService = aggregationServiceFactoryService; _beanEventTypeFactoryPrivate = beanEventTypeFactoryPrivate; _beanEventTypeStemService = beanEventTypeStemService; _classForNameProvider = classForNameProvider; _classLoaderParent = classLoaderParent; _classProvidedPathRegistry = classProvidedPathRegistry; _configSnapshot = configSnapshot; _contextManagementService = contextManagementService; _contextPathRegistry = contextPathRegistry; _contextServiceFactory = contextServiceFactory; _dataflowService = dataflowService; _dataFlowFilterServiceAdapter = dataFlowFilterServiceAdapter; _databaseConfigServiceRuntime = databaseConfigServiceRuntime; _deploymentLifecycleService = deploymentLifecycleService; _dispatchService = dispatchService; _runtimeEnvContext = runtimeEnvContext; _runtimeSettingsService = runtimeSettingsService; _runtimeUri = runtimeURI; _importServiceRuntime = importServiceRuntime; _epStatementFactory = epStatementFactory; _exprDeclaredPathRegistry = exprDeclaredPathRegistry; _eventProcessingRWLock = eventProcessingRWLock; _epServicesHA = epServicesHA; _epRuntime = epRuntime; _eventBeanService = eventBeanService; _eventBeanTypedEventFactory = eventBeanTypedEventFactory; _eventRenderer = eventRenderer; _eventSerdeFactory = eventSerdeFactory; _eventTableIndexService = eventTableIndexService; _eventTypeAvroHandler = eventTypeAvroHandler; _eventTypeFactory = eventTypeFactory; _eventTypeIdResolver = eventTypeIdResolver; _eventTypePathRegistry = eventTypePathRegistry; _eventTypeRepositoryBus = eventTypeRepositoryBus; _eventTypeResolvingBeanFactory = eventTypeResolvingBeanFactory; _eventTypeSerdeRepository = eventTypeSerdeRepository; _exceptionHandlingService = exceptionHandlingService; _expressionResultCacheService = expressionResultCacheService; _filterBooleanExpressionFactory = filterBooleanExpressionFactory; _filterService = filterService; _filterSharedBoolExprRepository = filterSharedBoolExprRepository; _filterSharedLookupableRepository = filterSharedLookupableRepository; _historicalDataCacheFactory = historicalDataCacheFactory; _internalEventRouter = internalEventRouter; _metricReportingService = metricReportingService; _multiMatchHandlerFactory = multiMatchHandlerFactory; _namedWindowConsumerManagementService = namedWindowConsumerManagementService; _namedWindowDispatchService = namedWindowDispatchService; _namedWindowFactoryService = namedWindowFactoryService; _namedWindowManagementService = namedWindowManagementService; _namedWindowPathRegistry = namedWindowPathRegistry; _patternFactoryService = patternFactoryService; _patternSubexpressionPoolEngineSvc = patternSubexpressionPoolEngineSvc; _resultSetProcessorHelperFactory = resultSetProcessorHelperFactory; _rowRecogStateRepoFactory = rowRecogStateRepoFactory; _rowRecogStatePoolEngineSvc = rowRecogStatePoolEngineSvc; _schedulingService = schedulingService; _scriptPathRegistry = scriptPathRegistry; _stageRecoveryService = stageRecoveryService; _statementLifecycleService = statementLifecycleService; _statementAgentInstanceLockFactory = statementAgentInstanceLockFactory; _statementResourceHolderBuilder = statementResourceHolderBuilder; _tableExprEvaluatorContext = tableExprEvaluatorContext; _tableManagementService = tableManagementService; _tablePathRegistry = tablePathRegistry; _threadingService = threadingService; _timeAbacus = timeAbacus; _timeSourceService = timeSourceService; _timerService = timerService; _variableManagementService = variableManagementService; _variablePathRegistry = variablePathRegistry; _viewableActivatorFactory = viewableActivatorFactory; _viewFactoryService = viewFactoryService; _viewServicePreviousFactory = viewServicePreviousFactory; _xmlFragmentEventTypeFactory = xmlFragmentEventTypeFactory; _scriptCompiler = scriptCompiler; }
public bool RefillOutlineStore() { DispatchService.AssertGuiThread(); Gdk.Threads.Enter(); //refreshingOutline = false; if (TreeStore == null || !TreeView.IsRealized) { refillOutlineStoreId = 0; return(false); } outlineReady = false; // Save last selection int[] lastSelectedItem; TreeIter i; if (TreeView.Selection.GetSelected(out i)) { lastSelectedItem = TreeStore.GetPath(i).Indices; } else { lastSelectedItem = null; } // Save previously expanded items if wanted var lastExpanded = new List <int[]>(); if (DCompilerService.Instance.Outline.ExpansionBehaviour == DocOutlineCollapseBehaviour.ReopenPreviouslyExpanded && TreeStore.GetIterFirst(out i)) { do { var path = TreeStore.GetPath(i); if (TreeView.GetRowExpanded(path)) { lastExpanded.Add(path.Indices); } }while(TreeStore.IterNext(ref i)); } // Clear the tree TreeStore.Clear(); try { // Build up new tree if (SyntaxTree != null) { var caretLocation = Document.Editor.Caret.Location; BuildTreeChildren(TreeIter.Zero, SyntaxTree, new CodeLocation(caretLocation.Column, caretLocation.Line)); } } catch (Exception ex) { LoggingService.LogError("Error while updating document outline panel", ex); } finally { // Re-Expand tree items switch (DCompilerService.Instance.Outline.ExpansionBehaviour) { case DocOutlineCollapseBehaviour.ExpandAll: TreeView.ExpandAll(); break; case DocOutlineCollapseBehaviour.ReopenPreviouslyExpanded: foreach (var path in lastExpanded) { TreeView.ExpandToPath(new TreePath(path)); } break; } // Restore selection if (lastSelectedItem != null) { try { TreeView.ExpandToPath(new TreePath(lastSelectedItem)); } catch { } } outlineReady = true; } Gdk.Threads.Leave(); //stop timeout handler refillOutlineStoreId = 0; return(false); }
void CreateControl() { control = new HPaned(); store = new Gtk.ListStore(typeof(Gdk.Pixbuf), // image - type typeof(bool), // read? typeof(Task)); // read? -- use Pango weight TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTaskTypes); filter = new TreeModelFilter(store, null); filter.VisibleFunc = filterFunct; sort = new TreeModelSort(filter); sort.SetSortFunc(VisibleColumns.Type, SeverityIterSort); sort.SetSortFunc(VisibleColumns.Project, ProjectIterSort); sort.SetSortFunc(VisibleColumns.File, FileIterSort); view = new PadTreeView(sort); view.RulesHint = true; view.DoPopupMenu = (evnt) => IdeApp.CommandService.ShowContextMenu(view, evnt, CreateMenu()); AddColumns(); LoadColumnsVisibility(); view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type; view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project; view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File; sw = new MonoDevelop.Components.CompactScrolledWindow(); sw.ShadowType = ShadowType.None; sw.Add(view); TaskService.Errors.TasksRemoved += DispatchService.GuiDispatch <TaskEventHandler> (ShowResults); TaskService.Errors.TasksAdded += DispatchService.GuiDispatch <TaskEventHandler> (TaskAdded); TaskService.Errors.TasksChanged += DispatchService.GuiDispatch <TaskEventHandler> (TaskChanged); TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged; IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen; IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed; view.RowActivated += new RowActivatedHandler(OnRowActivated); iconWarning = sw.RenderIcon(Stock.Warning, Gtk.IconSize.Menu, ""); iconError = sw.RenderIcon(Stock.Error, Gtk.IconSize.Menu, ""); iconInfo = sw.RenderIcon(Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, ""); control.Add1(sw); outputView = new LogView(); control.Add2(outputView); Control.ShowAll(); control.SizeAllocated += HandleControlSizeAllocated; bool outputVisible = PropertyService.Get <bool> (outputViewVisiblePropertyName, false); if (outputVisible) { outputView.Visible = true; logBtn.Active = true; } else { outputView.Hide(); } sw.SizeAllocated += HandleSwSizeAllocated; // Load existing tasks foreach (Task t in TaskService.Errors) { AddTask(t); } control.FocusChain = new Gtk.Widget [] { sw }; }
public void InitializeTestRun(UnitTest test) { DispatchService.GuiDispatch(delegate { pad.InitializeTestRun(test); }); }
public void EncryptWithEmptyPropertiesOK() { // all of these objects should have null properties, this should not cause secret to blow up var secret = Guid.NewGuid().ToString("n"); try { var generic = new GenericService(); generic.Configuration["test"] = string.Empty; generic.Encrypt(secret); generic.Decrypt(secret); } catch (Exception) { Assert.Fail("generic failed with empty values"); } try { var file = new FileService { Path = string.Empty, }; file.Encrypt(secret); file.Decrypt(secret); } catch (Exception) { Assert.Fail("file failed with empty values"); } try { var luis = new LuisService { SubscriptionKey = string.Empty, }; luis.Encrypt(secret); luis.Decrypt(secret); } catch (Exception) { Assert.Fail("luis failed with empty values"); } try { var dispatch = new DispatchService { SubscriptionKey = string.Empty, }; dispatch.Encrypt(secret); dispatch.Decrypt(secret); } catch (Exception) { Assert.Fail("dispatch failed with empty values"); } try { var insights = new AppInsightsService { InstrumentationKey = string.Empty, }; insights.Encrypt(secret); insights.Decrypt(secret); } catch (Exception) { Assert.Fail("insights failed with empty values"); } try { var bot = new BotService(); bot.Encrypt(secret); bot.Decrypt(secret); } catch (Exception) { Assert.Fail("bot failed with empty values"); } try { var cosmos = new CosmosDbService { Key = string.Empty, }; cosmos.Encrypt(secret); cosmos.Decrypt(secret); } catch (Exception) { Assert.Fail("cosmos failed with empty values"); } try { var qna = new QnAMakerService { SubscriptionKey = string.Empty, }; qna.Encrypt(secret); qna.Decrypt(secret); } catch (Exception) { Assert.Fail("qna failed with empty values"); } try { var blob = new BlobStorageService { ConnectionString = string.Empty, }; blob.Encrypt(secret); blob.Decrypt(secret); } catch (Exception) { Assert.Fail("blob failed with empty values"); } try { var endpoint = new EndpointService { AppPassword = string.Empty, }; endpoint.Encrypt(secret); endpoint.Decrypt(secret); } catch (Exception) { Assert.Fail("endpoint failed with empty values"); } }
public void FinishTestRun() { DispatchService.GuiDispatch(delegate { pad.FinishTestRun(); }); }
protected virtual void BackgroundDispatchAndWait(MessageHandler handler) { DispatchService.BackgroundDispatchAndWait(handler); }
public void Cancel() { DispatchService.GuiDispatch(delegate { pad.Cancel(); }); }
void OnWindowChanged(object ob, EventArgs args) { DispatchService.GuiDispatch(new MessageHandler(SelectActiveFile)); }
public void BeginTest(UnitTest test) { DispatchService.GuiDispatch(delegate { monitor.BeginTest(test); }); }
public void SetProgressFraction(double work) { DispatchService.AssertGuiThread(); OnProgressFraction(new FractionEventArgs(work)); }
public void EndTest(UnitTest test, UnitTestResult result) { DispatchService.GuiDispatch(delegate { monitor.EndTest(test, result); }); }
static void RunMainLoop() { DispatchService.RunPendingEvents(); }
public void ReportRuntimeError(string message, Exception exception) { DispatchService.GuiDispatch(delegate { monitor.ReportRuntimeError(message, exception); }); }
public UserTasksView() { highPrioColor = StringToColor((string)PropertyService.Get("Monodevelop.UserTasksHighPrioColor", "")); normalPrioColor = StringToColor((string)PropertyService.Get("Monodevelop.UserTasksNormalPrioColor", "")); lowPrioColor = StringToColor((string)PropertyService.Get("Monodevelop.UserTasksLowPrioColor", "")); store = new ListStore( typeof(string), // priority typeof(bool), // completed typeof(string), // desc typeof(Task), // user task typeof(Gdk.Color), // foreground color typeof(int)); // font style sortModel = new TreeModelSort(store); view = new MonoDevelop.Ide.Gui.Components.PadTreeView(sortModel); view.RulesHint = true; view.SearchColumn = (int)Columns.Description; view.Selection.Changed += new EventHandler(SelectionChanged); TreeViewColumn col; CellRendererComboBox cellRendPriority = new CellRendererComboBox(); cellRendPriority.Values = priorities; cellRendPriority.Editable = true; cellRendPriority.Changed += new ComboSelectionChangedHandler(UserTaskPriorityEdited); col = view.AppendColumn(GettextCatalog.GetString("Priority"), cellRendPriority, "text", Columns.Priority, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold); col.Resizable = true; col.SortColumnId = (int)Columns.Priority; CellRendererToggle cellRendCompleted = new CellRendererToggle(); cellRendCompleted.Toggled += new ToggledHandler(UserTaskCompletedToggled); cellRendCompleted.Activatable = true; col = view.AppendColumn(String.Empty, cellRendCompleted, "active", Columns.Completed); cellRendDesc = view.TextRenderer; cellRendDesc.Editable = true; cellRendDesc.Edited += new EditedHandler(UserTaskDescEdited); col = view.AppendColumn(GettextCatalog.GetString("Description"), cellRendDesc, "text", Columns.Description, "strikethrough", Columns.Completed, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold); col.Resizable = true; col.SortColumnId = (int)Columns.Description; newButton = new Button(); newButton.Label = GettextCatalog.GetString("New Task"); newButton.Image = new Gtk.Image(Gtk.Stock.New, IconSize.Button); newButton.Image.Show(); newButton.Clicked += new EventHandler(NewUserTaskClicked); newButton.TooltipText = GettextCatalog.GetString("Create New Task"); copyButton = new Button(); copyButton.Label = GettextCatalog.GetString("Copy Task"); copyButton.Image = new Gtk.Image(Gtk.Stock.Copy, IconSize.Button); copyButton.Image.Show(); copyButton.Clicked += CopyUserTaskClicked; copyButton.TooltipText = GettextCatalog.GetString("Copy Task Description"); delButton = new Button(); delButton.Label = GettextCatalog.GetString("Delete Task"); delButton.Image = new Gtk.Image(Gtk.Stock.Delete, IconSize.Button); delButton.Image.Show(); delButton.Clicked += new EventHandler(DeleteUserTaskClicked); delButton.TooltipText = GettextCatalog.GetString("Delete Task"); TaskService.UserTasks.TasksChanged += DispatchService.GuiDispatch <TaskEventHandler> (UserTasksChanged); TaskService.UserTasks.TasksAdded += DispatchService.GuiDispatch <TaskEventHandler> (UserTasksChanged); TaskService.UserTasks.TasksRemoved += DispatchService.GuiDispatch <TaskEventHandler> (UserTasksChanged); if (IdeApp.Workspace.IsOpen) { solutionLoaded = true; } IdeApp.Workspace.FirstWorkspaceItemOpened += CombineOpened; IdeApp.Workspace.LastWorkspaceItemClosed += CombineClosed; PropertyService.PropertyChanged += DispatchService.GuiDispatch <EventHandler <PropertyChangedEventArgs> > (OnPropertyUpdated); ValidateButtons(); // Initialize with existing tags. UserTasksChanged(this, null); }
public void WriteGlobalLog(string message) { DispatchService.GuiDispatch(delegate { monitor.WriteGlobalLog(message); }); }
protected virtual void GuiSyncDispatch(MessageHandler handler) { DispatchService.GuiSyncDispatch(handler); }
public MainToolbar() { executionTargetsChanged = DispatchService.GuiDispatch(new EventHandler(HandleExecutionTargetsChanged)); IdeApp.Workspace.ActiveConfigurationChanged += (sender, e) => UpdateCombos(); IdeApp.Workspace.ConfigurationsChanged += (sender, e) => UpdateCombos(); IdeApp.Workspace.SolutionLoaded += (sender, e) => UpdateCombos(); IdeApp.Workspace.SolutionUnloaded += (sender, e) => UpdateCombos(); IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleCurrentSelectedSolutionChanged; WidgetFlags |= Gtk.WidgetFlags.AppPaintable; AddWidget(button); AddSpace(8); configurationCombo = new Gtk.ComboBox(); configurationCombo.Model = configurationStore; var ctx = new Gtk.CellRendererText(); configurationCombo.PackStart(ctx, true); configurationCombo.AddAttribute(ctx, "text", 0); configurationCombosBox = new HBox(false, 8); var configurationComboVBox = new VBox(); configurationComboVBox.PackStart(configurationCombo, true, false, 0); configurationCombosBox.PackStart(configurationComboVBox, false, false, 0); runtimeCombo = new Gtk.ComboBox(); runtimeCombo.Model = runtimeStore; ctx = new Gtk.CellRendererText(); if (Platform.IsWindows) { ctx.Ellipsize = Pango.EllipsizeMode.Middle; } runtimeCombo.PackStart(ctx, true); runtimeCombo.SetCellDataFunc(ctx, RuntimeRenderCell); runtimeCombo.RowSeparatorFunc = RuntimeIsSeparator; var runtimeComboVBox = new VBox(); runtimeComboVBox.PackStart(runtimeCombo, true, false, 0); configurationCombosBox.PackStart(runtimeComboVBox, false, false, 0); AddWidget(configurationCombosBox); buttonBarBox = new Alignment(0.5f, 0.5f, 0, 0); buttonBarBox.LeftPadding = (uint)7; buttonBarBox.Add(buttonBar); buttonBarBox.NoShowAll = true; AddWidget(buttonBarBox); AddSpace(24); statusArea = new StatusArea(); statusArea.ShowMessage(BrandingService.ApplicationName); var statusAreaAlign = new Alignment(0, 0, 1, 1); statusAreaAlign.Add(statusArea); contentBox.PackStart(statusAreaAlign, true, true, 0); AddSpace(24); statusAreaAlign.SizeAllocated += (object o, SizeAllocatedArgs args) => { Gtk.Widget toplevel = this.Toplevel; if (toplevel == null) { return; } var pixel_scale = GtkWorkarounds.GetPixelScale(); int windowWidth = toplevel.Allocation.Width; int center = windowWidth / 2; int left = Math.Max(center - (int)(300 * pixel_scale), args.Allocation.Left); int right = Math.Min(left + (int)(600 * pixel_scale), args.Allocation.Right); uint left_padding = (uint)(left - args.Allocation.Left); uint right_padding = (uint)(args.Allocation.Right - right); if (left_padding != statusAreaAlign.LeftPadding || right_padding != statusAreaAlign.RightPadding) { statusAreaAlign.SetPadding(0, 0, (uint)left_padding, (uint)right_padding); } }; matchEntry = new SearchEntry(); var searchFiles = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Files")); searchFiles.Activated += delegate { SetSearchCategory("files"); }; var searchTypes = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Types")); searchTypes.Activated += delegate { SetSearchCategory("type"); }; var searchMembers = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Members")); searchMembers.Activated += delegate { SetSearchCategory("member"); }; matchEntry.ForceFilterButtonVisible = true; matchEntry.Entry.FocusOutEvent += delegate { matchEntry.Entry.Text = ""; }; var cmd = IdeApp.CommandService.GetCommand(Commands.NavigateTo); cmd.KeyBindingChanged += delegate { UpdateSearchEntryLabel(); }; UpdateSearchEntryLabel(); matchEntry.Ready = true; matchEntry.Visible = true; matchEntry.IsCheckMenu = true; matchEntry.Entry.ModifyBase(StateType.Normal, Style.White); matchEntry.WidthRequest = 240; if (!Platform.IsMac && !Platform.IsWindows) { matchEntry.Entry.ModifyFont(Pango.FontDescription.FromString("Sans 9")); // TODO: VV: "Segoe UI 9" } matchEntry.RoundedShape = true; matchEntry.Entry.Changed += HandleSearchEntryChanged; matchEntry.Activated += (sender, e) => { var pattern = SearchPopupSearchPattern.ParsePattern(matchEntry.Entry.Text); if (pattern.Pattern == null && pattern.LineNumber > 0) { DestroyPopup(); var doc = IdeApp.Workbench.ActiveDocument; if (doc != null && doc.Editor != null) { doc.Select(); doc.Editor.Caret.Location = new Mono.TextEditor.DocumentLocation(pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1); doc.Editor.CenterToCaret(); doc.Editor.Parent.StartCaretPulseAnimation(); } return; } if (popup != null) { popup.OpenFile(); } }; matchEntry.Entry.KeyPressEvent += (o, args) => { if (args.Event.Key == Gdk.Key.Escape) { var doc = IdeApp.Workbench.ActiveDocument; if (doc != null) { DestroyPopup(); doc.Select(); } return; } if (popup != null) { args.RetVal = popup.ProcessKey(args.Event.Key, args.Event.State); } }; IdeApp.Workbench.RootWindow.WidgetEvent += delegate(object o, WidgetEventArgs args) { if (args.Event is Gdk.EventConfigure) { PositionPopup(); } }; SizeAllocated += delegate { PositionPopup(); }; BuildToolbar(); IdeApp.CommandService.RegisterCommandBar(buttonBar); AddinManager.ExtensionChanged += OnExtensionChanged; contentBox.PackStart(matchEntry, false, false, 0); var align = new Gtk.Alignment(0, 0, 1f, 1f); align.Show(); align.TopPadding = (uint)5; align.LeftPadding = (uint)9; align.RightPadding = (uint)18; align.BottomPadding = (uint)10; align.Add(contentBox); Add(align); SetDefaultSizes(-1, 21); configurationCombo.Changed += HandleConfigurationChanged; runtimeCombo.Changed += HandleRuntimeChanged; UpdateCombos(); button.Clicked += HandleStartButtonClicked; IdeApp.CommandService.RegisterCommandBar(this); IdeApp.CommandService.ActiveWidgetChanged += (sender, e) => { lastCommandTarget = new WeakReference(e.OldActiveWidget); }; this.ShowAll(); this.statusArea.statusIconBox.HideAll(); }