Esempio n. 1
0
            public override void Execute()
            {
                SampleDataCollection sampleData = this.SampleData;

                if (sampleData == null)
                {
                    return;
                }
                try
                {
                    sampleData.ImportSampleDataFromXmlFile(this.SampleDataName, this.XmlFilePath);
                }
                catch (Exception ex)
                {
                    this.services.GetService <IMessageDisplayService>().ShowError(ex.Message);
                }
            }
        public void Rebuild()
        {
            if (this.SceneNodeProperty == null)
            {
                return;
            }
            ProjectXamlContext projectXamlContext = this.ProjectXamlContext;

            if (this.ProjectXamlContext != null)
            {
                SampleDataCollection sampleData = projectXamlContext.SampleData;
                IEnumerable <DataStoreReferenceEntry> dataStoreDataSet = this.FindDataStoreDataSet((Predicate <SampleDataSet>)(dataSet => true));
                HashSet <string> hashSet           = new HashSet <string>();
                List <DataStorePropertyEntry> list = new List <DataStorePropertyEntry>();
                list.Add(new DataStorePropertyEntry((SampleDataSet)null, StringTable.CreateNewPropertyItem, true));
                this.properties = list;
                if (dataStoreDataSet != null)
                {
                    foreach (DataStoreReferenceEntry storeReferenceEntry in dataStoreDataSet)
                    {
                        SampleDataSet dataStore = storeReferenceEntry.DataStore;
                        if (!hashSet.Contains(dataStore.Name))
                        {
                            hashSet.Add(dataStore.Name);
                            for (int index = 0; index < storeReferenceEntry.DataStore.RootType.Properties.Count; ++index)
                            {
                                list.Add(new DataStorePropertyEntry(storeReferenceEntry.DataStore, storeReferenceEntry.DataStore.RootType.Properties[index].Name, false));
                            }
                        }
                    }
                    if (this.editingProperty != null)
                    {
                        this.editingProperty = Enumerable.FirstOrDefault <DataStorePropertyEntry>(Enumerable.Where <DataStorePropertyEntry>((IEnumerable <DataStorePropertyEntry>) this.properties, (Func <DataStorePropertyEntry, bool>)(entry => entry.Name == this.SelectedProperty.Name)));
                    }
                }
            }
            if (this.Rebuilt == null)
            {
                return;
            }
            this.Rebuilt((object)this, (EventArgs)null);
        }