/// </summary>\r
public CommandsManager CommandsManager { get { return commandsManager; } }\r
\r
+ private SleekMovement movement;\r
+ /// <summary>\r
+ /// Allows key emulation for moving avatar around\r
+ /// </summary>\r
+ public SleekMovement Movement { get { return movement; } }\r
+\r
public RadegastInstance(GridClient client0)\r
{\r
// incase something else calls GlobalInstance while we are loading\r
state = new StateManager(this);\r
mediaManager = new MediaManager(this);\r
commandsManager = new CommandsManager(this);\r
+ movement = new SleekMovement(client);\r
\r
InitializeLoggingAndConfig();\r
\r
}\r
catch (Exception) { }\r
});\r
- } \r
+ }\r
+\r
+ movement.Dispose();\r
+ movement = null;\r
commandsManager.Dispose();\r
commandsManager = null;\r
mediaManager.Dispose();\r
//\r
// $Id$\r
//\r
+using System;\r
using System.Timers;\r
using OpenMetaverse;\r
\r
namespace Radegast\r
{\r
- public class SleekMovement\r
+ public class SleekMovement : IDisposable\r
{\r
private GridClient client;\r
private Timer timer;\r
timer.Enabled = false;\r
}\r
\r
+ public void Dispose()\r
+ {\r
+ timer.Enabled = false;\r
+ timer.Dispose();\r
+ timer = null;\r
+ }\r
+\r
void timer_Elapsed(object sender, ElapsedEventArgs e)\r
{\r
if (turningLeft) {\r
private ChatTextManager chatManager;\r
private TabsConsole tabConsole;\r
private Avatar currentAvatar;\r
- private SleekMovement movement;\r
+ private SleekMovement movement { get { return instance.Movement; } }\r
private Regex chatRegex = new Regex(@"^/(\d+)\s*(.*)", RegexOptions.Compiled);\r
private Dictionary<uint, Avatar> avatars = new Dictionary<uint, Avatar>();\r
private Dictionary<uint, bool> bots = new Dictionary<uint,bool>();\r
netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);\r
client.Grid.OnCoarseLocationUpdate += new GridManager.CoarseLocationUpdateCallback(Grid_OnCoarseLocationUpdate);\r
\r
- movement = new SleekMovement(client);\r
-\r
chatManager = new ChatTextManager(instance, new RichTextBoxPrinter(rtbChat));\r
chatManager.PrintStartupMessage();\r
\r