public Model() { mAmbience = new Ambience(this); //listen to events AttachToAmbience(mAmbience); //here I'll have to work on the scene graph this.mShapes = new ShapeCollection(); //the page collection mPages = new CollectionBase<IPage>(); //the default page mDefaultPage = new Page("Default Page"); mDefaultPage.OnEntityAdded += new EventHandler<EntityEventArgs>(mDefaultPage_OnEntityAdded); mDefaultPage.OnEntityRemoved += new EventHandler<EntityEventArgs>(mDefaultPage_OnEntityRemoved); mDefaultPage.OnClear += new EventHandler(mDefaultPage_OnClear); mPages.Add(mDefaultPage); //initially the current page is the one and only default page mCurrentPage = mDefaultPage; //the paintables mPaintables = new CollectionBase<IDiagramEntity>(); }
public Model() { mAmbience = new Ambience(this); //listen to events AttachToAmbience(mAmbience); //here I'll have to work on the scene graph this.mShapes = new ShapeCollection(); //the page collection mPages = new CollectionBase <IPage>(); //the default page mDefaultPage = new Page("Default Page"); mDefaultPage.OnEntityAdded += new EventHandler <EntityEventArgs>(mDefaultPage_OnEntityAdded); mDefaultPage.OnEntityRemoved += new EventHandler <EntityEventArgs>(mDefaultPage_OnEntityRemoved); mDefaultPage.OnClear += new EventHandler(mDefaultPage_OnClear); mPages.Add(mDefaultPage); //initially the current page is the one and only default page mCurrentPage = mDefaultPage; //the paintables mPaintables = new CollectionBase <IDiagramEntity>(); }
protected virtual void Dispose(bool disposing) { if (disposing) { #region free managed resources if (mAmbience != null) { mAmbience.Dispose(); mAmbience = null; } #endregion } }
internal void AttachToAmbience(Ambience ambience) { if (ambience == null) throw new ArgumentNullException("The ambience object assigned to the model cannot be 'null'"); mAmbience.OnAmbienceChanged += new EventHandler<AmbienceEventArgs>(mAmbience_OnAmbienceChanged); }
public AmbienceEventArgs(Ambience ambience) { this.mAmbience = ambience; }