public DisplayForm([NotNull] DisplaySettingsXml displaySettings, bool initiallyMaximized, [NotNull] CirceMediatorSessionManager mediatorSessionManager) { Guard.NotNull(displaySettings, nameof(displaySettings)); Guard.NotNull(mediatorSessionManager, nameof(mediatorSessionManager)); settings = displaySettings; this.initiallyMaximized = initiallyMaximized; sessionManager = new FreshNotNullableReference<CirceMediatorSessionManager>(mediatorSessionManager); sessionManager.Value.Devices[settings.DeviceAddressNotNull] = this; InitializeComponent(); EnsureHandleCreated(); operationDispatcher = VisualizeOperationDispatcher.CreateFor(displayStatus); }
private void DisplayToolStripMenuItem_Click([CanBeNull] object sender, [NotNull] EventArgs e) { var settings = new DisplaySettingsXml { SignalStrength = settingsGenerator.GetSignalStrength(), BatteryStatus = settingsGenerator.GetBatteryStatus() }; file.Configuration.DisplaysOrEmpty.Add(settings); CreateDisplayForm(settings); }