public PropertyEditor CreateEditor(Type baseType, ProviderContext context)
		{
			PropertyEditor e = null;
			bool compRef = !(context.ParentEditor is GameObjectOverviewPropertyEditor);

			// -------- Specialized area --------
			if (baseType == typeof(GameObject))
			{
				if (context.ParentEditor == null)
					e = new GameObjectOverviewPropertyEditor();
				else
					e = new GameObjectRefPropertyEditor();
			}
			else if (baseType == typeof(Transform) && !compRef)		e = new TransformPropertyEditor();
			else if (baseType == typeof(SoundEmitter) && !compRef)	e = new SoundEmitterPropertyEditor();
			else if (baseType == typeof(BatchInfo))					e = new BatchInfoPropertyEditor();
			else if (baseType == typeof(Material))					e = new MaterialPropertyEditor();
			else if (baseType == typeof(Texture))					e = new TexturePropertyEditor();
			else if (baseType == typeof(AudioData))					e = new AudioDataPropertyEditor();
			else if (baseType == typeof(Pixmap))					e = new PixmapPropertyEditor();
			else if (baseType == typeof(Font))						e = new FontPropertyEditor();

			//// -------- Semi-Specialized area --------
			else if (typeof(RigidBody).IsAssignableFrom(baseType) && !compRef)	e = new RigidBodyPropertyEditor();
			else if (typeof(DrawTechnique).IsAssignableFrom(baseType))			e = new DrawTechniquePropertyEditor();

			// -------- General area --------
			else if (typeof(ShapeInfo).IsAssignableFrom(baseType))				e = new RigidBodyShapePropertyEditor();
			else if (typeof(Component).IsAssignableFrom(baseType) && compRef)	e = new ComponentRefPropertyEditor();
			else if (typeof(Component).IsAssignableFrom(baseType) && !compRef)	e = new ComponentPropertyEditor();
			else if (typeof(Resource).IsAssignableFrom(baseType))				e = new ResourcePropertyEditor();
			else if (typeof(IContentRef).IsAssignableFrom(baseType))			e = new IContentRefPropertyEditor();

			return e;
		}
		protected override void BeforeAutoCreateEditors()
		{
			base.BeforeAutoCreateEditors();
			AudioDataPreviewPropertyEditor preview = new AudioDataPreviewPropertyEditor();
			preview.EditedType = this.EditedType;
			preview.Getter = this.GetValue;
			this.ParentGrid.ConfigureEditor(preview);
			this.AddPropertyEditor(preview);
			ResourcePropertyEditor content = new ResourcePropertyEditor();
			content.EditedType = this.EditedType;
			content.Getter = this.GetValue;
			content.Setter = this.SetValues;
			content.Hints = HintFlags.None;
			content.HeaderHeight = 0;
			content.HeaderValueText = null;
			content.PreventFocus = true;
			this.ParentGrid.ConfigureEditor(content);
			this.AddPropertyEditor(content);
			content.Expanded = true;
		}
Example #3
0
        protected override void BeforeAutoCreateEditors()
        {
            base.BeforeAutoCreateEditors();
            AudioDataPreviewPropertyEditor preview = new AudioDataPreviewPropertyEditor();

            preview.EditedType = this.EditedType;
            preview.Getter     = this.GetValue;
            this.ParentGrid.ConfigureEditor(preview);
            this.AddPropertyEditor(preview);
            ResourcePropertyEditor content = new ResourcePropertyEditor();

            content.EditedType      = this.EditedType;
            content.Getter          = this.GetValue;
            content.Setter          = this.SetValues;
            content.Hints           = HintFlags.None;
            content.HeaderHeight    = 0;
            content.HeaderValueText = null;
            content.PreventFocus    = true;
            this.ParentGrid.ConfigureEditor(content);
            this.AddPropertyEditor(content);
            content.Expanded = true;
        }
Example #4
0
        public PropertyEditor CreateEditor(Type baseType, ProviderContext context)
        {
            PropertyEditor e       = null;
            bool           compRef = !(context.ParentEditor is GameObjectOverviewPropertyEditor);

            // -------- Specialized area --------
            if (baseType == typeof(GameObject))
            {
                if (context.ParentEditor == null)
                {
                    e = new GameObjectOverviewPropertyEditor();
                }
                else
                {
                    e = new GameObjectRefPropertyEditor();
                }
            }
            else if (baseType == typeof(Transform) && !compRef)
            {
                e = new TransformPropertyEditor();
            }
            else if (baseType == typeof(SoundEmitter) && !compRef)
            {
                e = new SoundEmitterPropertyEditor();
            }
            else if (baseType == typeof(BatchInfo))
            {
                e = new BatchInfoPropertyEditor();
            }
            else if (baseType == typeof(Material))
            {
                e = new MaterialPropertyEditor();
            }
            else if (baseType == typeof(Texture))
            {
                e = new TexturePropertyEditor();
            }
            else if (baseType == typeof(AudioData))
            {
                e = new AudioDataPropertyEditor();
            }
            else if (baseType == typeof(Pixmap))
            {
                e = new PixmapPropertyEditor();
            }
            else if (baseType == typeof(Font))
            {
                e = new FontPropertyEditor();
            }

            //// -------- Semi-Specialized area --------
            else if (typeof(RigidBody).IsAssignableFrom(baseType) && !compRef)
            {
                e = new RigidBodyPropertyEditor();
            }
            else if (typeof(DrawTechnique).IsAssignableFrom(baseType))
            {
                e = new DrawTechniquePropertyEditor();
            }

            // -------- General area --------
            else if (typeof(ShapeInfo).IsAssignableFrom(baseType))
            {
                e = new RigidBodyShapePropertyEditor();
            }
            else if (typeof(Component).IsAssignableFrom(baseType) && compRef)
            {
                e = new ComponentRefPropertyEditor();
            }
            else if (typeof(Component).IsAssignableFrom(baseType) && !compRef)
            {
                e = new ComponentPropertyEditor();
            }
            else if (typeof(Resource).IsAssignableFrom(baseType))
            {
                e = new ResourcePropertyEditor();
            }
            else if (typeof(IContentRef).IsAssignableFrom(baseType))
            {
                e = new IContentRefPropertyEditor();
            }

            return(e);
        }