using SolidWorks.Interop.sldworks;
|
|
namespace PdmSwPlugin.Main.EventHandler
|
{
|
public class DocViewEventHandler
|
{
|
ISldWorks iSwApp;
|
IEventAttacher userAddin;
|
ModelView mView;
|
BaseEventHandler parent;
|
|
public DocViewEventHandler(IEventAttacher addin, IModelView mv, BaseEventHandler parent)
|
{
|
userAddin = addin;
|
mView = (ModelView)mv;
|
iSwApp = userAddin.SwApp;
|
this.parent = parent;
|
}
|
|
public bool AttachEventHandlers()
|
{
|
mView.DestroyNotify2 += new DModelViewEvents_DestroyNotify2EventHandler(OnDestroy);
|
mView.RepaintNotify += new DModelViewEvents_RepaintNotifyEventHandler(OnRepaint);
|
return true;
|
}
|
|
public bool DetachEventHandlers()
|
{
|
mView.DestroyNotify2 -= new DModelViewEvents_DestroyNotify2EventHandler(OnDestroy);
|
mView.RepaintNotify -= new DModelViewEvents_RepaintNotifyEventHandler(OnRepaint);
|
parent.DetachModelViewEventHandler(mView);
|
return true;
|
}
|
|
//EventHandlers
|
public int OnDestroy(int destroyType)
|
{
|
return 0;
|
}
|
|
public int OnRepaint(int repaintType)
|
{
|
return 0;
|
}
|
}
|
}
|