public IDataItem createByForm(IConnection aConnection, IWin32Window aOwner) { Connection lConnection = (Connection)aConnection; DataItem lItem = new DataItem(); using (var lSetupForm = new ItemSetupForm(lConnection, lItem)) { if (lSetupForm.ShowDialog(aOwner) == DialogResult.OK) { lItem.mMemoryType = lSetupForm.MemoryType; lItem.DB = lSetupForm.DB; lItem.Byte = lSetupForm.Byte; lItem.Bit = lSetupForm.Bit; lItem.DataType = lSetupForm.DataType; lItem.FloatingP = lSetupForm.FloatingP; lItem.Signed = lSetupForm.Signed; lItem.Length = lSetupForm.Length; lConnection.addItem(lItem); } else { lItem = null; } } return lItem; }
public void setupByForm(IDataItem aDataItem, IConnection aConnection, IWin32Window aOwner) { var lConnection = (Connection)aConnection; var lItem = (DataItem)aDataItem; using (var lSetupForm = new ItemSetupForm(lConnection, lItem)) { if (lSetupForm.ShowDialog(aOwner) == DialogResult.OK) { lConnection.removeItem(lItem); lConnection.waitCycleEnd(); lItem.mMemoryType = lSetupForm.MemoryType; lItem.DataType = lSetupForm.DataType; lItem.DB = lSetupForm.DB; lItem.Byte = lSetupForm.Byte; lItem.Bit = lSetupForm.Bit; lItem.FloatingP = lSetupForm.FloatingP; lItem.Signed = lSetupForm.Signed; lItem.Length = lSetupForm.Length; lConnection.addItem(lItem); lConnection.waitCycleEnd(); lItem.raisePropertiesChanged(); if (lConnection.Connected && lItem.Access.HasFlag(EAccess.READ)) { lItem.raiseValueChanged(); } } } }
public IDataItem createByForm(IConnection aConnection, IWin32Window aOwner) { Connection lConnection = (Connection)aConnection; DataItem lItem = new DataItem(); using (var lSetupForm = new ItemSetupForm(lConnection, lItem)) { if (lSetupForm.ShowDialog(aOwner) == DialogResult.OK) { lItem.mMemoryType = lSetupForm.MemoryType; lItem.DB = lSetupForm.DB; lItem.Byte = lSetupForm.Byte; lItem.Bit = lSetupForm.Bit; lItem.DataType = lSetupForm.DataType; lItem.FloatingP = lSetupForm.FloatingP; lItem.Signed = lSetupForm.Signed; lItem.Length = lSetupForm.Length; lConnection.addItem(lItem); } else { lItem = null; } } return(lItem); }