コード例 #1
0
        public void InitializeViewModel(ContactModel contactModel = null)
        {
            _serviceDTO         = GetService();
            _cloneService       = new ContactCloneService();
            _serviceLocator     = new ServiceLocator();
            SaveCommand         = new RelayCommand <IClosable>(obj => { Save(obj); }, (uu) => HasChanges() && !Contact.HasErrors);
            CloseWindowCommand  = new RelayCommand <IClosable>(this.CloseWindow);
            AddNumberCommand    = new UICommand(obj => AddNumber(), cex => CanAddNumber());
            EditNumberCommand   = new UICommand(obj => EditNumber(), cex => CanEditNumber());
            DeleteNumberCommand = new UICommand(obj => DelNumber(), cex => CanDelNumber());
            AddEMailCommand     = new UICommand(obj => AddEMail(), cex => CanAddEMail());
            EditEMailCommand    = new UICommand(obj => EditEMail(), cex => CanEditEMail());
            DeleteEMailCommand  = new UICommand(obj => DelEMail(), cex => CanDelEMail());

            Contact = contactModel != null?CloneContact(contactModel) : new ContactModel();

            InitContact();
        }
コード例 #2
0
ファイル: EasyDb.cs プロジェクト: romagny13/EasyDb
        public EasyDb(
            IMappingContainer mappingContainer,
            IDefaultModelFactory defaultModelFactory,
            IDefaultSelectionAllCommandFactory defaultSelectionAllCommandFactory,
            IDefaultSelectionOneCommandFactory defaultSelectionOneCommandFactory,
            IDefaultInsertCommandFactory defaultInsertCommandFactory,
            IDefaultUpdateCommandFactory defaultUpdateCommandFactory,
            IDefaultDeleteCommandFactory defaultDeleteCommandFactory,
            IDefaultCountCommandFactory defaultCountCommandFactory,
            IPendingOperationManager pendingOperationManager,
            ICloneService cloneService,
            IInterceptionManager interceptionManager)
        {
            this.HandleExecutionExceptions = true;

            this.mappingContainer = mappingContainer;
            this.mappingContainer.SetDb(this);

            this.cloneService            = cloneService;
            this.pendingOperationManager = pendingOperationManager;
            this.interceptionManager     = interceptionManager;
            this.defaultModelFactory     = defaultModelFactory;

            this.defaultSelectionAllCommandFactory = defaultSelectionAllCommandFactory;
            this.defaultSelectionAllCommandFactory.SetDb(this);

            this.defaultSelectionOneCommandFactory = defaultSelectionOneCommandFactory;
            this.defaultSelectionOneCommandFactory.SetDb(this);

            this.defaultInsertCommandFactory = defaultInsertCommandFactory;
            this.defaultInsertCommandFactory.SetDb(this);

            this.defaultUpdateCommandFactory = defaultUpdateCommandFactory;
            this.defaultUpdateCommandFactory.SetDb(this);

            this.defaultDeleteCommandFactory = defaultDeleteCommandFactory;
            this.defaultDeleteCommandFactory.SetDb(this);

            this.defaultCountCommandFactory = defaultCountCommandFactory;
            this.defaultCountCommandFactory.SetDb(this);
        }
コード例 #3
0
 public ContactCloneService()
 {
     _cloneServicePhoneNambers = new PhoneNumberCloneService();
     _cloneServiceEMails       = new EMailCloneService();
 }