public ApplicationContext(string[] args) { var nonFSBLArgs = GetNonFinsembleArgs(args); string name = nonFSBLArgs.First(); Form form = CreateForm(name); var fsbl = new Finsemble(args.ToArray(), form); fsbl.Connected += (s, e) => { Debug.WriteLine("FSBL connected"); IIntegratable fsblForm = form as IIntegratable; if (fsblForm != null) { fsblForm.SetFinsemble(fsbl); } }; // Dispose of Finsemble object when window is closed. form.Closed += (s, e) => { Debug.WriteLine("disposing window from app.xaml"); fsbl.Dispose(); Debug.WriteLine("dispose completed"); }; fsbl.Connect(); this.MainForm = form; this.IsSingleInstance = true; }
/// <summary> /// The OnStartupNextInstance. /// </summary> /// <param name="eventArgs">The eventArgs<see cref="StartupNextInstanceEventArgs"/>.</param> protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { var nonFSBLArgs = GetNonFinsembleArgs(eventArgs.CommandLine); string name = nonFSBLArgs.First(); Form form = CreateForm(name); var fsbl = new Finsemble(eventArgs.CommandLine.ToArray(), form); fsbl.Connected += (s, e) => { Debug.WriteLine("FSBL connected"); IIntegratable fsblForm = form as IIntegratable; if (fsblForm != null) { fsblForm.SetFinsemble(fsbl); } }; // Dispose of Finsemble object when window is closed. form.Closed += (s, e) => { Debug.WriteLine("disposing window from app.xaml"); fsbl.Dispose(); Debug.WriteLine("dispose completed"); }; fsbl.Connect(); form.Show(); }
public ProjectIntegrator(ITrigger trigger, IIntegratable integratable, IProject project) { _trigger = trigger; _project = project; _integratable = integratable; this.resultManager = project.IntegrationResultManager; }
public ApplicationContext(string[] args) { var nonFSBLArgs = GetNonFinsembleArgs(args); string name = nonFSBLArgs.FirstOrDefault(); Form form = CreateForm(name); if (form == null) { MessageBox.Show($"\"{name}\" unknown name of form!"); return; } var fsbl = new Finsemble(args.ToArray(), form); fsbl.Connected += (s, e) => { Debug.WriteLine("FSBL connected"); IIntegratable fsblForm = form as IIntegratable; if (fsblForm != null) { fsblForm.SetFinsemble(fsbl); } }; // Dispose of Finsemble object when window is closed. form.Closed += (s, e) => { Debug.WriteLine("disposing window from app.xaml"); fsbl.Dispose(); Debug.WriteLine("dispose completed"); }; fsbl.Connect("WinformMultiWindowExample", JWK); this.MainForm = form; this.IsSingleInstance = true; }
/// <summary> /// Launches a Finsemble aware window with the passed arguments. /// </summary> /// <param name="args">The arguments passed to the process.</param> /// <returns>Always true?</returns> private static bool LaunchWindow(IList <string> args) { #if DEBUG Debugger.Launch(); #endif if (!args.Any()) { // Invalid number of arguments return(true); } var nonFSBLArgs = GetNonFinsembleArgs(args); if ((nonFSBLArgs == null) || !nonFSBLArgs.Any()) { // no non-finsemble arguments. Cannot launch window. return(true); } string name = nonFSBLArgs.First(); // handle command line arguments of second instance Window window = null; Current.Dispatcher.Invoke(() => { window = CreateWindow(name); }); if (window == null) { Debug.Print($"Could not create window: {name}"); } else { // Register with Finsemble //Ensure that your window has been created (so that its window handle exists) before connecting to Finsemble. var fsbl = new Finsemble(args.ToArray(), window); fsbl.Connected += (s, e) => { IIntegratable fsblWin = window as IIntegratable; if (fsblWin == null) { Debug.Print($"The window \"{name}\" is not a window that can be integrated into Finsemble."); } else { fsblWin.SetFinsemble(fsbl); } Current.Dispatcher.Invoke(window.Show); }; // Dispose of Finsemble object when window is closed. window.Closed += (s, e) => { Debug.WriteLine("disposing window from app.xaml"); fsbl.Dispose(); Debug.WriteLine("dispose completed"); }; fsbl.Connect("MultiWindowExample", JWK); } return(true); }
public Project(IIntegratable integratable) : this() { this.integratable = integratable; }
public Project() { _IntegrationResultManager = new IntegrationResultManager(this); integratable = new IntegrationRunner(_IntegrationResultManager, this, quietPeriod, this); }
/// <summary> /// Initializes a new instance of the <see cref="Project"/> class. /// </summary> /// <param name="integratable">The integratable.</param> public Project(IIntegratable integratable) : this() { this.integratable = integratable; }
/// <summary> /// Initializes a new instance of the <see cref="Project"/> class. /// </summary> public Project() { integrationResultManager = new IntegrationResultManager(this); integratable = new IntegrationRunner(integrationResultManager, this, quietPeriod); this.PrebuildTasks = new ITask[0]; this.CryptoFunctions = new DefaultCryptoFunctions(); // Generates the initial snapshot currentProjectStatus = new ProjectStatusSnapshot(); PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { switch (e.PropertyName) { case "Name": lock (currentProjectStatus) { currentProjectStatus.Name = Name; } break; case "Description": lock (currentProjectStatus) { currentProjectStatus.Description = Description; } break; } }; }