Browse Source

Add description for attached properties

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/wpfdesigner@6007 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Kumar Devvrat 15 years ago
parent
commit
d6ba95a4b4
  1. 62
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/PropertyDescriptionService.cs

62
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/PropertyDescriptionService.cs

@ -12,29 +12,39 @@ using ICSharpCode.SharpDevelop.Editor.CodeCompletion; @@ -12,29 +12,39 @@ using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
namespace ICSharpCode.WpfDesign.AddIn
{
public class PropertyDescriptionService : IPropertyDescriptionService
{
OpenedFile file;
public PropertyDescriptionService(OpenedFile file)
{
if (file == null)
throw new ArgumentNullException("file");
this.file = file;
}
public object GetDescription(DesignItemProperty property)
{
IProjectContent pc = MyTypeFinder.GetProjectContent(file);
if (pc != null) {
IClass c = pc.GetClassByReflectionName(property.DeclaringType.FullName, true);
if (c != null) {
IMember m = DefaultProjectContent.GetMemberByReflectionName(c, property.Name);
if (m != null)
return CodeCompletionItem.ConvertDocumentation(m.Documentation);
}
}
return null;
}
}
}
public class PropertyDescriptionService : IPropertyDescriptionService
{
OpenedFile file;
public PropertyDescriptionService(OpenedFile file)
{
if (file == null)
throw new ArgumentNullException("file");
this.file = file;
}
public object GetDescription(DesignItemProperty property)
{
IProjectContent pc = MyTypeFinder.GetProjectContent(file);
if (pc != null) {
// For attached Properties
if (property.DependencyFullName != null && property.Name.Contains(".")) {
IClass c = pc.GetClassByReflectionName(property.DependencyProperty.OwnerType.FullName, true);
if (c != null) {
IMember m = DefaultProjectContent.GetMemberByReflectionName(c, property.DependencyProperty.Name + "Property");
if (m != null)
return CodeCompletionItem.ConvertDocumentation(m.Documentation);
}
} else {
IClass c = pc.GetClassByReflectionName(property.DeclaringType.FullName, true);
if (c != null) {
IMember m = DefaultProjectContent.GetMemberByReflectionName(c, property.Name);
if (m != null)
return CodeCompletionItem.ConvertDocumentation(m.Documentation);
}
}
}
return null;
}
}
}
Loading…
Cancel
Save