在《ArcGIS Engine+C#实例开发教程》第三讲 MapControl与PageLayoutControl同步中
在《ArcGISEngine+C#实例开发教程》第三讲MapControl与PageLayoutControl同步中激活MapControl并解除thePagleLayo...
在《ArcGIS Engine+C#实例开发教程》第三讲 MapControl与PageLayoutControl同步中 激活MapControl并解除the PagleLayoutControl,这句 this.SetBuddies(m_mapControl.Object);总是不对。错误提示:
错误5“arc1.ControlsSynchronizer”不包含“SetBuddies”的定义,并且找不到可接受类型为“arc1.ControlsSynchronizer”的第一个参数的扩展方法“SetBuddies”(是否缺少 using 指令或程序集引用?) 如何解决????? 展开
错误5“arc1.ControlsSynchronizer”不包含“SetBuddies”的定义,并且找不到可接受类型为“arc1.ControlsSynchronizer”的第一个参数的扩展方法“SetBuddies”(是否缺少 using 指令或程序集引用?) 如何解决????? 展开
1个回答
展开全部
private void SetBuddies(object buddy)
{
try
{
if (buddy == null)
throw new Exception("ControlsSynchronizer::SetBuddies:\r\nTarget Buddy Control is not initialized!");
foreach (object obj in m_frameworkControls)
{
if (obj is IToolbarControl)
{
((IToolbarControl)obj).SetBuddyControl(buddy);
}
else if (obj is ITOCControl)
{
((ITOCControl)obj).SetBuddyControl(buddy);
}
}
}
catch (Exception ex)
{
throw new Exception(string.Format("ControlsSynchronizer::SetBuddies:\r\n{0}", ex.Message));
}
}
{
try
{
if (buddy == null)
throw new Exception("ControlsSynchronizer::SetBuddies:\r\nTarget Buddy Control is not initialized!");
foreach (object obj in m_frameworkControls)
{
if (obj is IToolbarControl)
{
((IToolbarControl)obj).SetBuddyControl(buddy);
}
else if (obj is ITOCControl)
{
((ITOCControl)obj).SetBuddyControl(buddy);
}
}
}
catch (Exception ex)
{
throw new Exception(string.Format("ControlsSynchronizer::SetBuddies:\r\n{0}", ex.Message));
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询