internal static void Initialize() { if (mInitialized) { return; } ConfigureLogging(); RegisterExceptionHandlers(); InitLocalization(); ThreadWaiter.Initialize(new UnityThreadWaiterBuilder()); ServicePointConfigurator.ConfigureServicePoint(); CertificateUi.RegisterHandler(new ChannelCertificateUiImpl()); DisableFsWatcherIfNeeded(); EditionManager.Get().DisableCapability( EnumEditionCapabilities.Extensions); ClientHandlers.Register(); PlasticGuiConfig.SetConfigFile( PlasticGuiConfig.UNITY_GUI_CONFIG_FILE); mInitialized = true; }
internal static void Run( bool isGluonMode, ProgressControlsForViews progressControls) { ((IProgressControls)progressControls).ShowProgress(string.Empty); IThreadWaiter waiter = ThreadWaiter.GetWaiter(); waiter.Execute( /*threadOperationDelegate*/ delegate { Process plasticProcess = LaunchTool.OpenConfigurationForMode(isGluonMode); if (plasticProcess != null) { plasticProcess.WaitForExit(); } }, /*afterOperationDelegate*/ delegate { ((IProgressControls)progressControls).HideProgress(); ClientConfig.Reset(); CmConnection.Reset(); ClientHandlers.Register(); if (waiter.Exception == null) { return; } ((IProgressControls)progressControls).ShowError( waiter.Exception.Message); }); }
internal void OnUserClosedConfigurationWindow() { ((IProgressControls)mConfigureProgress).HideProgress(); ClientConfig.Reset(); CmConnection.Reset(); ClientHandlers.Register(); }
protected override void Context() { _handler = Resolve<ClientHandlers>(); _clientRepository = Resolve<IClientRepository>(); _tenantContext = Resolve<ITenantContext>(); _tenantContext.SetTenantId(_tenant); }
protected override void Context() { _handler = Resolve<ClientHandlers>(); _clientRepository = Resolve<IClientRepository>(); _tenantContext = Resolve<ITenantContext>(); _tenantContext.SetTenantId(_tenant); _handler.AsDynamic().Handle(new ClientCreated(_id, "John Doe BVBA", DateTime.UtcNow) { Version = 1 }); }
internal static void InitializeIfNeeded() { if (sIsInitialized) { return; } sIsInitialized = true; PlasticAPI = new PlasticAPI(); PlasticWebRestApi = new PlasticWebRestApi(); ConfigureLogging(); GuiMessage.Initialize(new UnityPlasticGuiMessage()); RegisterExceptionHandlers(); InitLocalization(); ThreadWaiter.Initialize(new UnityThreadWaiterBuilder()); ServicePointConfigurator.ConfigureServicePoint(); CertificateUi.RegisterHandler(new ChannelCertificateUiImpl()); SetupFsWatcher(); EditionManager.Get().DisableCapability( EnumEditionCapabilities.Extensions); ClientHandlers.Register(); PlasticGuiConfig.SetConfigFile( PlasticGuiConfig.UNITY_GUI_CONFIG_FILE); sEventSenderScheduler = EventTracking.Configure( PlasticApp.PlasticWebRestApi, AssetsPath.IsRunningAsUPMPackage() ? ApplicationIdentifier.UnityPackage : ApplicationIdentifier.UnityAssetStorePlugin, IdentifyEventPlatform.Get()); if (sEventSenderScheduler != null) { sPingEventLoop = new PingEventLoop(); sPingEventLoop.Start(); sPingEventLoop.SetUnityVersion(Application.unityVersion); CollabPlugin.GetVersion(pluginVersion => sPingEventLoop.SetPluginVersion(pluginVersion)); } PlasticMethodExceptionHandling.InitializeAskCredentialsUi( new CredentialsUiImpl()); ClientEncryptionServiceProvider.SetEncryptionPasswordProvider( new MissingEncryptionPasswordPromptHandler()); }
protected override void Context() { _clientHandler = Resolve<ClientHandlers>(); _projectHandler = Resolve<ProjectHandlers>(); _projectRepository = Resolve<IProjectRepository>(); _tenantContext = Resolve<ITenantContext>(); _tenantContext.SetTenantId(_tenant); _clientHandler.AsDynamic().Handle(new ClientCreated(_clientId, "John Doe BVBA", DateTime.UtcNow) { Version = 1 }); _projectHandler.AsDynamic().Handle(new ProjectCreated(_projectId, "Project 1", "A test project", _clientId, DateTime.UtcNow) { Version = 1 }); }
// These two (ClientHandlers and ThreadWatier) need to be reinitialized if they have not been // or else an error will be thrown and the Plastic context menu will not show up internal static void RegisterClientHandlersIfNeeded() { if (sIsInitialized) { return; } ClientHandlers.Register(); ThreadWaiter.Initialize(new UnityThreadWaiterBuilder()); sIsInitialized = true; }
public Client(DirectoryInfo cookieDirectory = null) { this.Handlers = new ClientHandlers(App.Instance, this); this.CookieDirectory = cookieDirectory; this.CreateBrowser(); // this.Browser will be set by LifeSpanHandler.OnAfterCreated(), which will then also signal BrowserCreatedWaiter this.BrowserCreatedWaiter.WaitOne(); }
protected override void Context() { _clientHandler = Resolve<ClientHandlers>(); _projectHandler = Resolve<ProjectHandlers>(); _projectRepository = Resolve<IProjectRepository>(); _tenantContext = Resolve<ITenantContext>(); _tenantContext.SetTenantId(_tenant); _clientHandler.AsDynamic().Handle(new ClientCreated(_clientId, "John Doe BVBA", DateTime.UtcNow) { Version = 1 }); _projectHandler.AsDynamic().Handle(new ProjectCreated(_projectId, "Project 1", "A test project", _clientId, DateTime.UtcNow) { Version = 1 }); _projectHandler.AsDynamic().Handle(new ProjectTasksChanged(_projectId, new Dtos.Task[] { new Dtos.Task{ Name = "Initial task", Rate = 50M }, }) { Version = 2 }); }
public Client(Client @this) { this.Handlers = new ClientHandlers(App.Instance, this); this.CookieDirectory = @this.CookieDirectory; this.Width = @this.WidthPriv; this.Height = @this.HeightPriv; this.CreateBrowser(); // this.Browser will be set by LifeSpanHandler.OnAfterCreated(), which will then also signal BrowserCreatedWaiter this.BrowserCreatedWaiter.WaitOne(); }
void OnEnable() { if (mException != null) { return; } GuiMessage.Initialize(new UnityPlasticGuiMessage(this)); ConfigureLogging(); RegisterExceptionHandlers(); RegisterApplicationFocusHandlers(this); InitLocalization(); ThreadWaiter.Initialize(new UnityThreadWaiterBuilder()); ServicePointConfigurator.ConfigureServicePoint(); CertificateUi.RegisterHandler(new ChannelCertificateUiImpl()); CredentialsUIRegistrar.RegisterCredentialsUI( new CredentialsUiImpl(this)); ClientEncryptionServiceProvider.SetEncryptionPasswordProvider( new MissingEncryptionPasswordPromptHandler(this)); DisableFsWatcherIfNeeded(); EditionManager.Get().DisableCapability( EnumEditionCapabilities.Extensions); mPlasticAPI = new PlasticAPI(); ClientHandlers.Register(); PlasticGuiConfig.SetConfigFile(PLASTIC_GUI_CONFIG_FILE); mPingEventLoop = new PingEventLoop(); mEventSenderRestApi = new SimpleEventSenderRestApi( PlasticWebApiUris.GetBaseUri()); mEventSenderScheduler = EventTracking.Configure( mEventSenderRestApi, ApplicationIdentifier.UnityPackage, IdentifyEventPlatform.Get()); if (mEventSenderScheduler != null) { mPingEventLoop.Start(); } InitializePlastic(); }
protected override void Context() { _clientHandler = Resolve<ClientHandlers>(); _projectHandler = Resolve<ProjectHandlers>(); _timeregistrationHandler = Resolve<TimeRegistrationHandlers>(); _timeregistrationRepository = Resolve<ITimeRegistrationRepository>(); _tenantContext = Resolve<ITenantContext>(); _tenantContext.SetTenantId(_tenant); _clientHandler.AsDynamic().Handle(new ClientCreated(_clientId, "John Doe BVBA", DateTime.UtcNow) { Version = 1 }); _projectHandler.AsDynamic().Handle(new ProjectCreated(_projectId, "Project 1", "A test project", _clientId, DateTime.UtcNow) { Version = 1 }); _timeregistrationHandler.AsDynamic().Handle(new TimeRegistrationCreated(_timeregistrationId, _clientId, _projectId, "Development", 50M, "Doing some work", Date.Parse("2012-01-30"), Time.Parse("12:00"), Time.Parse("14:00"), DateTime.UtcNow) { Version = 1 }); }