Exemplo n.º 1
0
        public void BeginTransaction()
        {
            lock (Dblock) {
                if (_databasesInTransaction.ContainsKey(_database.ConnectionString))
                {
                    throw new FlaException("double entry for " + _database.ConnectionString);
                }

                _databasesInTransaction.Add(_database.ConnectionString, AutomationUtili.GetCallingMethodAndClass());
                _database.BeginTransaction();
                _isInTransaction[DBFilename]    = true;
                _transactionSetters[DBFilename] = AutomationUtili.GetCallingMethodAndClass();
            }
        }
Exemplo n.º 2
0
        public Thread MakeThreadAndStart([NotNull] ThreadStart start, [NotNull] string name, bool isStaThread = false)
        {
            var t = new Thread(start);

            t.Name = AutomationUtili.GetCallingMethodAndClass() + " - " + name;
            if (isStaThread)
            {
                t.SetApartmentState(ApartmentState.STA);
            }

            lock (ThreadList) {
                ThreadList.Add(t);
            }

            t.Start();
            return(t);
        }