private void Write(ElementModel element)
        {
            string value = element.SetValue;

            byte[] data;
            element.SetValue = value;
            switch (element.ShowType)
            {
            case "WORD":
                data = ValueConverter.GetBytes(
                    (UInt16)(Int16.Parse(value)));
                break;

            case "UWORD":
                data = ValueConverter.GetBytes(
                    UInt16.Parse(value));
                break;

            case "BCD":
                data = ValueConverter.GetBytes(
                    ValueConverter.ToUINT16(
                        UInt16.Parse(value)));
                break;

            case "DWORD":
                data = ValueConverter.GetBytes(
                    (UInt32)(Int32.Parse(value)));
                break;

            case "UDWORD":
                data = ValueConverter.GetBytes(
                    UInt32.Parse(value));
                break;

            case "FLOAT":
                data = ValueConverter.GetBytes(
                    ValueConverter.FloatToUInt(
                        float.Parse(value)));
                break;

            default:
                data = new byte[0];
                break;
            }
            if (element.IsIntrasegment)
            {
                IntrasegmentWriteCommand command = new IntrasegmentWriteCommand(data, element);
                command.RefElement = element;
                _parent.Manager.Add(command);
            }
            else
            {
                GeneralWriteCommand command = new GeneralWriteCommand(data, element);
                command.RefElements_A.Add(element);
                _parent.Manager.Add(command);
            }
        }
 private void Write(ElementModel element, byte value)
 {
     if (element.IsIntrasegment)
     {
         IntrasegmentWriteCommand command = new IntrasegmentWriteCommand(new byte[] { value }, element);
         command.RefElement = element;
         _parent.Manager.Add(command);
     }
     else
     {
         GeneralWriteCommand command = new GeneralWriteCommand(new byte[] { value }, element);
         command.RefElements_A.Add(element);
         _parent.Manager.Add(command);
     }
 }