Пример #1
0
 internal static DataApplicationState Get(
     string id,
     string centralServerAddress)
 {
     centralServerAddress = CentralServerClient.GetHost(centralServerAddress) + (object)':' + (object)CentralServerClient.GetPort(centralServerAddress);
     lock (DataApplicationState.FCacheSync)
     {
         for (int index = 0; index < DataApplicationState.FCache.Count; ++index)
         {
             DataApplicationState applicationState = DataApplicationState.FCache[index];
             if (DataApplicationState.Same(id, applicationState.FId) && DataApplicationState.Same(centralServerAddress, applicationState.FCentralServerAddress))
             {
                 if (!applicationState.IsMetadataChanged())
                 {
                     return(applicationState);
                 }
                 DataApplicationState.FCache.RemoveAt(index);
                 break;
             }
         }
         DataApplicationState applicationState1 = new DataApplicationState(id, centralServerAddress);
         applicationState1.FSyncVersion = Utility.GetSyncVersion(applicationState1.MetadataSyncFile);
         DataApplicationState.FCache.Add(applicationState1);
         return(applicationState1);
     }
 }
        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;
            }
        }
Пример #3
0
 internal void Reload()
 {
     this.QueryThisCentralServer("<ReloadApp AppID='{0}'/>", (object)this.FId);
     this.FMetadata = (ApplicationMetadata)null;
     this.FSettings = (ApplicationSettings)null;
     this.FLog      = (DataApplication.ApplicationLog)null;
     DataApplicationState.RewriteFileIfExists(this.Settings.RootFolder + "\\Web\\global.asa");
     DataApplicationState.RewriteFileIfExists(this.Settings.RootFolder + "\\Web\\global.asax");
 }