Exemplo n.º 1
0
        public LevelEditor()
        {
            Behaviours = new BehaviourCollection( );

            const string contentRootFolder = @"c:\";

            _properties = new LevelProperties
            {
                Name              = "Root",
                Visible           = true,
                CustomProperties  = new CustomProperties(),
                ContentRootFolder = contentRootFolder,
                Version           = ObjectFactory.GetInstance <IGetAssemblyInformation>( ).Version
            };

            _previousContentRootFolder = contentRootFolder;

            var contentRootChanged = new ContentRootChanged(_previousContentRootFolder, contentRootFolder);

            ObjectFactory.GetInstance <IEventHub>().Publish(contentRootChanged);

            Layers = new List <LayerEditor>
            {
                new LayerEditor(this, @"Layer_0")
            };
        }
Exemplo n.º 2
0
        public void PropertiesChanged(PropertyValueChangedEventArgs whatChanged)
        {
            if (whatChanged.ChangedItem.PropertyDescriptor == null)
            {
                return;
            }

            if (whatChanged.ChangedItem.PropertyDescriptor.Name == @"ContentRootFolder")
            {
                var contentRootChanged = new ContentRootChanged(_previousContentRootFolder, _properties.ContentRootFolder);
                ObjectFactory.GetInstance <IEventHub>().Publish(contentRootChanged);
                ObjectFactory.GetInstance <IModelEventHub>().Publish(contentRootChanged);

                _previousContentRootFolder = _properties.ContentRootFolder;
            }
        }