private void BijwerkenMRU(string bestandsnaam)
 {
     System.Collections.Specialized.StringCollection mrulijst = new
                                                                System.Collections.Specialized.StringCollection();
     if (WindowMetRibbonControl.Properties.Settings.Default.mru != null)
     {
         mrulijst = WindowMetRibbonControl.Properties.Settings.Default.mru;
         int positie = mrulijst.IndexOf(bestandsnaam);
         if (positie >= 0)
         {
             mrulijst.RemoveAt(positie);
         }
         else
         {
             if (mrulijst.Count >= 6)
             {
                 mrulijst.RemoveAt(5);
             }
         }
     }
     mrulijst.Insert(0, bestandsnaam);
     WindowMetRibbonControl.Properties.Settings.Default.mru = mrulijst;
     WindowMetRibbonControl.Properties.Settings.Default.Save();
     LeesMRU();
 }
        //---------------------------------------------------------------------
        private bool WaitForReply()
        {
            long start = System.DateTime.UtcNow.Ticks;

            while ((((System.DateTime.UtcNow.Ticks - start) / TimeSpan.TicksPerMillisecond) < ServerTimeout))
            {
                if ((Lines_.Count > 0))
                {
                    string s = null;
                    s = Lines_[0];
                    Lines_.RemoveAt(0);
                    if ((!string.IsNullOrEmpty(ReplyText)))
                    {
                        ReplyText += "\n";
                    }
                    ReplyText += s.Substring(4);
                    if ((s.Substring(3, 1) == " "))
                    {
                        ReplyCode = s.Substring(0, 3);
                        //TraceText("T", "SMTP_Client_SocketHandler::WaitForReply", "Server says : " & ReplyCode & " " & ReplyText)
                        return(true);
                    }
                }
            }
            //TraceText("W", "SMTP_Client_SocketHandler::WaitForReply", "Server timed out.")
            return(false);
        }
Beispiel #3
0
        private void MenuItem_Open_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new Microsoft.Win32.OpenFileDialog();

            dialog.DefaultExt = ".txt";
            dialog.Filter     = "TXT Files (*.txt)|*.txt";

            bool?result = dialog.ShowDialog();

            if (result == true)
            {
                filePath = dialog.FileName;
                LoadToTextBox(filePath);
                if (propertiesLastFile.Count >= 5)
                {
                    propertiesLastFile.RemoveAt(4);
                }
                if (propertiesLastFile.Contains(filePath))
                {
                    propertiesLastFile.Remove(filePath);
                }
                propertiesLastFile.Insert(0, filePath);
                Properties.Settings.Default.Save();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Найти преобразование
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        static private bool FoundTransform(string from, string to)
        {
            bool emptyStack;

            lock (_lockConst)
            {
                emptyStack = _stack == null;
                if (emptyStack)
                {
                    _stack = new System.Collections.Specialized.StringCollection();
                }
            }

            bool res = false;

            if (_canConvertTo.ContainsKey(from))
            {
                System.Collections.Specialized.StringCollection sl = (System.Collections.Specialized.StringCollection)_canConvertTo[from];
                if (sl.Contains(to))
                {
                    res = true;
                }
                else
                {
                    for (int i = 0; i < sl.Count; i++)
                    {
                        string k = sl[i];
                        if (!_stack.Contains(k))
                        {
                            lock (_lockConst)
                            {
                                if (!_stack.Contains(k))
                                {
                                    _stack.Add(k);
                                    res = FoundTransform(k, to);
                                    _stack.RemoveAt(_stack.Count - 1);
                                    if (res)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            // else
            //    res = false;
            lock (_lockConst)
            {
                if (emptyStack)
                {
                    _stack = null;
                }
            }

            return(res);
        }
Beispiel #5
0
 private void DeleteButtonClick(object sender, EventArgs e)
 {
     if (mainListBox.SelectedIndex == -1)
     {
         return;
     }
     collection.RemoveAt(mainListBox.SelectedIndex);
     mainListBox.Items.RemoveAt(mainListBox.SelectedIndex);
 }
Beispiel #6
0
 private void btnBack_Click(object sender, System.EventArgs e)
 {
     if (folderCol.Count > 1)
     {
         PaintListView(folderCol[folderCol.Count - 2].ToString());
         folderCol.RemoveAt(folderCol.Count - 1);
     }
     else
     {
         PaintListView(folderCol[0].ToString());
     }
 }
Beispiel #7
0
 private void btnAtras_Click(object sender, EventArgs e)
 {
     if (carpetacol.Count > 1)
     {
         DibujarListView(carpetacol[carpetacol.Count - 2].ToString());
         carpetacol.RemoveAt(carpetacol.Count - 1);
     }
     else
     {
         DibujarListView(carpetacol[0].ToString());
     }
 }
Beispiel #8
0
 private void btnNazad_Click(object sender, EventArgs e)
 {
     if (folderCol.Count > 1)
     {
         FilujListView(folderCol[folderCol.Count - 2].ToString());
         folderCol.RemoveAt(folderCol.Count - 1);
     }
     else
     {
         FilujListView(folderCol[0].ToString());
     }
 }
Beispiel #9
0
 private void bt_back_Click(object sender, EventArgs e)
 {//返回上一层
     try
     {
         if (CurPath.Count > 1)                                       //如果当前所在位置不是根目录
         {
             string FullName = CurPath[CurPath.Count - 2].ToString(); //获得上一级目录的路径
             tb_currentpath.Text = FullName;                          //更新路径显示
             FillFilesView(FullName);                                 //更新ListView
             CurPath.RemoveAt(CurPath.Count - 1);                     //从CurPath中删除当前目录
         }
         else
         {
             if (CurPath.Count == 1)                  //如果在根目录
             {
                 CurPath.RemoveAt(CurPath.Count - 1); //从CurPath中删除当前目录
                 tb_currentpath.Text = "我的电脑";        //更新路径显示
                 lv_allinfo.Clear();
                 lv_allinfo.View = View.Details;
                 lv_allinfo.Columns.Add("本地磁盘", lv_allinfo.Width / 3, HorizontalAlignment.Left);
                 string[] Drv = Directory.GetLogicalDrives();        //获取当前磁盘列表并存入数组
                 for (int i = 0; i < Drv.Length; i++)
                 {
                     ListViewItem lvi = new ListViewItem();
                     lvi.Text       = "驱动器" + Drv[i];
                     lvi.ImageIndex = 3;
                     lvi.Tag        = Drv[i];
                     lv_allinfo.Items.Add(lvi);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #10
0
        private void AddNewRecentWorkItems(string subject)
        {
            Helpers.DebugInfo("Updating recent work items: " + subject);

            _RecentWorkItems.Remove(subject);
            _RecentWorkItems.Insert(0, subject);

            while (_RecentWorkItems.Count > 10)
            {
                _RecentWorkItems.RemoveAt(_RecentWorkItems.Count - 1);
            }

            Properties.Settings.Default["RecentWorkItems"] = _RecentWorkItems;
            Properties.Settings.Default.Save();
        }
Beispiel #11
0
        private void AddToRecentFiles(string entry)
        {
            System.Collections.Specialized.StringCollection recentFiles = MogitorSettings.Instance.RecentFiles;

            if (!recentFiles.Contains(entry))
            {
                recentFiles.Add(entry);
            }

            while (recentFiles.Count > MogitorSettings.Instance.MaxRecentFiles)
            {
                recentFiles.RemoveAt(0);
            }

            OnPropertyChanged("RecentFiles");

            // To disable "Recent Files" menu, is there any more clever method?
            OnPropertyChanged("RecentFiles.Count");
        }
Beispiel #12
0
        internal void ExceptionChange()
        {
            if (activeWindow.process != null)
            {
                int index = exceptionList.IndexOf(activeWindow.process.ProcessName);

                if (index != -1)
                {
                    exceptionList.RemoveAt(index);
                }
                else
                {
                    exceptionList.Add(activeWindow.process.ProcessName);
                }

                foreach (SanebarWindow sanebarWindow in sanebarWindows)
                {
                    sanebarWindow.ChangeFocus(true, true);
                }
            }
        }
Beispiel #13
0
        public static void RemoveFromProcessList(string value)
        {
            System.Collections.Specialized.StringCollection stringCollection = Properties.Settings.Default.processes;
            int  index = -1;
            bool found = false;

            foreach (string s in stringCollection)
            {
                index++;
                if (s.StartsWith(value))
                {
                    found = true;
                    break;
                }
            }
            if (found)
            {
                stringCollection.RemoveAt(index);
            }
            Properties.Settings.Default.processes = stringCollection;
            Properties.Settings.Default.Save();
        }
Beispiel #14
0
        private void SeparateModules()
        {
            List <IModule> AllModules           = modules.ToList();
            List <int>     MissingModuleIndexes = new List <int>();

            EnableModules  = new List <IModule>();
            DisableModules = new List <IModule>();

            System.Collections.Specialized.StringCollection LoadOrder = Properties.CoreSettings.Default.LoadOrder;

            for (int i = 0; i < LoadOrder.Count; i++)
            {
                IModule module = AllModules.Find(x => x.ModuleName == LoadOrder[i]);
                if (module == null)
                {
                    MissingModuleIndexes.Add(i); continue;
                }

                EnableModules.Add(module);
                AllModules.Remove(module);
            }

            foreach (var remainingModule in AllModules)
            {
                DisableModules.Add(remainingModule);
            }

            MissingModuleIndexes.Reverse(); //As indices are ascending and removing an early index will shift all others.
            foreach (int Missing in MissingModuleIndexes)
            {
                LoadOrder.RemoveAt(Missing);
            }

            Properties.CoreSettings.Default.LoadOrder = LoadOrder;
            Properties.CoreSettings.Default.Save();
        }
        private void MapSubclasses(System.Collections.ArrayList subclasses, System.Collections.Specialized.StringCollection extendedClassesNames, System.Collections.ArrayList mappedClassesNames, System.Xml.XmlTextWriter writer)
        {
            System.Collections.ArrayList mappedSubclassesNames = new System.Collections.ArrayList();
            // Map each subclass after the class it extends
            while (subclasses.Count > 0)
            {
                for (int i = subclasses.Count - 1; i >= 0; i--)
                {
                    System.Type type = subclasses[i] as System.Type;
                    string      extendedClassName = extendedClassesNames[i];
                    if (extendedClassName == null)
                    {
                        throw new MappingException("You must specify the Extends attribute of the Subclass: " + type.FullName);
                    }

                    if (!mappedClassesNames.Contains(extendedClassName) &&
                        !mappedSubclassesNames.Contains(extendedClassName))
                    {
                        bool extendedClassFoundButNotMappedYet = false;
                        // Make sure that the extended class is mapped (in this assembly)
                        foreach (System.Type subclass in subclasses)
                        {
                            if (HbmWriterHelper.GetNameWithAssembly(subclass)
                                == extendedClassName)
                            {
                                if (subclass == type)
                                {
                                    throw new MappingException("The Subclass " + type.FullName + " extends itself.");
                                }
                                else
                                {
                                    extendedClassFoundButNotMappedYet = true;
                                    break;
                                }
                            }
                        }
                        if (extendedClassFoundButNotMappedYet)
                        {
                            continue;                             // Map this one later
                        }
                        // Else unknown extended class:
                        //   Assume it is mapped somewhere else and map this subclass
                    }

                    if (IsSubclass(type, typeof(SubclassAttribute)))
                    {
                        HbmWriter.WriteSubclass(writer, type);
                    }
                    else if (IsSubclass(type, typeof(JoinedSubclassAttribute)))
                    {
                        HbmWriter.WriteJoinedSubclass(writer, type);
                    }
                    else if (IsSubclass(type, typeof(UnionSubclassAttribute)))
                    {
                        HbmWriter.WriteUnionSubclass(writer, type);
                    }

                    // Note: Do not add to mappedClassesNames because it is for x-subclasses (and a x-subclasses shouldn't extend another x-subclasses)
                    mappedSubclassesNames.Add(HbmWriterHelper.GetNameWithAssembly(type));
                    subclasses.RemoveAt(i);
                    extendedClassesNames.RemoveAt(i);
                }
            }
        }
Beispiel #16
0
        // url scheme:  http://mysite.com/en-CA/default.aspx
        //              http://mysite.com/en-CA/whoweare/default.aspx
        //              http://mysite.com/whoweare/gallery.aspx (uses default language)

        private void Application_BeginRequest(object sender, System.EventArgs e)
        {
            HttpApplication app     = ((HttpApplication)(sender));
            HttpContext     context = app.Context;

            startTime = DateTime.Now;


            string r                    = context.Request.RawUrl;
            string virtualDir           = (System.Configuration.ConfigurationSettings.AppSettings["virtualDirName"] != null) ? System.Configuration.ConfigurationSettings.AppSettings["virtualDirName"] : "";
            string virtualFileExtension = (System.Configuration.ConfigurationSettings.AppSettings["virtualFileExtension"] != null) ? System.Configuration.ConfigurationSettings.AppSettings["virtualFileExtension"] : ".aspx";
            RewriteConfigSettings cs    = RewriteConfigSettings.GetSettings();
            RequestConfigSettings rqcs  = RequestConfigSettings.GetSettings();

            // apply exceptions
            if (!cs.IsExcluded(r) && r.IndexOf(rqcs.AdminDirectory) < 0)
            {
                if (r[r.Length - 1] != '/' && virtualFileExtension == "" && r.IndexOf("?") == -1)
                {
                    context.Response.Redirect(r + "/", true);
                }

                // lets cut the incoming url into the parts we're interested in
                string u = r.Substring(1);
                //context.Response.Write("1u=" + u + "<BR>");
                //context.Response.Write("1r=" + r + "<BR>");
                if (u.IndexOf("?") > 0)
                {
                    u = u.Substring(0, u.IndexOf("?"));
                }
                if (virtualDir.Length > 0)
                {
                    u = u.Replace(virtualDir, "");
                }
                if (u.IndexOf(".aspx") > 0 && virtualDir.Length == 0)
                {
                    u.Replace(".aspx", "");
                }
                if (u != "" && virtualFileExtension != "" && virtualFileExtension.Length > 0)
                {
                    try {
                        u = u.Substring(0, u.IndexOf(virtualFileExtension));                       //u.Replace(virtualFileExtension,"");
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("substring 3 - " + u + ", " + r, ex);
                    }
                }
                // split it!
                System.Collections.Specialized.StringCollection url_parts = new System.Collections.Specialized.StringCollection();
                url_parts.AddRange(u.Split('/'));

                // find language identitfier -- if not found then set default
                System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("/[a-z]{2}-[a-zA-Z]{2}/|/[a-z]{2}/");
                if (regex.IsMatch(r) && regex.Match(r).Index == 0)
                {
                    setCulture(url_parts[0]);
                    url_parts.RemoveAt(0);
                }
                else
                {
                    setCulture(SFGlobal.DefaultLanguage);
                }


                // create pseudo-querystring
                string output = "";
                foreach (string s in url_parts)
                {
                    if (s.Length > 0 && !SFGlobal.IsNumeric(s))
                    {
                        output += s + "*";
                    }
                }

                output = (output.Length > 1) ? output.Substring(0, output.Length - 1) : "default";

                // url rewriting

                // this needs to load the user before the currentNode is returned

                context.User = SFGlobal.FetchUser();
                context.Items.Add("currentNode", SFGlobal.GetNode(output));

                if (context.Items["currentNode"] == null || SFGlobal.GetNode(output) == null)
                {
                    context.Response.Write("currentNode is null:" + output);
                    context.Response.End();
                }

                context.RewritePath(cs.PageHandler, cs.PageHandler, output);
            }
            else
            {
                //context.Response.Write("no rewrite");
            }
        }
 /// <summary>
 /// удалить по индексу
 /// </summary>
 /// <param name="index"></param>
 public void RemoveAt(int index)
 {
     BaseRemoveAt(index);
     keys.RemoveAt(index);
 }
        /// <summary>
        /// Обновить хранилище по объектам (есть параметр, указывающий, всегда ли необходимо взводить ошибку
        /// и откатывать транзакцию при неудачном запросе в базу данных). Если
        /// он true, всегда взводится ошибка. Иначе, выполнение продолжается.
        /// Однако, при этом есть опасность преждевременного окончания транзакции, с переходом для остальных
        /// запросов режима транзакционности в autocommit. Проявлением проблемы являются ошибки навроде:
        /// The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION
        /// </summary>
        /// <param name="objects">Объекты для обновления.</param>
        /// <param name="DataObjectCache">Кэш объектов данных.</param>
        /// <param name="AlwaysThrowException">Если произошла ошибка в базе данных, не пытаться выполнять других запросов, сразу взводить ошибку и откатывать транзакцию.</param>
        public virtual void UpdateObjects(ref DataObject[] objects, DataObjectCache DataObjectCache, bool AlwaysThrowException)
        {
            object id = BusinessTaskMonitor.BeginTask("Update objects");

            if (!DoNotChangeCustomizationString && ChangeCustomizationString != null)
            {
                var tps = new List <Type>();
                foreach (DataObject d in objects)
                {
                    Type t = d.GetType();
                    if (!tps.Contains(t))
                    {
                        tps.Add(t);
                    }
                }

                string cs = ChangeCustomizationString(tps.ToArray());
                customizationString = string.IsNullOrEmpty(cs) ? customizationString : cs;
            }

            // Перенесли этот метод повыше, потому что строка соединения может быть сменена в бизнес-сервере делегатом смены строки соединения (если что-нибудь почитают).
            IDbConnection conection = GetConnection();

            var DeleteQueries      = new StringCollection();
            var UpdateQueries      = new StringCollection();
            var UpdateFirstQueries = new StringCollection();
            var InsertQueries      = new StringCollection();

            var DeleteTables    = new StringCollection();
            var UpdateTables    = new StringCollection();
            var InsertTables    = new StringCollection();
            var TableOperations = new SortedList();
            var QueryOrder      = new StringCollection();

            var AllQueriedObjects = new ArrayList();

            var auditOperationInfoList = new List <AuditAdditionalInfo>();
            var extraProcessingList    = new List <DataObject>();

            GenerateQueriesForUpdateObjects(DeleteQueries, DeleteTables, UpdateQueries, UpdateFirstQueries, UpdateTables, InsertQueries, InsertTables, TableOperations, QueryOrder, true, AllQueriedObjects, DataObjectCache, extraProcessingList, objects);

            GenerateAuditForAggregators(AllQueriedObjects, DataObjectCache, ref extraProcessingList);

            OnBeforeUpdateObjects(AllQueriedObjects);

            Exception ex = null;

            /*access checks*/

            foreach (DataObject dtob in AllQueriedObjects)
            {
                Type dobjType = dtob.GetType();
                if (!SecurityManager.AccessObjectCheck(dobjType, tTypeAccess.Full, false))
                {
                    switch (dtob.GetStatus(false))
                    {
                    case ObjectStatus.Created:
                        SecurityManager.AccessObjectCheck(dobjType, tTypeAccess.Insert, true);
                        break;

                    case ObjectStatus.Altered:
                        SecurityManager.AccessObjectCheck(dobjType, tTypeAccess.Update, true);
                        break;

                    case ObjectStatus.Deleted:
                        SecurityManager.AccessObjectCheck(dobjType, tTypeAccess.Delete, true);
                        break;
                    }
                }
            }

            /*access checks*/

            if (DeleteQueries.Count > 0 || UpdateQueries.Count > 0 || InsertQueries.Count > 0)
            { // Порядок выполнения запросов: delete,insert,update
                if (AuditService.IsAuditEnabled)
                {
                    /* Аудит проводится именно здесь, поскольку на этот момент все бизнес-сервера на объектах уже выполнились,
                     * объекты находятся именно в том состоянии, в каком должны были пойти в базу + в будущем можно транзакцию передать на исполнение
                     */
                    AuditOperation(extraProcessingList, auditOperationInfoList); // TODO: подумать, как записывать аудит до OnBeforeUpdateObjects, но уже потенциально с транзакцией
                }

                conection.Open();
                IDbTransaction trans = null;

                string query       = string.Empty;
                string prevQueries = string.Empty;
                object subTask     = null;
                try
                {
                    trans = CreateTransaction(conection);
                    IDbCommand command = conection.CreateCommand();
                    command.Transaction = trans;

                    #region прошли вглубь обрабатывая only Update||Insert
                    bool go = true;
                    do
                    {
                        string table = QueryOrder[0];
                        if (!TableOperations.ContainsKey(table))
                        {
                            TableOperations.Add(table, OperationType.None);
                        }
                        var ops = (OperationType)TableOperations[table];

                        if ((ops & OperationType.Delete) != OperationType.Delete)
                        {
                            // Смотрим есть ли Инсерты
                            if ((ops & OperationType.Insert) == OperationType.Insert)
                            {
                                if (
                                    (ex =
                                         RunCommands(InsertQueries, InsertTables, table, command, id, AlwaysThrowException))
                                    == null)
                                {
                                    ops = Minus(ops, OperationType.Insert);
                                    TableOperations[table] = ops;
                                }
                                else
                                {
                                    go = false;
                                }
                            }

                            // Смотрим есть ли Update
                            if (go && ((ops & OperationType.Update) == OperationType.Update))
                            {
                                if ((ex = RunCommands(UpdateQueries, UpdateTables, table, command, id, AlwaysThrowException)) == null)
                                {
                                    ops = Minus(ops, OperationType.Update);
                                    TableOperations[table] = ops;
                                }
                                else
                                {
                                    go = false;
                                }
                            }

                            if (go)
                            {
                                QueryOrder.RemoveAt(0);
                                go = QueryOrder.Count > 0;
                            }
                        }
                        else
                        {
                            go = false;
                        }
                    }while (go);

                    #endregion
                    if (QueryOrder.Count > 0)
                    {
                        #region сзади чистые Update

                        go = true;
                        int queryOrderIndex = QueryOrder.Count - 1;
                        do
                        {
                            string table = QueryOrder[queryOrderIndex];
                            if (TableOperations.ContainsKey(table))
                            {
                                var ops = (OperationType)TableOperations[table];

                                if (ops == OperationType.Update)
                                {
                                    if (
                                        (ex = RunCommands(UpdateQueries, UpdateTables, table, command, id, AlwaysThrowException)) == null)
                                    {
                                        ops = Minus(ops, OperationType.Update);
                                        TableOperations[table] = ops;
                                    }
                                    else
                                    {
                                        go = false;
                                    }

                                    if (go)
                                    {
                                        queryOrderIndex--;
                                        go = queryOrderIndex >= 0;
                                    }
                                }
                                else
                                {
                                    go = false;
                                }
                            }
                            else
                            {
                                queryOrderIndex--;
                            }
                        }while (go);

                        #endregion
                    }

                    foreach (string table in QueryOrder)
                    {
                        if ((ex = RunCommands(UpdateFirstQueries, UpdateTables, table, command, id, AlwaysThrowException)) != null)
                        {
                            throw ex;
                        }
                    }

                    // Удаляем в обратном порядке.
                    for (int i = QueryOrder.Count - 1; i >= 0; i--)
                    {
                        string table = QueryOrder[i];
                        if ((ex = RunCommands(DeleteQueries, DeleteTables, table, command, id, AlwaysThrowException)) != null)
                        {
                            throw ex;
                        }
                    }

                    // А теперь опять с начала
                    foreach (string table in QueryOrder)
                    {
                        if ((ex = RunCommands(InsertQueries, InsertTables, table, command, id, AlwaysThrowException)) != null)
                        {
                            throw ex;
                        }

                        if ((ex = RunCommands(UpdateQueries, UpdateTables, table, command, id, AlwaysThrowException)) != null)
                        {
                            throw ex;
                        }
                    }

                    if (AuditService.IsAuditEnabled && auditOperationInfoList.Count > 0)
                    { // Нужно зафиксировать операции аудита (то есть сообщить, что всё было корректно выполнено и запомнить время)
                        AuditService.RatifyAuditOperationWithAutoFields(
                            tExecutionVariant.Executed,
                            AuditAdditionalInfo.SetNewFieldValuesForList(trans, this, auditOperationInfoList),
                            this,
                            true);
                    }

                    if (trans != null)
                    {
                        trans.Commit();
                    }
                }
                catch (Exception excpt)
                {
                    if (trans != null)
                    {
                        trans.Rollback();
                    }
                    if (AuditService.IsAuditEnabled && auditOperationInfoList.Count > 0)
                    { // Нужно зафиксировать операции аудита (то есть сообщить, что всё было откачено)
                        AuditService.RatifyAuditOperationWithAutoFields(tExecutionVariant.Failed, auditOperationInfoList, this, false);
                    }

                    conection.Close();
                    BusinessTaskMonitor.EndSubTask(subTask);
                    throw new ExecutingQueryException(query, prevQueries, excpt);
                }

                conection.Close();

                var res = new ArrayList();
                foreach (DataObject changedObject in objects)
                {
                    changedObject.ClearPrototyping(true);

                    if (changedObject.GetStatus(false) != STORMDO.ObjectStatus.Deleted)
                    {
                        Utils.UpdateInternalDataInObjects(changedObject, true, DataObjectCache);
                        res.Add(changedObject);
                    }
                }

                foreach (DataObject dobj in AllQueriedObjects)
                {
                    if (dobj.GetStatus(false) != STORMDO.ObjectStatus.Deleted &&
                        dobj.GetStatus(false) != STORMDO.ObjectStatus.UnAltered)
                    {
                        Utils.UpdateInternalDataInObjects(dobj, true, DataObjectCache);
                    }
                }

                objects = new DataObject[res.Count];
                res.CopyTo(objects);
                BusinessTaskMonitor.EndTask(id);
            }

            if (AfterUpdateObjects != null)
            {
                AfterUpdateObjects(this, new DataObjectsEventArgs(objects));
            }
        }
                /// -----------------------------------------------------------------------------
                /// <summary>
                /// Will load all modules in given list
                /// </summary>
                /// <param name="ModFiles"></param>
                /// <remarks>
                /// Once a module is loaded it will be added the the Module list,
                /// and will then have ModLoad called and the filename property set
                /// </remarks>
                /// <history>
                /// 	[Caleb]	6/18/2005	Created
                /// </history>
                /// -----------------------------------------------------------------------------
                public void LoadModules(string[] ModFiles)
                {
                    System.Collections.Specialized.StringCollection ModuleFiles = new System.Collections.Specialized.StringCollection();
                    Assembly tObject;
                    //File tFile;
                    int tIndex;
                    short tCount = 0;
                    string tMod;
                    string tString;
                    System.Collections.Specialized.StringCollection tFound = new System.Collections.Specialized.StringCollection();
                    foreach (string xMod in ModFiles)
                    {
                        ModuleFiles.Add(xMod);
                    }
                    BlackLightModule tModule;
                    //Cycle through the modules untill they are all loaded or removed
                    while (ModuleFiles.Count > 0)
                    {
                        try
                        {
                            //Infinate loop check
                            if (tCount > 1000)
                            {
                                Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "It appears we have gotten into an infinate loop while loading modules, loading halted", "Most likely cause is two or more modules require each other and will never be able to load", "", "");
                                return;
                            }
                            tCount += Convert.ToInt16(1);

                            //Get the filename
                            tMod = ModuleFiles[0].ToString();

                            //Make sure it exists
                            if (File.Exists("modules/" + tMod))
                            {

                                //Use .NET to attempt to load the class inside the dll
                                tObject = @Assembly.LoadFrom("modules/" + tMod);

                                //Make sure everything is still hawt or remove the failed module
                                if (tObject == null)
                                {
                                    ModuleFiles.RemoveAt(0);
                                }

                                //Get a list of the classes the module contains
                                Type[] tList = tObject.GetTypes();
                                //Cycle through them all
                                foreach (Type tType in tList)
                                {

                                    //Make sure it uses our module base somewhere
                                    if (tType.IsSubclassOf(typeof(BlackLightModule)) == true)
                                    {
                                        //Alrighty it's a valid module now what?

                                        //Well lets check if its a special module, currently only datadrivers

                                        //Ooooo isn't this sexy
                                        tModule = ((BlackLightModule) tType.GetConstructor(new Type[] { typeof(ServicesDaemon) }).Invoke(new object[] {Base}));

                                        //Or not :'(
                                        if (tModule == null)
                                        {
                                            ModuleFiles.RemoveAt(0);
                                        }

                                        if (tType.IsSubclassOf(typeof(DB.DataDriver)) == true)
                                        {
                                            if (DataDriver == "")
                                            {
                                                DataDriver = tModule.Name;
                                            }
                                            else
                                            {
                                                Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "DataBase driver already loaded!", "File does not exist", "", "");
                                                ModuleFiles.RemoveAt(0);
                                            }
                                        }

                                        //Set the internal filename for the ModuleList Class
                                        tModule.FileName = tMod;

                                        //Clear the list of found modules for requirements
                                        tFound.Clear();

                                        //Malicious module coder?
                                        if (tModule.Requires.Count < 1000)
                                        {

                                            //Check if they actually have any requirements (Hope they don't)
                                            if (tModule.Requires.Count > 0)
                                            {
                                                //What kind of peice of shit coder requires other modules...oh right chanserv needs
                                                //nickserv

                                                //Check if its loaded already and work is saved
                                                foreach (string xString in tModule.Requires)
                                                {
                                                    tString = xString.ToLower();
                                                    //Make sure the dumbass didn't require themselves
                                                    if (tMod.ToLower() != tString)
                                                    {

                                                        //Make sure we havn't already found it
                                                        if (tFound.Contains(tString) == false)
                                                        {

                                                            //Now check if its loaded
                                                            if (Modules.Contains(tString) == false)
                                                            {
                                                                //Nope not loaded, does the file actually exist?
                                                                if (File.Exists("modules/" + tMod) == false)
                                                                {
                                                                    Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Requirements for " + tMod + " not met", "File does not exist", "", "");
                                                                    ModuleFiles.RemoveAt(0);
                                                                    break;
                                                                }
                                                                else
                                                                {
                                                                    //It does, heh, so the module still could be loaded

                                                                    //Well maybe, lets see if its possible
                                                                    if (ModuleFiles.Contains(tString) == false)
                                                                    {
                                                                        //Nope? Well thats the end of that module
                                                                        Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Requirements for " + tMod + " not met", "Requirement not found in avalability list", "", "");
                                                                        ModuleFiles.RemoveAt(0);
                                                                        break;
                                                                    }
                                                                }
                                                            }
                                                            else
                                                            {
                                                                //Alrighty then, so the module has already been loaded, add it to the found list
                                                                tFound.Add(tString);
                                                                // Base.Service.SendLogMessage("ModuleManagement", "LoadModules", Errors.LOG_DEBUG_AND_WARNING, "Found", "", "", "")
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        //One word: Dumbass
                                                        Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "A module cannot require itself", "", "", "");
                                                        ModuleFiles.RemoveAt(0);
                                                        break;
                                                    }
                                                }

                                                //Make sure we didn't remove our module already
                                                if (ModuleFiles.Contains(tMod))
                                                {

                                                    //Check if all the requirements are met
                                                    if (tFound.Count == tModule.Requires.Count)
                                                    {

                                                        //Verify its not already loaded
                                                        if (Modules.Contains(tMod) == false && Modules.Contains(tModule.Name) == false)
                                                        {
                                                            //Add it
                                                            Modules.Add(tModule);
                                                            // tModule.ModLoad()
                                                        }
                                                        else
                                                        {
                                                            Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Module with duplicate name already loaded: " + tMod, "", "", "");
                                                        }
                                                        //Remove it and goto the next module
                                                        ModuleFiles.RemoveAt(0);
                                                    }
                                                    else
                                                    {
                                                        //The requirements are not met, so we
                                                        //Send it to the back?
                                                        ModuleFiles.RemoveAt(0);
                                                        ModuleFiles.Add(tMod);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                //YAY! No requirements. Now just make sure its not already loaded and add it to the list
                                                if (Modules.Contains(tMod) == false && Modules.Contains(tModule.Name) == false)
                                                {
                                                    Modules.Add(tModule);
                                                    // tModule.ModLoad()
                                                }
                                                else
                                                {
                                                    Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Module with duplicate name already loaded: " + tMod, "", "", "");
                                                }
                                                ModuleFiles.RemoveAt(0);
                                            }
                                        }
                                        else
                                        {
                                            Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Module contains to many requirements: " + tMod, "", "", "");
                                        }
                                    }
                                }

                            }
                            else
                            {
                                Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "File does not exist: " + tMod, "", "", "");
                                ModuleFiles.RemoveAt(0);
                            }
                        }
                        catch (Exception e)
                        {
                            Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.ERROR, "Exception", "", e.Message, e.StackTrace);
                            //MessageBox.Show(e.Message + " " + e.StackTrace);
                        }
                    }
                    //Now give our user a nice pretty list of which modules f****d up
                    for (tIndex = 0; tIndex <= ModFiles.Length - 1; tIndex++)
                    {
                        if (Modules.Contains(ModFiles[tIndex]) == false)
                        {
                            Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Failed to load: " + ModFiles[tIndex].ToString(), "", "", "");
                        }
                        else
                        {
                            if (Modules[ModFiles[tIndex]].NeedsDBDriver == true)
                            {
                                if (DataDriver == "")
                                {
                                    Modules.Remove(Modules[ModFiles[tIndex]]);
                                    Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Failed to load: " + ModFiles[tIndex].ToString(), "No DataDriver Found", "", "");
                                }
                                else
                                {
                                    try
                                    {
                                        if (Modules[ModFiles[tIndex]].ModLoad())
                                        {
                                            Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG, "Loaded Module: " + ModFiles[tIndex].ToString(), "", "", "");
                                        }
                                        else
                                        {
                                            Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Failed to load: " + ModFiles[tIndex].ToString(), "ModLoad Error", "", "");
                                            RemoveAllRequired(ModFiles[tIndex]);
                                            Modules.Remove(Modules[ModFiles[tIndex]]);
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Failed to load: " + ModFiles[tIndex].ToString(), "ModLoad Error", ex.Message, ex.StackTrace);
                                    }

                                }
                            }
                            else
                            {
                                try
                                    {
                                if (Modules[ModFiles[tIndex]].ModLoad())
                                {
                                    Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG, "Loaded Module: " + ModFiles[tIndex].ToString(), "", "", "");
                                }
                                else
                                {
                                    Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Failed to load: " + ModFiles[tIndex].ToString(), "ModLoad Error", "", "");
                                    RemoveAllRequired(ModFiles[tIndex]);
                                    Modules.Remove(Modules[ModFiles[tIndex]]);
                                }
                                }
                                catch (Exception ex)
                                {
                                    Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "Failed to load: " + ModFiles[tIndex].ToString(), "ModLoad Error", ex.Message, ex.StackTrace);
                                }
                            }
                        }
                    }
                    //And we are done
                }