i can't drop a rfa files after i canceled in Revit site component
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am creating a Revit plugin and i used WPF for dock able panels. In my local computer i have some plants (*.rfa files). In my project i am dragging and dropping the rfa file from WPF to Revit Site component. First time its working fine. but after i drag and dropped and canceled it. After that i tired again the same file I can drag, but while dropping its disappeared. If i create new project or open project. its working normally. Problem is within the project.
My drag method :
private void grdPlants_MouseLeave(object sender, MouseEventArgs e)
{
try
{
if (!AppData.IsLoggedIn)
{
AppData.HidePanelEvent.Raise();
return;
}
draggedPlant = (PlantsWithTagName)grdPlants.SelectedItem;
if (clickCount == 1 && draggedPlant != null)
{
string path = GetRFAFilePath(draggedPlant.id);
AppData.SelectedPlantId = draggedPlant.id;
if (!string.IsNullOrEmpty(path))
{
FileInfo fileInfo = new FileInfo(path);
if (fileInfo.Exists)
{
DataObject myDataObject = new DataObject();
StringCollection coll = new StringCollection
{
fileInfo.FullName
};
myDataObject.SetFileDropList(coll);
if (doc != null)
{
DragDrop.DoDragDrop(grdPlants, myDataObject, DragDropEffects.Copy);
}
ClearErrors();
}
else
{
ShowError(PlanterPlugin.Properties.Resources.PLANT_NOT_LINKED, false, true);
}
}
else
{
openWindows["plant_details"].Activate();
}
clickCount = 0;
}
}
catch (Exception ex)
{
Logger.Write(ex);
}
}