private void CheckLicense() { if (LicenseManager.Instance.HasLicenseExpired()) { LicensedVersion = LicenseManager.Instance.PromptUserForLicenseIfTrialHasExpired(); if (LicensedVersion) { GlobalSettings.Instance.IsLicenseValid = true; EnableSolutionBuilder(); MessageBox.Show("Your license has been verified. Please restart Visual Studio for the licensing changes to take effect", "Service Matrix - License Verified"); return; } GlobalSettings.Instance.IsLicenseValid = false; DisableSolutionBuilder(); if (!AsProduct().IsSerializing) // is creating { CustomSolutionBuilder.ShowNoSolutionState(); throw new Exception("Trial period for ServiceMatrix has Expired. A new NServiceBus solution cannot be created."); } } else { GlobalSettings.Instance.IsLicenseValid = true; EnableSolutionBuilder(); } }
partial void Initialize() { InfrastructureManager = new InfrastructureManager(this, ServiceProvider, PatternManager); if (currentApplication == null) { currentApplication = this; // Force initialization of NserviceBusVersion from file InitializeExtensionDependentData(); CustomSolutionBuilder.Initialize(ServiceProvider); PatternManager.ElementDeleting += (s, e) => { // Delete all related artifacts links var element = e.Value.As <IProductElement>(); element.RemoveArtifactLinks(UriService, Solution); // If it's a Component Link, remove all links into Endpoints (they're not artifact links) var componentLink = element.As <IAbstractComponentLink>(); if (componentLink != null && componentLink.ComponentReference.Value != null) { var endpoint = element.Parent.Parent.As <IAbstractEndpoint>(); componentLink.ComponentReference.Value.RemoveLinks(endpoint); } }; } // Set/Get static values currentApplication = this; NServiceBusVersion = nserviceBusVersion; ServiceControlEndpointPluginVersion = serviceControlEndpointPluginVersion; ExtensionPath = extensionPath; CheckLicense(); SetNuGetPackagesVersion(); SetOptionSettings(); SetPropagationHandlers(); SetDomainSpecifiLogging(); SetRemoveEmptyAddMenus(); SetF5Experience(); SetupAddNuGetFilesHandler(); }
private void DisableSolutionBuilder() { IsValidLicensed = false; CustomSolutionBuilder.DisableSolutionBuilder(); }
private void EnableSolutionBuilder() { IsValidLicensed = true; CustomSolutionBuilder.EnableSolutionBuilder(); }