Aetherius Shadowblade
Member
Rehashing an old Beginner.cs code to display an html page by using a keyword. Something got me interested in this and if it works great, if not, no biggie. But I need help getting past this code error.
Line 21: The type or namespace name 'CommandEventArgs' could not be found (are you missing a using directive or an assembly reference?)
Line 21: The type or namespace name 'CommandEventArgs' could not be found (are you missing a using directive or an assembly reference?)
Code:
// not actually a timer anymore, oh well. :>
using System;
using Server.Network;
using Server.Gumps;
using System.Collections;
using System.IO;
using Server.Mobiles;
using Server.Items;
namespace Server.Misc
{
/// <summary>
/// This command displays the Rules help window.
/// </summary>
public class RulesCommand
{
public static void Initialize()
{
Server.Commands.Register( "Rules", AccessLevel.Player, new CommandEventHandler( RulesCommand_OnCommand ) );
}
[Usage( "Rules" )]
[Description( "Displays the shard rules to players." )]
public static void RulesCommand_OnCommand( AccessLevel.Player )
{
string filename = Path.Combine( Core.BaseDirectory, "Data/HTML Files/Rules.html" );
string content = "";
if ( File.Exists( filename ) )
{
using ( StreamReader sr = new StreamReader( filename ) )
{
string line;
while ((line = sr.ReadLine()) != null)
{
content = content + line;
}
}
if ( content != null || content != "" )
{
e.Mobile.SendGump( new NoticeGump( 1060637, 0xFFFFFF, String.Format( content, Server.Commands.CommandPrefix ), 0xFFFFFF, 640, 480, null, null ) );
}
else
{
e.Mobile.SendMessage( "Error, content was null." );
}
}
else
{
e.Mobile.SendMessage( "Error, couldn't find {0}", filename );
}
}
}
}