123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Drawing;
- namespace Microsoft.Windows.Forms.Animate
- {
-
-
-
- internal class AnimationOperations : DisposableMini, IEnumerable<AnimationFrame>
- {
-
- private List<AnimationFrame> m_Frames = new List<AnimationFrame>();
- private bool m_Cleared;
-
-
-
- public bool Cleared
- {
- get
- {
- return this.m_Cleared;
- }
- }
- private Size? m_Size;
-
-
-
- public Size Size
- {
- get
- {
- return this.m_Size.Value;
- }
- }
-
-
-
- public bool Resized
- {
- get
- {
- return this.m_Size != null;
- }
- }
-
-
-
-
- public void Resize(Size size)
- {
- this.m_Size = size;
- }
-
-
-
-
- public void AddFrame(AnimationFrame frame)
- {
- this.m_Frames.Add(frame);
- }
-
-
-
- public void ClearFrame()
- {
- foreach (AnimationFrame frame in this.m_Frames)
- frame.Dispose();
- this.m_Frames.Clear();
- this.m_Cleared = true;
- }
-
-
-
- public void Clear()
- {
- this.m_Frames.Clear();
- this.m_Cleared = false;
- this.m_Size = null;
- }
-
-
-
-
- public IEnumerator<AnimationFrame> GetEnumerator()
- {
- return this.m_Frames.GetEnumerator();
- }
-
-
-
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return (this.m_Frames as IEnumerable).GetEnumerator();
- }
-
-
-
-
- protected override void Dispose(bool disposing)
- {
- if (this.m_Frames != null)
- {
- foreach (AnimationFrame frame in this.m_Frames)
- frame.Dispose();
- this.m_Frames.Clear();
- this.m_Frames = null;
- }
- }
- }
- }
|