public GateForm([NotNull] GateSettingsXml gateSettings, bool initiallyMaximized,
            [NotNull] CirceMediatorSessionManager mediatorSessionManager)
        {
            Guard.NotNull(gateSettings, nameof(gateSettings));
            Guard.NotNull(mediatorSessionManager, nameof(mediatorSessionManager));

            settings = gateSettings;
            this.initiallyMaximized = initiallyMaximized;
            sessionManager = new FreshNotNullableReference<CirceMediatorSessionManager>(mediatorSessionManager);
            sessionManager.Value.Devices[settings.DeviceAddressNotNull] = this;

            InitializeComponent();
            EnsureHandleCreated();
        }
        private void GateToolStripMenuItem_Click([CanBeNull] object sender, [NotNull] EventArgs e)
        {
            var settings = new GateSettingsXml
            {
                SignalStrength = settingsGenerator.GetSignalStrength(),
                BatteryStatus = settingsGenerator.GetBatteryStatus()
            };

            file.Configuration.GatesOrEmpty.Add(settings);
            CreateGateForm(settings);
        }