internal ApplicationSettings(DataApplicationState app, XmlNode sourceNode)
        {
            this.SourceNode        = sourceNode;
            this.Config            = new ApplicationConfig(sourceNode.SelectSingleNode("config"));
            this.DbConfig          = new ApplicationDbConfig(sourceNode.SelectSingleNode("driver"));
            this.Users             = new ApplicationUserList(sourceNode.SelectNodes("user"));
            this.Url               = XmlUtils.GetChildText(this.Config.SourceNode, "app-path", app.Id);
            this.DevelopmentMode   = XmlUtils.GetBoolAttr(this.Config.SourceNode, "development-mode", false);
            this.CheckRefIntegrity = XmlUtils.GetBoolAttr(this.Config.SourceNode, "check-ref-integrity", true);
            this.RootFolder        = XmlUtils.GetAttr(sourceNode, "AppRootFolder");
            this.Name              = XmlUtils.GetAttr(sourceNode, "name");
            this.Attachments       = new AttachmentsSettings(this.Config.SourceNode.SelectSingleNode(nameof(Attachments)), this.RootFolder);
            XmlNode node1 = this.Config.SourceNode.SelectSingleNode("log");

            if (node1 != null)
            {
                this.FLogEnabled  = XmlUtils.GetBoolAttr(node1, "enabled", false);
                this.FLogFileName = XmlUtils.GetAttr(node1, "file-name", "InMeta.Log");
                this.FLogEncoding = Encoding.GetEncoding(XmlUtils.GetAttr(node1, "encoding", "windows-1251"));
            }
            XmlNode node2 = this.Config.SourceNode.SelectSingleNode("UpdateLog");

            if (node2 == null)
            {
                return;
            }
            bool boolAttr1 = XmlUtils.GetBoolAttr(node2, "Enabled", false);
            bool boolAttr2 = XmlUtils.GetBoolAttr(node2, "IncludeOriginalValues", false);

            if (boolAttr1)
            {
                this.FUpdateLogMode = boolAttr2 ? UpdateLogMode.Changes : UpdateLogMode.ChangesWithOriginalValues;
            }
        }
Exemple #2
0
 public DataSession(DataApplication application, string userAccount)
 {
     this.Application = application;
     this.UserAccount = userAccount;
     this.FStorages   = new DataStorage[application.Metadata.Classes.Count];
     this.FCentralServerConnection      = new CentralServerConnection((Integro.InMeta.Runtime.CentralServer.CentralServer)null, application.CentralServerAddress);
     this.FScriptLibraries              = new ScriptLibraries(this);
     this.FNewObjectsWithoutGeneratedId = new List <DataObject>();
     this.FUpdateLogMode    = application.Settings.UpdateLogMode;
     this.CheckRefIntegrity = application.Settings.CheckRefIntegrity;
     this.RegisterLiveSessions();
 }