ToSic.SexyContent.ImportExport.ZipExport.ExportForSourceControl C# (CSharp) 메소드

ExportForSourceControl() 공개 메소드

public ExportForSourceControl ( bool includeContentGroups = false, bool resetAppGuid = false ) : void
includeContentGroups bool
resetAppGuid bool
리턴 void
        public void ExportForSourceControl(bool includeContentGroups = false, bool resetAppGuid = false)
        {
            var path = _app.PhysicalPath + "\\" + _sourceControlDataFolder;
            if (!Directory.Exists(path))
                Directory.CreateDirectory(path);

            // generate the XML & save
            var xmlExport = GenerateExportXml(includeContentGroups, resetAppGuid);
            string xml = xmlExport.GenerateNiceXml();
            File.WriteAllText(Path.Combine(path, _sourceControlDataFile), xml);
        }

Usage Example

예제 #1
0
        public bool ExportForVersionControl(int appId, int zoneId, bool includeContentGroups, bool resetAppGuid)
        {
            EnsureUserIsAdmin();

            // ReSharper disable once UnusedVariable
            var appWrapper = (UserInfo.IsSuperUser)
                ? new SxcAppWrapper(zoneId, appId)  // only super-user may switch to another zone for export
                : new SxcAppWrapper(appId);

            var zipExport = new ZipExport(zoneId, appId);
            zipExport.ExportForSourceControl(includeContentGroups, resetAppGuid);

            return true;
        }