public PonyWindow(Pony Pony) { InitializeComponent(); // set up the window. this.Left = 0; this.Top = 0; this.Width = 1; this.Height = 1; this.Title = "Pony"; this.Topmost = true; this.Hide(); // reference to the pony. this.Pony = Pony; // tray icon. this.Tray = new PonyIcon(this.Pony); this.Tray.Show(); // set a mouse cursor for petting lol. this.Cursor = System.Windows.Input.Cursors.Hand; // enable moving the window by dragging anywhere. // this.MouseLeftButtonDown += new MouseButtonEventHandler(OnWindowDragAction); }
/// <summary> /// releases the resources and references this window has. /// </summary> public void Free() { // dispose of tray icon. this.Tray.Hide(); this.Tray.Free(); this.Tray = null; // release references. this.Pony = null; }