Browse Source

Merge branch 'newNR' of github.com:icsharpcode/SharpDevelop into newNR

pull/32/merge
Daniel Grunwald 12 years ago
parent
commit
f9706b6e27
  1. 2
      data/resources/StringResources.fr.resx
  2. 72
      data/resources/StringResources.it.resx
  3. 3
      data/resources/StringResources.resx
  4. 2
      data/resources/StringResources.ru.resx
  5. 15
      data/resources/StringResources.tr.resx
  6. 10
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/Extensions.cs
  7. 92
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/QualifiedNameWithLocation.cs
  8. 7
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBinding.csproj
  9. 14
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionSettings.cs
  10. 54
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlExpressionContext.cs
  11. 6
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlSymbolSearch.cs
  12. 27
      src/Main/Base/Project/Src/Commands/FileCommands.cs
  13. 26
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

2
data/resources/StringResources.fr.resx

@ -2371,7 +2371,7 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value>
<value>Tout processeur</value> <value>Tout processeur</value>
</data> </data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve"> <data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>x86/x64 - préfère 64 bits</value> <value>x86/x64 - préfère 32 bits</value>
</data> </data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve"> <data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>x86/x64 - préfère 64 bits</value> <value>x86/x64 - préfère 64 bits</value>

72
data/resources/StringResources.it.resx

@ -1502,6 +1502,9 @@ Ad esempio: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.HighlightingEditor.NotSupportedMessage" xml:space="preserve"> <data name="Dialog.HighlightingEditor.NotSupportedMessage" xml:space="preserve">
<value>Versione delle impostazioni non supportata!</value> <value>Versione delle impostazioni non supportata!</value>
</data> </data>
<data name="Dialog.HighlightingEditor.OverwriteCustomizationsMessage" xml:space="preserve">
<value>Questo comando elimina tutte le personalizzazioni prima di importare i files selezionati. Continuare?</value>
</data>
<data name="Dialog.HighlightingEditor.Properties.Value" xml:space="preserve"> <data name="Dialog.HighlightingEditor.Properties.Value" xml:space="preserve">
<value>Valore</value> <value>Valore</value>
</data> </data>
@ -1863,6 +1866,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve">
<value>Debugging</value> <value>Debugging</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Attiva decompilatore</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Attiva Modifica e Continua</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>Eccezioni</value> <value>Eccezioni</value>
</data> </data>
@ -1893,6 +1902,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Salta le proprietà su linea singola</value> <value>Salta le proprietà su linea singola</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>Salta ottimizzazione JIT</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>Salta ottimizzazione NGEN</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Simboli</value> <value>Simboli</value>
</data> </data>
@ -2353,6 +2368,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any" xml:space="preserve"> <data name="Dialog.ProjectOptions.Build.TargetCPU.Any" xml:space="preserve">
<value>Qualsiasi processore</value> <value>Qualsiasi processore</value>
</data> </data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>Quasiasi processore (preferisci 32-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>Qualsiasi processore (preferisci 64-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Itanium" xml:space="preserve"> <data name="Dialog.ProjectOptions.Build.TargetCPU.Itanium" xml:space="preserve">
<value>Processore Intel 64-bit Itanium</value> <value>Processore Intel 64-bit Itanium</value>
</data> </data>
@ -2707,6 +2728,9 @@ Puoi anche scegliere di memorizzare le impostazioni in un file .user invece che
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve"> <data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Sorgente</value> <value>Sorgente</value>
</data> </data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Avanzate</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve"> <data name="Global.AbortButtonText" xml:space="preserve">
<value>Annulla</value> <value>Annulla</value>
</data> </data>
@ -4017,6 +4041,12 @@ Sono ammesse solo lettere, numeri, spazi, '.' o '_'.</value>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.Culture.Description" xml:space="preserve"> <data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.Culture.Description" xml:space="preserve">
<value>La cultura supportata dal riferimento</value> <value>La cultura supportata dal riferimento</value>
</data> </data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.EmbedInteropTypes" xml:space="preserve">
<value>Incorpora tipi COM</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.EmbedInteropTypes.Description" xml:space="preserve">
<value>Specifica quale tipi COM presenti nell'assembly referenziato devono essere incorportati nell'assembly di destinazione.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.LocalCopy" xml:space="preserve"> <data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.LocalCopy" xml:space="preserve">
<value>Copia locale</value> <value>Copia locale</value>
</data> </data>
@ -4038,6 +4068,9 @@ Sono ammesse solo lettere, numeri, spazi, '.' o '_'.</value>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly" xml:space="preserve"> <data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly" xml:space="preserve">
<value>Referenzia assembly</value> <value>Referenzia assembly</value>
</data> </data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly.Description" xml:space="preserve">
<value>Se impostato a falso, questo riferimento implica solo una dipendenza nella sequenza di compilazione e non un riferimento all'assembly.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.SpecificVersion" xml:space="preserve"> <data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.SpecificVersion" xml:space="preserve">
<value>Versione Specifica</value> <value>Versione Specifica</value>
</data> </data>
@ -5400,6 +5433,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="PortableLibrary.CouldNotFindTools" xml:space="preserve"> <data name="PortableLibrary.CouldNotFindTools" xml:space="preserve">
<value>Impossibile trovare gli strumenti per Libreria di Classi Portabile</value> <value>Impossibile trovare gli strumenti per Libreria di Classi Portabile</value>
</data> </data>
<data name="PortableLibrary.PortableSubset" xml:space="preserve">
<value>Sottoinsieme Portabile .NET</value>
</data>
<data name="PortableLibrary.SelectAtLeastTwoFrameworks" xml:space="preserve"> <data name="PortableLibrary.SelectAtLeastTwoFrameworks" xml:space="preserve">
<value>Selezionare almeno 2 frameworks.</value> <value>Selezionare almeno 2 frameworks.</value>
</data> </data>
@ -6401,6 +6437,24 @@ SharpDevelop 2 compila le risorse differentemente: il nome della risorsa non è
<data name="Templates.File.NAnt.NAntBuildFile.Name" xml:space="preserve"> <data name="Templates.File.NAnt.NAntBuildFile.Name" xml:space="preserve">
<value>File di Build NAnt</value> <value>File di Build NAnt</value>
</data> </data>
<data name="Templates.File.PRISMViewAndViewModelUnity.Description" xml:space="preserve">
<value>Crea una Vista per un Modulo PRISM ed il relativo Modello</value>
</data>
<data name="Templates.File.PRISMViewAndViewModelUnity.Name" xml:space="preserve">
<value>Vista PRISM e Modello (Unity)</value>
</data>
<data name="Templates.File.PRISMViewModelUnity.Description" xml:space="preserve">
<value>Crea un modello per un Modulo PRISM</value>
</data>
<data name="Templates.File.PRISMViewModelUnity.Name" xml:space="preserve">
<value>Modello PRISM (Unity)</value>
</data>
<data name="Templates.File.PRISMViewUnity.Description" xml:space="preserve">
<value>Crea una Vista per un Modulo PRISM</value>
</data>
<data name="Templates.File.PRISMViewUnity.Name" xml:space="preserve">
<value>Vista PRISM (Unity)</value>
</data>
<data name="Templates.File.Properties.AddIFDEFTest" xml:space="preserve"> <data name="Templates.File.Properties.AddIFDEFTest" xml:space="preserve">
<value>Aggiunge '#if TEST ... #endif'</value> <value>Aggiunge '#if TEST ... #endif'</value>
</data> </data>
@ -6671,6 +6725,24 @@ SharpDevelop 2 compila le risorse differentemente: il nome della risorsa non è
<data name="Templates.Project.PortableLibrary.Name" xml:space="preserve"> <data name="Templates.Project.PortableLibrary.Name" xml:space="preserve">
<value>Libreria di classi portabile</value> <value>Libreria di classi portabile</value>
</data> </data>
<data name="Templates.Project.PRISMApplicationSmallUnity.Description" xml:space="preserve">
<value>Crea una piccola Applicazione Prism con Avvio e Infrastruttura</value>
</data>
<data name="Templates.Project.PRISMApplicationSmallUnity.Name" xml:space="preserve">
<value>Applicazione PRISM - piccola (Unity)</value>
</data>
<data name="Templates.Project.PRISMApplicationUnity.Description" xml:space="preserve">
<value>Crea una Applicazione PRISM con Avvio e Infrastruttura</value>
</data>
<data name="Templates.Project.PRISMApplicationUnity.Name" xml:space="preserve">
<value>Applicazione PRISM (Unity)</value>
</data>
<data name="Templates.Project.PRISMModuleUnity.Description" xml:space="preserve">
<value>Crea un Modulo PRISM con una Vista e relativo Modulo</value>
</data>
<data name="Templates.Project.PRISMModuleUnity.Name" xml:space="preserve">
<value>Modulo PRISM (Unity)</value>
</data>
<data name="Templates.Project.SetupProject.Description" xml:space="preserve"> <data name="Templates.Project.SetupProject.Description" xml:space="preserve">
<value>Un progetto Windows Installer per creare file di installazione MSI.</value> <value>Un progetto Windows Installer per creare file di installazione MSI.</value>
</data> </data>

3
data/resources/StringResources.resx

@ -6111,6 +6111,9 @@ Removed the end part of the original message ", reason '${Message}'" since this
<data name="SharpDevelop.FileFilter.AllFiles" xml:space="preserve"> <data name="SharpDevelop.FileFilter.AllFiles" xml:space="preserve">
<value>All files (*.*)</value> <value>All files (*.*)</value>
</data> </data>
<data name="SharpDevelop.FileFilter.AllKnownFiles" xml:space="preserve">
<value>All known file extensions</value>
</data>
<data name="SharpDevelop.FileFilter.AssemblyFiles" xml:space="preserve"> <data name="SharpDevelop.FileFilter.AssemblyFiles" xml:space="preserve">
<value>Assembly Files (*.exe;*.dll)</value> <value>Assembly Files (*.exe;*.dll)</value>
</data> </data>

2
data/resources/StringResources.ru.resx

@ -5116,7 +5116,7 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<value>Текущий метод</value> <value>Текущий метод</value>
</data> </data>
<data name="SharpDevelop.Refactoring.DeclaringType" xml:space="preserve"> <data name="SharpDevelop.Refactoring.DeclaringType" xml:space="preserve">
<value>Текларирующий тип</value> <value>Декларирующий тип</value>
</data> </data>
<data name="SharpDevelop.Refactoring.ExpandAutomaticProperty" xml:space="preserve"> <data name="SharpDevelop.Refactoring.ExpandAutomaticProperty" xml:space="preserve">
<value>Развернуть автосвойство</value> <value>Развернуть автосвойство</value>

15
data/resources/StringResources.tr.resx

@ -1871,6 +1871,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz?</value>
<data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve">
<value>Hata ayıklama</value> <value>Hata ayıklama</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Tekrar derlemeyi etkinleştir</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Düzenle ve Devam eti Etkinleştir</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>İstisnalar</value> <value>İstisnalar</value>
</data> </data>
@ -1901,6 +1907,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz?</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Tek satır özellikleri üzerinden Adımla</value> <value>Tek satır özellikleri üzerinden Adımla</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>JIT optimizasyonunu engelle</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>NGEN optimizasyonunu engelle</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Semboller</value> <value>Semboller</value>
</data> </data>
@ -2720,6 +2732,9 @@ Ayrıca bir ayarı proje dosyası yerine kullanıcı dosyası(.user-file) içind
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve"> <data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Kaynak</value> <value>Kaynak</value>
</data> </data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Gelişmiş</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve"> <data name="Global.AbortButtonText" xml:space="preserve">
<value>Başarısız</value> <value>Başarısız</value>
</data> </data>

10
src/AddIns/BackendBindings/XamlBinding/XamlBinding/Extensions.cs

@ -160,16 +160,6 @@ namespace ICSharpCode.XamlBinding
return items.Concat(addItems); return items.Concat(addItems);
} }
public static QualifiedNameWithLocation ToQualifiedName(this AXmlAttribute thisValue)
{
return new QualifiedNameWithLocation(thisValue.LocalName, thisValue.Namespace, thisValue.Prefix, thisValue.StartOffset);
}
public static QualifiedNameWithLocation ToQualifiedName(this AXmlElement thisValue)
{
return new QualifiedNameWithLocation(thisValue.LocalName, thisValue.Namespace, thisValue.Prefix, thisValue.StartOffset);
}
public static string GetWordBeforeCaretExtended(this ITextEditor editor) public static string GetWordBeforeCaretExtended(this ITextEditor editor)
{ {
IDocumentLine line = editor.Document.GetLine(editor.Caret.Line); IDocumentLine line = editor.Document.GetLine(editor.Caret.Line);

92
src/AddIns/BackendBindings/XamlBinding/XamlBinding/QualifiedNameWithLocation.cs

@ -1,92 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.XmlEditor;
using System;
using ICSharpCode.NRefactory;
namespace ICSharpCode.XamlBinding
{
/// <summary>
/// Description of QualifiedNameWithLocation.
/// </summary>
public class QualifiedNameWithLocation : IEquatable<QualifiedNameWithLocation> {
public QualifiedName QualifiedName { get; private set; }
public int Offset { get; private set; }
public string Name {
get {
return QualifiedName.Name;
}
}
public string Namespace {
get {
return QualifiedName.Namespace;
}
}
public string Prefix {
get {
return QualifiedName.Prefix;
}
}
public string FullXmlName {
get {
string name = Prefix;
if (!string.IsNullOrEmpty(name))
name += ":";
name += Name;
return name;
}
}
public QualifiedNameWithLocation(string localName, string namespaceName, string prefix, int offset) {
QualifiedName = new QualifiedName(localName, namespaceName, prefix);
Offset = offset;
}
public override bool Equals(object obj)
{
return Equals(obj as QualifiedNameWithLocation);
}
public override int GetHashCode()
{
return QualifiedName.GetHashCode() ^ Offset.GetHashCode();
}
public bool Equals(QualifiedNameWithLocation other)
{
if (other == null)
return false;
return other.QualifiedName == QualifiedName &&
other.Offset == Offset;
}
public static bool operator ==(QualifiedNameWithLocation lhs, QualifiedNameWithLocation rhs)
{
if ((object)lhs == null && (object)rhs == null)
return true;
if ((object)lhs == null)
return false;
return lhs.Equals(rhs);
}
public static bool operator !=(QualifiedNameWithLocation lhs, QualifiedNameWithLocation rhs)
{
return !(lhs == rhs);
}
public override string ToString()
{
return this.QualifiedName + " Offset: " + Offset;
}
}
}

7
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBinding.csproj

@ -46,10 +46,6 @@
<Reference Include="PresentationFramework"> <Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework> <RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="Rhino.Mocks">
<HintPath>..\..\..\..\Libraries\RhinoMocks\Rhino.Mocks.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>3.5</RequiredTargetFramework>
@ -104,16 +100,13 @@
<Compile Include="PropertyPathParser.cs" /> <Compile Include="PropertyPathParser.cs" />
<Compile Include="PropertyPathSegment.cs" /> <Compile Include="PropertyPathSegment.cs" />
<Compile Include="PropertyPathTokenizer.cs" /> <Compile Include="PropertyPathTokenizer.cs" />
<Compile Include="QualifiedNameWithLocation.cs" />
<Compile Include="SegmentKind.cs" /> <Compile Include="SegmentKind.cs" />
<Compile Include="Utils.cs"> <Compile Include="Utils.cs">
</Compile> </Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XamlBehavior.cs" /> <Compile Include="XamlBehavior.cs" />
<Compile Include="XamlCompletionItemList.cs" /> <Compile Include="XamlCompletionItemList.cs" />
<Compile Include="XamlCompletionSettings.cs" />
<Compile Include="XamlContext.cs" /> <Compile Include="XamlContext.cs" />
<Compile Include="XamlExpressionContext.cs" />
<Compile Include="MarkupExtensionParseException.cs"> <Compile Include="MarkupExtensionParseException.cs">
</Compile> </Compile>
<Compile Include="XamlLanguageBinding.cs" /> <Compile Include="XamlLanguageBinding.cs" />

14
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionSettings.cs

@ -1,14 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.XamlBinding
{
public class XamlCompletionSettings
{
public XamlCompletionSettings()
{
}
}
}

54
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlExpressionContext.cs

@ -1,54 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Text;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.XmlEditor;
namespace ICSharpCode.XamlBinding
{
/// <summary>
/// Represents the context of a location in a XAML document.
/// </summary>
public sealed class XamlExpressionContext
{
public static readonly XamlExpressionContext Empty = new XamlExpressionContext(new XmlElementPath(), null, false);
public XmlElementPath ElementPath { get; private set; }
public string AttributeName { get; private set; }
public bool InAttributeValue { get; private set; }
public XamlExpressionContext(XmlElementPath elementPath, string attributeName, bool inAttributeValue)
{
if (elementPath == null)
throw new ArgumentNullException("elementPath");
this.ElementPath = elementPath;
this.AttributeName = attributeName;
this.InAttributeValue = inAttributeValue;
}
public override string ToString()
{
StringBuilder b = new StringBuilder();
b.Append("[XamlExpressionContext ");
for (int i = 0; i < ElementPath.Elements.Count; i++) {
if (i > 0) b.Append(">");
if (!string.IsNullOrEmpty(ElementPath.Elements[i].Prefix)) {
b.Append(ElementPath.Elements[i].Prefix);
b.Append(':');
}
b.Append(ElementPath.Elements[i].Name);
}
if (AttributeName != null) {
b.Append(" AttributeName=");
b.Append(AttributeName);
if (InAttributeValue) {
b.Append(" InAttributeValue");
}
}
b.Append("]");
return b.ToString();
}
}
}

6
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlSymbolSearch.cs

@ -35,10 +35,12 @@ namespace ICSharpCode.XamlBinding
public XamlSymbolSearch(IProject project, IEntity entity) public XamlSymbolSearch(IProject project, IEntity entity)
{ {
this.entity = entity;
compilation = SD.ParserService.GetCompilation(project); compilation = SD.ParserService.GetCompilation(project);
this.entity = compilation.Import(entity);
interestingFileNames = new List<FileName>(); interestingFileNames = new List<FileName>();
foreach (var item in project.ParentSolution.Projects.SelectMany(p => p.Items).OfType<FileProjectItem>().Where(i => i.FileName.HasExtension(".xaml"))) if (this.entity == null)
return;
foreach (var item in project.Items.OfType<FileProjectItem>().Where(i => i.FileName.HasExtension(".xaml")))
interestingFileNames.Add(item.FileName); interestingFileNames.Add(item.FileName);
workAmount = interestingFileNames.Count; workAmount = interestingFileNames.Count;
workAmountInverse = 1.0 / workAmount; workAmountInverse = 1.0 / workAmount;

27
src/Main/Base/Project/Src/Commands/FileCommands.cs

@ -218,31 +218,8 @@ namespace ICSharpCode.SharpDevelop.Commands
using (OpenFileDialog fdiag = new OpenFileDialog()) { using (OpenFileDialog fdiag = new OpenFileDialog()) {
fdiag.AddExtension = true; fdiag.AddExtension = true;
var fileFilters = ProjectService.GetFileFilters(); fdiag.Filter = ProjectService.GetAllFilesFilter();
fdiag.Filter = String.Join("|", fileFilters); fdiag.FilterIndex = 0;
bool foundFilter = false;
// search filter like in the current open file
if (!foundFilter) {
IViewContent content = SD.Workbench.ActiveViewContent;
if (content != null) {
string extension = Path.GetExtension(content.PrimaryFileName);
if (string.IsNullOrEmpty(extension) == false) {
for (int i = 0; i < fileFilters.Count; ++i) {
if (fileFilters[i].ContainsExtension(extension)) {
fdiag.FilterIndex = i + 1;
foundFilter = true;
break;
}
}
}
}
}
if (!foundFilter) {
fdiag.FilterIndex = fileFilters.Count;
}
fdiag.Multiselect = true; fdiag.Multiselect = true;
fdiag.CheckFileExists = true; fdiag.CheckFileExists = true;

26
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -114,6 +114,32 @@ namespace ICSharpCode.SharpDevelop.Project
return AddInTree.BuildItems<FileFilterDescriptor>("/SharpDevelop/Workbench/FileFilter", null); return AddInTree.BuildItems<FileFilterDescriptor>("/SharpDevelop/Workbench/FileFilter", null);
} }
/// <summary>
/// Returns a File Dialog filter that can be used to filter on all registered file formats
/// </summary>
public static string GetAllFilesFilter()
{
IEnumerable<FileFilterDescriptor> filters = GetFileFilters();
StringBuilder b = new StringBuilder(StringParser.Parse("${res:SharpDevelop.FileFilter.AllKnownFiles} (*.cs, *.vb, ...)|"));
bool first = true;
foreach (var filter in filters) {
string ext = filter.Extensions;
if (ext != "*.*" && ext.Length > 0) {
if (!first) {
b.Append(';');
} else {
first = false;
}
b.Append(ext);
}
}
foreach (var filter in filters) {
b.Append('|');
b.Append(filter.ToString());
}
return b.ToString();
}
/// <summary> /// <summary>
/// Returns a File Dialog filter that can be used to filter on all registered project formats /// Returns a File Dialog filter that can be used to filter on all registered project formats
/// </summary> /// </summary>

Loading…
Cancel
Save