Browse Source

Added some comments.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3954 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
970d46507d
  1. 3
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlClassReturnType.cs
  2. 16
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompilationUnit.cs
  3. 11
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/documentation/TextRendering.xml
  4. 4
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ClassFinder.cs
  5. 21
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/ParseInformation.cs

3
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlClassReturnType.cs

@ -11,7 +11,8 @@ using ICSharpCode.SharpDevelop.Dom; @@ -11,7 +11,8 @@ using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.XamlBinding
{
/// <summary>
/// Description of XamlClassReturnType.
/// IReturnType that gets created by XamlCompilationUnit.CreateType and will
/// run XamlCompilationUnit.FindType on demand.
/// </summary>
public class XamlClassReturnType : ProxyReturnType
{

16
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompilationUnit.cs

@ -22,6 +22,12 @@ namespace ICSharpCode.XamlBinding @@ -22,6 +22,12 @@ namespace ICSharpCode.XamlBinding
{
}
/// <summary>
/// Creates a IReturnType looking for a class referenced in XAML.
/// </summary>
/// <param name="xmlNamespace">The XML namespace</param>
/// <param name="className">The class name</param>
/// <returns>A new IReturnType that will search the referenced type on demand.</returns>
public IReturnType CreateType(string xmlNamespace, string className)
{
if (xmlNamespace.StartsWith("clr-namespace:")) {
@ -49,6 +55,12 @@ namespace ICSharpCode.XamlBinding @@ -49,6 +55,12 @@ namespace ICSharpCode.XamlBinding
return namespaceName;
}
/// <summary>
/// Finds a type referenced in XAML.
/// </summary>
/// <param name="xmlNamespace">The XML namespace</param>
/// <param name="className">The class name</param>
/// <returns>Returns the referenced type, or null if it cannot be found.</returns>
public IReturnType FindType(string xmlNamespace, string className)
{
return FindType(this.ProjectContent, xmlNamespace, className);
@ -80,7 +92,7 @@ namespace ICSharpCode.XamlBinding @@ -80,7 +92,7 @@ namespace ICSharpCode.XamlBinding
{
foreach (IAttribute att in projectContent.GetAssemblyAttributes()) {
if (att.PositionalArguments.Count == 2
&& att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute") {
&& att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute") {
string namespaceName = att.PositionalArguments[1] as string;
if (xmlNamespace.Equals(att.PositionalArguments[0]) && namespaceName != null) {
IClass c = projectContent.GetClass(namespaceName + "." + className, 0);
@ -115,7 +127,7 @@ namespace ICSharpCode.XamlBinding @@ -115,7 +127,7 @@ namespace ICSharpCode.XamlBinding
{
foreach (IAttribute att in projectContent.GetAssemblyAttributes()) {
if (att.PositionalArguments.Count == 2
&& att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute") {
&& att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute") {
string namespaceName = att.PositionalArguments[1] as string;
if (xmlNamespace.Equals(att.PositionalArguments[0]) && namespaceName != null) {
projectContent.AddNamespaceContents(list, namespaceName, projectContent.Language, false);

11
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/documentation/TextRendering.xml

@ -86,8 +86,15 @@ @@ -86,8 +86,15 @@
must not add elements, but they may split existing elements, e.g. to colorize only parts of an
element. When splitting elements (or somehow modifying the elements collection), care must be taken
that the VisualColumn,VisualLine,RelativeTextOffset and DocumentLength properties stay correct.
The ColorizingTransformer base class can do this so that transformers don't have to implement the
splitting themselves.
</para>
<para>
The ColorizingTransformer base class provides helper methods for splitting, so the derived class
can simply say "color this section in that color".
</para>
<para>
The DocumentColorizingTransformer extends the ColorizingTransformer and additionally
allows highlighting on per DocumentLine, coloring text segments (instead of directly
working with visual line elements).
</para>
</content>
</section>

4
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ClassFinder.cs

@ -76,6 +76,10 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -76,6 +76,10 @@ namespace ICSharpCode.SharpDevelop.Dom
public ClassFinder(IClass callingClass, int caretLine, int caretColumn)
{
if (callingClass == null)
throw new ArgumentNullException("callingClass");
if (callingClass is CompoundClass)
throw new ArgumentException("Cannot use compound class for ClassFinder - must pass a specific class part.");
this.caretLine = caretLine;
this.caretColumn = caretColumn;
this.callingClass = callingClass;

21
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/ParseInformation.cs

@ -11,9 +11,28 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -11,9 +11,28 @@ namespace ICSharpCode.SharpDevelop.Dom
{
public class ParseInformation
{
/// <summary>
/// Gets the last compilation unit that was valid (=no parse errors).
/// This property might be null.
/// </summary>
public ICompilationUnit ValidCompilationUnit { get; private set; }
/// <summary>
/// Gets the last compilation unit that was invalid (=had parse errors).
/// This property is null if the most recent compilation unit is valid.
/// </summary>
public ICompilationUnit DirtyCompilationUnit { get; private set; }
/// <summary>
/// Gets the best compilation unit.
/// This returns the ValidCompilationUnit if one exists, otherwise
/// the DirtyCompilationUnit.
/// </summary>
public ICompilationUnit BestCompilationUnit { get; private set; }
/// <summary>
/// Gets the most recent compilation unit. The unit might be valid or invalid.
/// </summary>
public ICompilationUnit MostRecentCompilationUnit { get; private set; }
public ParseInformation() {}
@ -32,6 +51,8 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -32,6 +51,8 @@ namespace ICSharpCode.SharpDevelop.Dom
/// </summary>
public void SetCompilationUnit(ICompilationUnit unit)
{
if (unit == null)
throw new ArgumentNullException("unit");
lock (this) {
MostRecentCompilationUnit = unit;
if (unit.ErrorsDuringCompile) {

Loading…
Cancel
Save