Created classes to implement #37 idea.

This commit is contained in:
Benito Palacios Sánchez 2015-03-15 12:07:16 +01:00 committed by Superfranci99
parent 88e0c53dff
commit 0323240498
4 changed files with 140 additions and 0 deletions

View File

@ -0,0 +1,45 @@
//
// DataStructure.cs
//
// Author:
// Benito Palacios Sánchez <benito356@gmail.com>
//
// Copyright (c) 2015 Benito Palacios Sánchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
namespace NitroDebugger
{
public abstract class DataStructure
{
public abstract void Read();
public abstract void Write();
}
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class DataDescription : Attribute
{
public DataDescription(string description)
{
Description = description;
}
public string Description {
get;
private set;
}
}
}

View File

@ -39,6 +39,10 @@
<Reference Include="Mono.Addins"> <Reference Include="Mono.Addins">
<HintPath>..\libgame\libs\mono-addins\bin\Mono.Addins.dll</HintPath> <HintPath>..\libgame\libs\mono-addins\bin\Mono.Addins.dll</HintPath>
</Reference> </Reference>
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
@ -69,6 +73,9 @@
<Compile Include="RSP\GdbStream.cs" /> <Compile Include="RSP\GdbStream.cs" />
<Compile Include="RSP\GdbSessionManager.cs" /> <Compile Include="RSP\GdbSessionManager.cs" />
<Compile Include="Plugin.cs" /> <Compile Include="Plugin.cs" />
<Compile Include="StructPanel.cs" />
<Compile Include="DataStructure.cs" />
<Compile Include="VisualPlugin.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>

View File

@ -0,0 +1,53 @@
//
// StructPanel.cs
//
// Author:
// Benito Palacios Sánchez <benito356@gmail.com>
//
// Copyright (c) 2015 Benito Palacios Sánchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Linq;
using System.Reflection;
using Gtk;
using Mono.Addins;
namespace NitroDebugger
{
[TypeExtensionPoint]
public abstract class StructPanel<T> : VisualPlugin
where T : DataStructure, new()
{
VBox container;
protected StructPanel()
{
container = new VBox();
Data = new T();
Data.Read();
}
public override Container MainContainer {
get { return container; }
}
public T Data {
get;
private set;
}
}
}

View File

@ -0,0 +1,35 @@
//
// VisualPlugin.cs
//
// Author:
// Benito Palacios Sánchez <benito356@gmail.com>
//
// Copyright (c) 2015 Benito Palacios Sánchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using Gtk;
using Mono.Addins;
namespace NitroDebugger
{
[TypeExtensionPoint]
public abstract class VisualPlugin : Plugin
{
public abstract Container MainContainer {
get;
}
}
}