Beispiel #1
0
        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();
                    }
                }
            }
        }
Beispiel #2
0
        public IDataItem        createByForm(IConnection aConnection, IWin32Window aOwner)
        {
            var lConnection = (Connection)aConnection;
            var lItem       = new DataItem();

            using (var lSetupForm = new ItemSetupForm(lConnection, lItem))
            {
                if (lSetupForm.ShowDialog(aOwner) == DialogResult.OK)
                {
                    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);
                }
                else
                {
                    lItem = null;
                }
            }

            return(lItem);
        }