Exemple #1
0
        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>();
        }
Exemple #2
0
        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>();
        }
Exemple #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         #region free managed resources
         if (mAmbience != null)
         {
             mAmbience.Dispose();
             mAmbience = null;
         }
         #endregion
     }
 }
Exemple #4
0
        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);
        }
Exemple #5
0
 public AmbienceEventArgs(Ambience ambience)
 {
     this.mAmbience = ambience;
 }