コード例 #1
0
ファイル: Level.cs プロジェクト: KonajuGames/Gleed2D
        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" )
                } ;
        }
コード例 #2
0
ファイル: Level.cs プロジェクト: KonajuGames/Gleed2D
        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;
            }
        }