我希望能够验证用户是否正在寻找有效的拖放并通过目标CompartmentShape的颜色指示,我已经完成了以下操作,这使我能够正确验证,我只是需要更新用户界面
public override void OnDragDrop(DslDiagrams.DiagramDragEventArgs e)
{
BCSDataSourceTypes dataSourceType = GetDataSourceType(e.Data);
if (dataSourceType == BCSDataSourceTypes.Unknown)
{
return;
}
FieldInfo info = e.Data.GetType().GetField("innerData", BindingFlags.NonPublic | BindingFlags.Instance);
object obj = info.GetValue(e.Data);
info = obj.GetType().GetField("innerData", BindingFlags.NonPublic | BindingFlags.Instance);
System.Windows.DataObject dataObj = info.GetValue(obj) as System.Windows.DataObject;
if (dataObj != null)
{
SqlStoredProcedure storedProcedure = dataObj.GetData(typeof(SqlStoredProcedure)) as SqlStoredProcedure;
if (storedProcedure != null)
{
MessageBox.Show(string.Format("{0} is valid here", storedProcedure.Name));
}
}
e.Handled = true;
}
我的问题是我无法参考大纲颜色,非常感谢任何帮助。
答案 0 :(得分:2)