Browse Source

UDC: add culture, processorArchitecture and number of custom AddIns to environment information

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5426 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
d817a55cfe
  1. 14
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs
  2. 3
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/UsageDataCollector.AddIn.csproj
  3. 4
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs
  4. 15
      src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs
  5. 8
      src/Main/Core/Project/Src/AddInTree/AddInTree.cs

14
src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs

@ -6,11 +6,14 @@ @@ -6,11 +6,14 @@
// </file>
using System;
using System.Linq;
using System.Globalization;
using System.IO;
using System.Threading;
using ICSharpCode.Core;
using ICSharpCode.Core.Services;
using ICSharpCode.SharpDevelop;
using System.Threading;
namespace ICSharpCode.UsageDataCollector
{
@ -83,6 +86,15 @@ namespace ICSharpCode.UsageDataCollector @@ -83,6 +86,15 @@ namespace ICSharpCode.UsageDataCollector
session.OnException = MessageService.ShowException;
session.AddEnvironmentData("appVersion", RevisionClass.FullVersion);
session.AddEnvironmentData("language", ResourceService.Language);
session.AddEnvironmentData("culture", CultureInfo.CurrentCulture.Name);
string PROCESSOR_ARCHITECTURE = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432");
if (string.IsNullOrEmpty(PROCESSOR_ARCHITECTURE)) {
PROCESSOR_ARCHITECTURE = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
}
if (!string.IsNullOrEmpty(PROCESSOR_ARCHITECTURE)) {
session.AddEnvironmentData("architecture", PROCESSOR_ARCHITECTURE);
}
session.AddEnvironmentData("userAddInCount", AddInTree.AddIns.Where(a => !a.IsPreinstalled).Count().ToString());
sessionOpened = true;
} catch (IncompatibleDatabaseException ex) {
if (ex.ActualVersion < ex.ExpectedVersion) {

3
src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/UsageDataCollector.AddIn.csproj

@ -43,6 +43,9 @@ @@ -43,6 +43,9 @@
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase">

4
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs

@ -108,7 +108,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -108,7 +108,7 @@ namespace ICSharpCode.AvalonEdit.Document
#endregion
#region Text
void VerifyRange(int offset, int length)
void ThrowIfRangeInvalid(int offset, int length)
{
if (offset < 0 || offset > rope.Length) {
throw new ArgumentOutOfRangeException("offset", offset, "0 <= offset <= " + rope.Length.ToString(CultureInfo.InvariantCulture));
@ -544,7 +544,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -544,7 +544,7 @@ namespace ICSharpCode.AvalonEdit.Document
try {
// The range verification must wait until after the BeginUpdate() call because the document
// might be modified inside the UpdateStarted event.
VerifyRange(offset, length);
ThrowIfRangeInvalid(offset, length);
DoReplace(offset, length, text, offsetChangeMap);
} finally {

15
src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs

@ -276,5 +276,20 @@ namespace ICSharpCode.Core @@ -276,5 +276,20 @@ namespace ICSharpCode.Core
throw new AddInLoadException("Can't load " + fileName, e);
}
}
/// <summary>
/// Gets whether the AddIn is a preinstalled component of the host application.
/// </summary>
public bool IsPreinstalled {
get {
if (FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, this.FileName)) {
string hidden = this.Properties["addInManagerHidden"];
return string.Equals(hidden, "true", StringComparison.OrdinalIgnoreCase)
|| string.Equals(hidden, "preinstalled", StringComparison.OrdinalIgnoreCase);
} else {
return false;
}
}
}
}
}

8
src/Main/Core/Project/Src/AddInTree/AddInTree.cs

@ -45,11 +45,9 @@ namespace ICSharpCode.Core @@ -45,11 +45,9 @@ namespace ICSharpCode.Core
System.Text.StringBuilder sb = new System.Text.StringBuilder();
foreach (AddIn addIn in AddIns) {
// Skip preinstalled AddIns (show only third party AddIns)
if (FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, addIn.FileName)) {
string hidden = addIn.Properties["addInManagerHidden"];
if (string.Equals(hidden, "true", StringComparison.OrdinalIgnoreCase) || string.Equals(hidden, "preinstalled", StringComparison.OrdinalIgnoreCase))
continue;
}
if (addIn.IsPreinstalled)
continue;
if (sb.Length > 0) sb.Append(", ");
sb.Append("[");
sb.Append(addIn.Name);

Loading…
Cancel
Save