Example #1
0
        public bool Run(string imageFullFileName)
        {
            using (Done = new ManualResetEventSlim(false))
            {
                Task.Factory.StartNew((o) =>
                {
                    Tuple <MainFormHelper, string> ev = (Tuple <MainFormHelper, string>)o;
                    try
                    {
                        var form   = new MatchForm();
                        form.Key   = ev.Item1.Key;
                        form.Image = new Image <Bgr, byte>(ev.Item2);
                        Application.Run(form);
                    }
                    finally
                    {
                        ev.Item1.Done.Set();
                    }
                }, new Tuple <MainFormHelper, string>(this, imageFullFileName), TaskCreationOptions.LongRunning);

                Done.Wait();
            }

            DomainTable table = new DomainTable();

            return(table.GetValue <bool>(Key.ToString(), false));
        }
Example #2
0
 public void Save(DomainView viewTable)
 {
     if (viewTable.Id == null)
     {
         var domainTable = new DomainTable();
         Mapper.Map(viewTable, domainTable);
         SaveDomain(domainTable);
     }
     else
     {
         var domainTable = Find(viewTable.Id);
         Mapper.Map(viewTable, domainTable);
         SaveDomain(domainTable);
     }
 }
Example #3
0
        public async Task Create(Domain.Domains.Domain domain, CancellationToken cancellationToken)
        {
            var context = await _ddpContextProvider.Get();

            var domainTable = new DomainTable
            {
                DomainId = domain.DomainId,
                Name     = domain.Name
            };

            await context.DomainTables.AddAsync(domainTable, cancellationToken);

            await _eventStore.StoreEventsFor(domain, domain.DomainId, cancellationToken);

            await _domainEventDispatcher.QueueEvents(domain.GetMutatingEvents());
        }
Example #4
0
        public void SaveDomain(DomainTable domainTable, string currentUserName = "")
        {
            string          localUserName = getCurrentUserName(currentUserName);
            ApplicationUser user          = _AccountService.FirstOrDefault(x => x.UserName == localUserName);

            if (domainTable.Id == Guid.Empty)
            {
                domainTable.Id                        = Guid.NewGuid();
                domainTable.CreatedDate               = DateTime.UtcNow;
                domainTable.ModifiedDate              = domainTable.CreatedDate;
                domainTable.ApplicationUserCreatedId  = user.Id;
                domainTable.ApplicationUserModifiedId = user.Id;
                repo.Add(domainTable);
            }
            else
            {
                domainTable.ModifiedDate = DateTime.UtcNow;
                domainTable.ApplicationUserModifiedId = user.Id;
                repo.Update(domainTable);
            }
            _uow.Save();
        }