Click here to Skip to main content
15,886,810 members
Articles / Desktop Programming / MFC

Ramakrishna's Code Project Screen Saver

Rate me:
Please Sign up or sign in to vote.
4.29/5 (4 votes)
19 May 2002CPOL9 min read 197.3K   2.3K   31  
This is a screen saver written in C# and Managed C++ to display data from The Code Project web site
using System;
using System.Drawing;

namespace CP.Apps.ScreenSaver
{
	public interface IEffectManager
	{
		event EventHandler NoEffect;
		
		Color BackColor
		{
			get;
			set;
		}

		System.Drawing.Rectangle DisplayArea
		{
			get;
		}

		IEffect Effect
		{
			get;
			set;
		}

		void ProgressEffect();
	}
	
	public class EffectCompleteEventArgs : EventArgs
	{
		private IEffectManager effectManager;
		private System.Drawing.Graphics graphics;

		public EffectCompleteEventArgs(IEffectManager mgr, Graphics g)
		{
			this.effectManager = mgr;
			this.graphics = g;
		}

		public IEffectManager EffectManager
		{
			get
			{
				return effectManager;
			}
		}
		
		public System.Drawing.Graphics Graphics
		{
			get
			{
				return this.graphics;
			}
		}
	}
		
	public delegate void EffectCompleteEventHandler(object sender, EffectCompleteEventArgs e);
	
	/// <summary>
	/// Encapsulates an effect that happens on the screen saver like animation etc.
	/// </summary>
	public interface IEffect
	{
		event EffectCompleteEventHandler EffectComplete;
		void Draw(Graphics g);
		bool Progress();
		void End(Graphics g, IEffectManager em);
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions