more documentation changes

This commit is contained in:
Tim Young 2017-09-21 11:17:48 -05:00
parent 9cce19c067
commit 517b9b88e0

View File

@ -9,6 +9,7 @@ using System.Xml.Serialization;
using System.Resources; using System.Resources;
using System.IO; using System.IO;
using System.Collections; using System.Collections;
using System.Windows.Forms;
namespace SpriteLibrary namespace SpriteLibrary
{ {
@ -160,6 +161,68 @@ namespace SpriteLibrary
/// Open a Sprite Edit Window. This window does not let you draw a sprite. What it does is to help /// Open a Sprite Edit Window. This window does not let you draw a sprite. What it does is to help
/// you define your sprites and makes the process of using Sprites in your program a lot easier. /// you define your sprites and makes the process of using Sprites in your program a lot easier.
/// </summary> /// </summary>
/// <example>
/// This is an example of how to use a SpriteDatabase.
/// When you begin developing your project, you want to start by creating a SpriteDatabase and pointing
/// it to a file, and then opening up an EditorWindow.
/// <code lang="C#">
/// public partial class MyGameForm : Form
/// {
/// SpriteController mySpriteController = null;
/// SpriteDatabase mySpriteDatabase = null;
///
/// public MyGameForm()
/// {
/// InitializeComponent();
/// MainDrawingArea.BackgroundImage = Properties.Resources.Background;
/// MainDrawingArea.BackgroundImageLayout = ImageLayout.Stretch;
///
/// string Desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
/// string MyFile = Path.Combine(Desktop, "myFile.xml");
/// mySpriteDatabase = new SpriteDatabase(Properties.Resources.ResourceManager, MyFile);
///
/// mySpriteController = new SpriteController(MainDrawingArea, mySpriteDatabase);
///
/// mySpriteDatabase.OpenEditWindow();
/// mySpriteDatabase.Save();
/// }
/// }
/// </code>
/// The Editor Window will let you find the sprites that are contained in the various images you have
/// as resources in your program, and it will save a file with those sprite templates. Any SpriteController
/// that you have instantiated with a Sprite Database (see <see cref="SpriteController(PictureBox, SpriteDatabase)"/>)
/// will now be able to create named sprites from the templates defined in the database. After the first use, the
/// named sprites will be accessible from within that controller just like any other named sprites.
///
/// After you have created your SpriteDatabase file, you will want to add your file to your program resources.
/// Then, you will change the SpriteDatabase to use the resource instead of a file. If we named the file
/// "MySpriteDatabase.xml", and it got added to your resources with the name "MySpriteDatabase", you would
/// pass "MySpriteDatabase" to the database instantiation.
/// <code lang="C#">
/// public partial class MyGameForm : Form
/// {
/// SpriteController mySpriteController = null;
/// SpriteDatabase mySpriteDatabase = null;
///
/// public MyGameForm()
/// {
/// InitializeComponent();
/// MainDrawingArea.BackgroundImage = Properties.Resources.Background;
/// MainDrawingArea.BackgroundImageLayout = ImageLayout.Stretch;
///
/// //string Desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
/// //string MyFile = Path.Combine(Desktop, "myFile.xml");
/// //mySpriteDatabase = new SpriteDatabase(Properties.Resources.ResourceManager, MyFile);
/// mySpriteDatabase = new SpriteDatabase(Properties.Resources.ResourceManager, "MySpriteDatabase");
///
/// mySpriteController = new SpriteController(MainDrawingArea, mySpriteDatabase);
///
/// //mySpriteDatabase.OpenEditWindow();
/// //mySpriteDatabase.Save();
/// }
/// }
/// </code>
/// </example>
/// <param name="FirstItemIndex"></param> /// <param name="FirstItemIndex"></param>
public void OpenEditWindow(int FirstItemIndex=-1) public void OpenEditWindow(int FirstItemIndex=-1)
{ {