Ejemplo n.º 1
0
        public ITransaction BeginTransaction()
        {
            var context     = contextProvider.GetCurrentContext();
            var transaction = context.Database.BeginTransaction();

            return(new TransactionWrapper(transaction));
        }
Ejemplo n.º 2
0
        private void TextEditorEvents_LineChanged(TextPoint startPoint, TextPoint endPoint, int hint)
        {
            if (_currentEditEvent == null)
            {
                _currentEditEvent          = Create <EditEvent>();
                _currentEditEvent.Context2 = _contextProvider.GetCurrentContext(startPoint);
            }

            _currentEditEvent.NumberOfChanges += 1;
            // TODO subtract whitespaces from change size
            _currentEditEvent.SizeOfChanges += endPoint.AbsoluteCharOffset - startPoint.AbsoluteCharOffset;

            if (_currentEditEvent.TriggeredAt < _dateUtils.Now - InactivityPeriodToCompleteEditAction)
            {
                FireNow(_currentEditEvent);
                _currentEditEvent = null;
            }
        }
Ejemplo n.º 3
0
 protected BaseService(IContextProvider contextProvider, ILoggerFactory loggerFactory, IdentityDBContext context)
     : base(loggerFactory)
 {
     _session = contextProvider.GetCurrentContext();
     _context = context;
 }