private void UpdateState(ComObjectFullEditable source, ComObjectConfigure target)
 {
     // target.Id = source.; // musi byt lockle pro edit - musí se vytvářet samo
     target.AreaOfMemory  = source.AreaOfMemory;
     target.DbNumber      = source.DbNumber;
     target.PeriodOfCheck = source.PeriodOfCheck;
     target.StartOffset   = source.StartOffset;
     target.WorldLen      = source.WorldLen;
 }
 private void CopyState(ComObjectConfigure source, ComObjectFullEditable target)
 {
     if (isEditMode)
     {
         target.AreaOfMemory  = source.AreaOfMemory;
         target.DbNumber      = source.DbNumber;
         target.PeriodOfCheck = source.PeriodOfCheck;
         target.StartOffset   = source.StartOffset;
         target.WorldLen      = source.WorldLen;
     }
 }
        public void SetComObject(ComObjectConfigure p_ComObject)
        {
            if (p_ComObject == null)
            {
                isEditMode  = false;
                p_ComObject = new ComObjectConfigure();
                PLCAll      =
                    new ObservableCollection <PLCConnectorModuleConfigure>(
                        PlcConnectorModuleRepository.Instance.PlcConnectorModulesList.Select(x => x.PlcModuleConfigure)
                        .ToList());
            }

            EdditingComObjectConfigure = p_ComObject;
            if (ComObject != null)
            {
                ComObject.ErrorsChanged -= RaiseCanExecuteChanged;
            }
            ComObject = new ComObjectFullEditable();
            ComObject.ErrorsChanged += RaiseCanExecuteChanged;
            CopyState(EdditingComObjectConfigure, ComObject);
        }