public object Clone() { ComPortConfiguration cp = new ComPortConfiguration();// { Name = string.Format("{0} (clone)", this.Name)}; cp.Name = this.Name + " (clone)"; cp.PortName = this.PortName; cp.StopBits = this.StopBits; cp.DataBits = this.DataBits; cp.Parity = this.Parity; cp.BaudRate = this.BaudRate; cp.Timeouts = this.Timeouts; cp.ReadBuffer = this.ReadBuffer; cp.DeviceCollection = this.DeviceCollection; // clone? return cp; }
public void Delete(ComPortConfiguration pc) { _storedPortConfigurations.Remove(pc); Serialize(); }
public ComPortConfiguration NewPortConfiguration() { ComPortConfiguration cp = new ComPortConfiguration(); Configurations.Add(cp); return cp; }
public void RemovePortConfiguration(ComPortConfiguration item) { if (Configurations.Contains(item)) { Configurations.Remove(item); } }
public ComPortConfiguration ClonePortConfiguration(ComPortConfiguration cp) { if (cp != null) { ComPortConfiguration newcp = (ComPortConfiguration)cp.Clone(); Configurations.Add(newcp); return newcp; } return null; }