public NetworkDatabaseSettings(NetworkDatabaseProcess process) { _process = process; _name = new TextBox(); _name.Bind( tb => tb.Text, _process, proc => proc.Name, DualBindingMode.TwoWay); _processId = new NumericUpDown(); _processId.Bind( nud => nud.Value, _process, proc => proc.ProcessId, DualBindingMode.TwoWay); _databasePath = new TextBox(); _databasePath.Bind( tb => tb.Text, _process, proc => proc.DatabasePath, DualBindingMode.TwoWay); this.AddRow(new Label() { Text = Constants.ProcessNameLabel }, _name); this.AddRow(new Label() { Text = Constants.ProcessIdLabel }, _processId); this.AddRow(); }
public EthernetPortSettings(EthernetPortProcess process) { _process = process; _name = new TextBox(); _name.Bind( tb => tb.Text, _process, proc => proc.Name, DualBindingMode.TwoWay); _processId = new NumericUpDown(); _processId.Bind( nud => nud.Value, _process, proc => proc.ProcessId, DualBindingMode.TwoWay); _deviceName = new ComboBox(); _deviceName.DataStore = LibPcapLiveDeviceList.Instance.Where(dev => dev.Interface != null); _deviceName.KeyBinding = new PropertyBinding<string>("Name"); _deviceName.TextBinding = new PropertyBinding<string>("Description"); _deviceName.SelectedValueChanged += _deviceNameChanged; this.BeginVertical(); this.AddRow(new Label() { Text = Constants.ProcessNameLabel }, _name); this.AddRow(new Label() { Text = Constants.ProcessIdLabel }, _processId); this.AddRow(new Label() { Text = Constants.DeviceNameLabel }, _deviceName); this.EndVertical(); this.AddRow(); }
public ForeignDevicePortSettings(ForeignDevicePortProcess process) { _process = process; _name = new TextBox(); _name.Bind( tb => tb.Text, _process, proc => proc.Name, DualBindingMode.TwoWay); _processId = new NumericUpDown(); _processId.Bind( nud => nud.Value, _process, proc => proc.ProcessId, DualBindingMode.TwoWay); _localHost = new TextBox(); _localHost.Bind( tb => tb.Text, _process, proc => proc.LocalHost, DualBindingMode.TwoWay); _localPort = new NumericUpDown(); _localPort.Bind( nud => nud.Value, _process, proc => proc.LocalPort, DualBindingMode.TwoWay); _bbmdHost = new TextBox(); _bbmdHost.Bind( tb => tb.Text, _process, proc => proc.BbmdHost, DualBindingMode.TwoWay); _bbmdPort = new NumericUpDown(); _bbmdPort.Bind( nud => nud.Value, _process, proc => proc.BbmdPort, DualBindingMode.TwoWay); this.BeginVertical(); this.AddRow(new Label() { Text = Constants.ProcessNameLabel }, _name); this.AddRow(new Label() { Text = Constants.ProcessIdLabel }, _processId); this.EndVertical(); this.BeginVertical(); this.AddRow(new Label() { Text = Constants.LocalHostLabel }, _localHost, new Label() { Text = Constants.LocalPortLabel }, _localPort); this.AddRow(new Label() { Text = Constants.BbmdHostLabel }, _bbmdHost, new Label() { Text = Constants.BbmdPortLabel }, _bbmdPort); this.EndVertical(); this.AddRow(); }
Control PenThicknessControl() { var control = new NumericUpDown { MinValue = 1, MaxValue = 10 }; control.Bind(c => c.Value, this, r => r.PenThickness); control.ValueChanged += Refresh; var layout = new DynamicLayout(Padding.Empty); layout.AddRow(new Label { Text = "Thickness Step:", VerticalAlign = VerticalAlign.Middle }, control); return layout; }
public RouterSettings(RouterProcess process) { _process = process; _name = new TextBox(); _name.Bind( tb => tb.Text, _process, proc => proc.Name, DualBindingMode.TwoWay); _processId = new NumericUpDown(); _processId.Bind( nud => nud.Value, _process, proc => proc.ProcessId, DualBindingMode.TwoWay); this.BeginVertical(); this.AddRow(new Label() { Text = Constants.ProcessNameLabel }, _name); this.AddRow(new Label() { Text = Constants.ProcessIdLabel }, _processId); this.EndVertical(); GridView gv = new GridView(); gv.DataStore = process.PortMappings; gv.Columns.Add(new GridColumn() { HeaderText = "Port Id", DataCell = new TextBoxCell("PortId"), Editable = true }); gv.Columns.Add(new GridColumn() { HeaderText = "Network Number", DataCell = new TextBoxCell("Network"), Editable = true }); this.BeginVertical(); this.AddRow(gv); this.EndVertical(); this.AddRow(); }
public PortManagerSettings(PortManagerProcess process) { _process = process; _name = new TextBox(); _name.Bind( tb => tb.Text, _process, proc => proc.Name, DualBindingMode.TwoWay); _processId = new NumericUpDown(); _processId.Bind( nud => nud.Value, _process, proc => proc.ProcessId, DualBindingMode.TwoWay); this.AddRow(new Label() { Text = Constants.ProcessNameLabel }, _name); this.AddRow(new Label() { Text = Constants.ProcessIdLabel }, _processId); this.AddRow(); }
Control CreateMinimumSizeControls() { var setMinimumSize = new CheckBox { Text = "MinimumSize" }; setMinimumSize.CheckedBinding.Bind(() => setInitialMinimumSize, v => { setInitialMinimumSize = v ?? false; if (v == true && child != null) child.MinimumSize = initialMinimumSize; }); var width = new NumericUpDown(); width.Bind(c => c.Enabled, setMinimumSize, c => c.Checked); width.ValueBinding.Bind(() => initialMinimumSize.Width, v => { initialMinimumSize.Width = (int)v; if (child != null) child.MinimumSize = initialMinimumSize; }); var height = new NumericUpDown(); height.Bind(c => c.Enabled, setMinimumSize, c => c.Checked); height.ValueBinding.Bind(() => initialMinimumSize.Height, v => initialMinimumSize.Height = (int)v); return new StackLayout { Orientation = Orientation.Horizontal, Items = { setMinimumSize, width, height } }; }
Control CreateClientSizeControls() { var setClientSize = new CheckBox { Text = "ClientSize" }; setClientSize.CheckedBinding.Bind(() => setInitialClientSize, v => setInitialClientSize = v ?? false); var left = new NumericUpDown(); left.Bind(c => c.Enabled, setClientSize, c => c.Checked); left.ValueBinding.Bind(() => initialClientSize.Width, v => initialClientSize.Width = (int)v); var top = new NumericUpDown(); top.Bind(c => c.Enabled, setClientSize, c => c.Checked); top.ValueBinding.Bind(() => initialClientSize.Height, v => initialClientSize.Height = (int)v); return new StackLayout { Orientation = Orientation.Horizontal, Items = { setClientSize, left, top } }; }
Control CreateInitialLocationControls() { var setLocationCheckBox = new CheckBox { Text = "Initial Location" }; setLocationCheckBox.CheckedBinding.Bind(() => setInitialLocation, v => setInitialLocation = v ?? false); var left = new NumericUpDown(); left.Bind(c => c.Enabled, setLocationCheckBox, c => c.Checked); left.ValueBinding.Bind(() => initialLocation.X, v => initialLocation.X = (int)v); var top = new NumericUpDown(); top.Bind(c => c.Enabled, setLocationCheckBox, c => c.Checked); top.ValueBinding.Bind(() => initialLocation.Y, v => initialLocation.Y = (int)v); return new StackLayout { Orientation = Orientation.Horizontal, Items = { setLocationCheckBox, left, top } }; }
Control Copies() { var control = new NumericUpDown { MinValue = 1 }; control.Bind(r => r.Value, (PrintSettings s) => s.Copies, defaultControlValue: 1); return control; }
Control OffsetYControl () { var control = new NumericUpDown(); control.Bind (c => c.Value, this, c => c.OffsetY); control.ValueChanged += Refresh; return control; }
Control RotationControl() { var control = new NumericUpDown { MinValue = 0, MaxValue = 360 }; control.Bind(c => c.Value, this, c => c.Rotation); control.ValueChanged += Refresh; return control; }
Control ScaleYControl() { var control = new NumericUpDown { MinValue = 1, MaxValue = 1000 }; control.Bind(c => c.Value, this, c => c.ScaleY); control.ValueChanged += Refresh; return control; }