Example #1
0
        private void UpdatePropertyValues(DocumentCompositeNode compositeNode, SamplePropertyTypeOrFormatChanged change)
        {
            if (compositeNode == null)
            {
                return;
            }
            SampleProperty sampleProperty = change.SampleProperty;

            if (compositeNode.Type == sampleProperty.DeclaringSampleType)
            {
                if (change.OldType == SampleBasicType.Image)
                {
                    DocumentPrimitiveNode documentPrimitiveNode = compositeNode.Properties[(IPropertyId)sampleProperty] as DocumentPrimitiveNode;
                    if (documentPrimitiveNode != null)
                    {
                        string relativePath = documentPrimitiveNode.GetValue <string>();
                        sampleProperty.DeclaringDataSet.UnuseAssetFile(relativePath);
                    }
                }
                this.CreatePropertyValue(compositeNode, sampleProperty);
                ++this.changeCount;
            }
            for (int index = 0; index < compositeNode.Properties.Count; ++index)
            {
                this.UpdatePropertyValues(compositeNode.Properties[index] as DocumentCompositeNode, change);
            }
            if (!compositeNode.SupportsChildren)
            {
                return;
            }
            for (int index = 0; index < compositeNode.Children.Count; ++index)
            {
                this.UpdatePropertyValues(compositeNode.Children[index] as DocumentCompositeNode, change);
            }
        }
Example #2
0
 private void ProcessPropertyTypeOrFormatChanges(IList <SampleDataChange> normalizedChanges, DocumentCompositeNode rootNode)
 {
     for (int index = 0; index < normalizedChanges.Count; ++index)
     {
         SamplePropertyTypeOrFormatChanged change = normalizedChanges[index] as SamplePropertyTypeOrFormatChanged;
         if (change != null)
         {
             this.UpdatePropertyValues(rootNode, change);
         }
     }
 }