//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, SH Software Co. Ltd. // = FileName : PushProperty.cpp // = Version : ver2.0 // = Author : zjq // = CreateDate : 2002-09-09 // = Description: 属性类的定义 // = Maintainers: // //-----------------------------------------------------------------------------+ #include "StdAfx.h" #include "PushProperty.h" #include "XAcGiViewDraw.h" #include "XMasterProperties.h" PushProperty::PushProperty(const AcDbEntity *ent, XExplodeDraw &dc) { ASSERT(ent); dc.BackUpProperties(m_prop); m_pDC = &dc; XMasterProperties prop; if (_tcsicmp(dc.Desc(), XAcGiViewDraw::Descriptor()) == 0) { prop.SetFromEx(ent); } else { prop.SetFrom(ent); } dc.RestoreProperties(prop); } PushProperty::PushProperty(XExplodeDraw &dc) { dc.BackUpProperties(m_prop); m_pDC = &dc; } PushProperty::~PushProperty() { if (m_pDC) { m_pDC->RestoreProperties(m_prop); } }