Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
        private void OpenObject(TreeNode node)
        {
            var obj = node.Tag as FileFormats.Resource.ObjectInfo;

            if (obj == null)
            {
                return;
            }

            if (obj.Data is FileFormats.Game.CBitmapTexture)
            {
                var viewer = new TextureViewer()
                {
                    MdiParent = this.MdiParent,
                };
                viewer.LoadResource((FileFormats.Game.CBitmapTexture)obj.Data);
                viewer.Show();
            }
            else if (obj.Data is FileFormats.Resource.Dummy)
            {
                MessageBox.Show(
                    "Unsupported object type.",
                    "Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (obj.Data is FileFormats.Game.CObject ||
                     obj.Data is FileFormats.Game.TTypedClass)
            {
                var viewer = new ObjectViewer()
                {
                    MdiParent = this.MdiParent,
                };
                viewer.LoadResource(obj.Data);
                viewer.Show();
            }
            else if (obj.Data is FileFormats.Game.GenericObject)
            {
                var viewer = new GenericObjectViewer(_explorer)
                {
                    MdiParent = this.MdiParent,
                };
                viewer.LoadResource((FileFormats.Game.GenericObject)obj.Data);
                viewer.Show();
            }
            else
            {
                MessageBox.Show(
                    string.Format("Unimplemented object type ({0}).",
                                  obj.Data.GetType().Name),
                    "Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        private void OpenObject(TreeNode node)
        {
            var obj = node.Tag as FileFormats.Resource.ObjectInfo;
            if (obj == null)
            {
                return;
            }

            if (obj.Data is FileFormats.Game.CBitmapTexture)
            {
                var viewer = new TextureViewer()
                {
                    MdiParent = this.MdiParent,
                };
                viewer.LoadResource((FileFormats.Game.CBitmapTexture)obj.Data);
                viewer.Show();
            }
            else if (obj.Data is FileFormats.Resource.Dummy)
            {
                MessageBox.Show(
                    "Unsupported object type.",
                    "Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (obj.Data is FileFormats.Game.CObject ||
                obj.Data is FileFormats.Game.TTypedClass)
            {
                var viewer = new ObjectViewer()
                {
                    MdiParent = this.MdiParent,
                };
                viewer.LoadResource(obj.Data);
                viewer.Show();
            }
            else if (obj.Data is FileFormats.Game.GenericObject)
            {
                var viewer = new GenericObjectViewer(_explorer)
                {
                    MdiParent = this.MdiParent,
                };
                viewer.LoadResource((FileFormats.Game.GenericObject) obj.Data);
                viewer.Show();
            }
            else
            {
                MessageBox.Show(
                    string.Format("Unimplemented object type ({0}).",
                        obj.Data.GetType().Name),
                    "Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }