public void GetProperties(DocumentPropertiesJson documentProperties)
 {
     if (this.VolatileProperties != null)
     {
         documentProperties.AnalysisLoadTime        = VolatileProperties.AnalysisLoadTime;
         documentProperties.DeserializationLoadTime = VolatileProperties.DeserializationLoadTime;
         documentProperties.ControlCount            = VolatileProperties.ControlCount;
     }
 }
Esempio n. 2
0
        internal CanvasDocument(CanvasDocument other)
        {
            foreach (var kvp in other._unknownFiles)
            {
                _unknownFiles.Add(kvp.Key, new FileEntry(kvp.Value));
            }

            foreach (var kvp in other._assetFiles)
            {
                _assetFiles.Add(kvp.Key, new FileEntry(kvp.Value));
            }

            foreach (var kvp in other._screens)
            {
                _screens.Add(kvp.Key, kvp.Value.Clone());
            }

            foreach (var kvp in other._components)
            {
                _components.Add(kvp.Key, kvp.Value.Clone());
            }

            _editorStateStore = new EditorStateStore(other._editorStateStore);
            _templateStore    = new TemplateStore(other._templateStore);

            _dataSources = other._dataSources.JsonClone();
            _screenOrder = new List <string>(other._screenOrder);

            _header               = other._header.JsonClone();
            _properties           = other._properties.JsonClone();
            _parameterSchema      = other._parameterSchema.JsonClone();
            _publishInfo          = other._publishInfo.JsonClone();
            _templates            = other._templates.JsonClone();
            _themes               = other._themes.JsonClone();
            _resourcesJson        = other._resourcesJson.JsonClone();
            _appCheckerResultJson = other._appCheckerResultJson.JsonClone();
            _pcfControls          = other._pcfControls.JsonClone();

            _appInsights = other._appInsights.JsonClone();

            _connections = other._connections.JsonClone();

            _dataSourceReferences = other._dataSourceReferences.JsonClone();
            _libraryReferences    = other._libraryReferences.JsonClone();

            _logoFile = other._logoFile != null ? new FileEntry(other._logoFile) : null;
            _entropy  = other._entropy.JsonClone();
            _checksum = other._checksum.JsonClone();

            this._idRestorer = new UniqueIdRestorer(this._entropy);

            _localAssetInfoJson = other._localAssetInfoJson.JsonClone();
        }
        public void SetProperties(DocumentPropertiesJson documentProperties)
        {
            VolatileProperties = new PropertyEntropy()
            {
                AnalysisLoadTime        = documentProperties.AnalysisLoadTime,
                DeserializationLoadTime = documentProperties.DeserializationLoadTime,
                ControlCount            = documentProperties.ControlCount,
            };

            documentProperties.AnalysisLoadTime        = null;
            documentProperties.DeserializationLoadTime = null;
            documentProperties.ControlCount            = null;
        }
        public static CanvasDocument Create(string appName, string packagesPath, IList <string> paFiles, ErrorContainer errors)
        {
            var app = new CanvasDocument();

            app._properties = DocumentPropertiesJson.CreateDefault(appName);
            app._header     = HeaderJson.CreateDefault();

            LoadTemplateFiles(errors, app, packagesPath, out var loadedTemplates);
            app._entropy  = new Entropy();
            app._checksum = new ChecksumJson()
            {
                ClientStampedChecksum = "Foo", ClientBuildDetails = _buildVerJson
            };

            AddDefaultTheme(app);

            CreateControls(app, paFiles, loadedTemplates, errors);

            return(app);
        }