Browse Source

Fixed ComponentInspector sample.

pull/297/head
Andreas Weizel 12 years ago
parent
commit
e20c3e3898
  1. 7
      samples/ComponentInspector/ComponentInspector.AddIn/ComponentInspector.AddIn.csproj
  2. 2
      samples/ComponentInspector/ComponentInspector.AddIn/ComponentInspector.addin
  3. 1
      samples/ComponentInspector/ComponentInspector.AddIn/Src/ComponentInspectorView.cs
  4. 5
      samples/ComponentInspector/ComponentInspector.AddIn/Src/ShowComponentInspectorCommand.cs
  5. 6
      samples/ComponentInspector/ComponentInspector.Core/ComponentInspector.Core.csproj
  6. 3
      samples/ComponentInspector/ComponentInspector.Core/Src/Controls/ErrorDialog.cs
  7. 20
      samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/ComponentInspectorProperties.cs
  8. 4
      samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/PreviouslyOpenedAssemblyCollection.cs
  9. 4
      samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/PreviouslyOpenedTypeLibraryCollection.cs
  10. 4
      samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/SavedCastInfoCollection.cs
  11. 14
      samples/ComponentInspector/ComponentInspector.sln
  12. 19
      samples/ComponentInspector/ComponentInspector/ComponentInspector.csproj
  13. 19
      samples/ComponentInspector/ComponentInspector/Src/ComponentInspectorApplication.cs
  14. 75
      samples/ComponentInspector/ComponentInspector/Src/PropertyService.cs
  15. 7
      samples/ComponentInspector/ComponentInspector/app.config
  16. 4
      src/Automated.proj

7
samples/ComponentInspector/ComponentInspector.AddIn/ComponentInspector.AddIn.csproj

@ -15,8 +15,9 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
@ -45,7 +46,7 @@
</Reference> </Reference>
<Reference Include="ICSharpCode.SharpDevelop"> <Reference Include="ICSharpCode.SharpDevelop">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath> <HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath>
<Private>False</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />

2
samples/ComponentInspector/ComponentInspector.AddIn/ComponentInspector.addin

@ -16,7 +16,7 @@
<Import assembly="ComponentInspector.AddIn.dll"/> <Import assembly="ComponentInspector.AddIn.dll"/>
</Runtime> </Runtime>
<Path name="/Workspace/Tools"> <Path name="/SharpDevelop/Workbench/Tools">
<MenuItem id="ShowComponentInspector" <MenuItem id="ShowComponentInspector"
insertafter="ShowAddInScout" insertafter="ShowAddInScout"
label="${res:ComponentInspector.ToolsMenu.ShowComponentInspectorMenuItem}" label="${res:ComponentInspector.ToolsMenu.ShowComponentInspectorMenuItem}"

1
samples/ComponentInspector/ComponentInspector.AddIn/Src/ComponentInspectorView.cs

@ -9,6 +9,7 @@ using System;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Workbench;
using NoGoop.ObjBrowser; using NoGoop.ObjBrowser;
namespace ICSharpCode.ComponentInspector.AddIn namespace ICSharpCode.ComponentInspector.AddIn

5
samples/ComponentInspector/ComponentInspector.AddIn/Src/ShowComponentInspectorCommand.cs

@ -7,6 +7,7 @@
using System; using System;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.ComponentInspector.AddIn namespace ICSharpCode.ComponentInspector.AddIn
@ -16,7 +17,7 @@ namespace ICSharpCode.ComponentInspector.AddIn
public override void Run() public override void Run()
{ {
// Switch to previously opened view. // Switch to previously opened view.
foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection) { foreach (IViewContent viewContent in SD.Workbench.ViewContentCollection) {
ComponentInspectorView openView = viewContent as ComponentInspectorView; ComponentInspectorView openView = viewContent as ComponentInspectorView;
if (openView != null) { if (openView != null) {
openView.WorkbenchWindow.SelectWindow(); openView.WorkbenchWindow.SelectWindow();
@ -26,7 +27,7 @@ namespace ICSharpCode.ComponentInspector.AddIn
// Create new view. // Create new view.
ComponentInspectorView view = new ComponentInspectorView(); ComponentInspectorView view = new ComponentInspectorView();
WorkbenchSingleton.Workbench.ShowView(view); SD.Workbench.ShowView(view);
} }
} }
} }

6
samples/ComponentInspector/ComponentInspector.Core/ComponentInspector.Core.csproj

@ -17,7 +17,8 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>0618,0626,0108</NoWarn> <NoWarn>0618,0626,0108</NoWarn>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
@ -46,6 +47,9 @@
<Reference Include="ICSharpCode.Core.WinForms"> <Reference Include="ICSharpCode.Core.WinForms">
<HintPath>..\..\..\bin\ICSharpCode.Core.WinForms.dll</HintPath> <HintPath>..\..\..\bin\ICSharpCode.Core.WinForms.dll</HintPath>
</Reference> </Reference>
<Reference Include="ICSharpCode.SharpDevelop">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />

3
samples/ComponentInspector/ComponentInspector.Core/Src/Controls/ErrorDialog.cs

@ -15,6 +15,7 @@ using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.Core.WinForms; using ICSharpCode.Core.WinForms;
using ICSharpCode.SharpDevelop;
using NoGoop.Util; using NoGoop.Util;
namespace NoGoop.Controls namespace NoGoop.Controls
@ -290,7 +291,7 @@ namespace NoGoop.Controls
void CopyInfoToClipboard() void CopyInfoToClipboard()
{ {
ClipboardWrapper.SetText(GetClipboardString()); SD.Clipboard.SetText(GetClipboardString());
} }
string GetClipboardString() string GetClipboardString()

20
samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/ComponentInspectorProperties.cs

@ -10,6 +10,7 @@ using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
namespace NoGoop.ObjBrowser namespace NoGoop.ObjBrowser
{ {
@ -20,16 +21,21 @@ namespace NoGoop.ObjBrowser
ComponentInspectorProperties() ComponentInspectorProperties()
{ {
} }
static ComponentInspectorProperties() static ComponentInspectorProperties()
{ {
properties = PropertyService.Get("ComponentInspector.Properties", new Properties()); properties = SD.PropertyService.NestedProperties("ComponentInspector.Properties");
} }
static Properties Properties { public static void Update()
{
SD.PropertyService.SetNestedProperties("ComponentInspector.Properties", Properties);
}
static Properties Properties {
get { get {
return properties; return properties;
} }
} }
public static bool ShowGettingStartedDialog { public static bool ShowGettingStartedDialog {
@ -137,7 +143,7 @@ namespace NoGoop.ObjBrowser
} }
} }
} }
} }
public static event EventHandler ShowGacPanelChanged; public static event EventHandler ShowGacPanelChanged;
@ -373,7 +379,7 @@ namespace NoGoop.ObjBrowser
} }
static PreviouslyOpenedAssemblyCollection previouslyOpenedAssemblies; static PreviouslyOpenedAssemblyCollection previouslyOpenedAssemblies;
public static PreviouslyOpenedAssemblyCollection PreviouslyOpenedAssemblies { public static PreviouslyOpenedAssemblyCollection PreviouslyOpenedAssemblies {
get { get {
if (previouslyOpenedAssemblies == null) { if (previouslyOpenedAssemblies == null) {

4
samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/PreviouslyOpenedAssemblyCollection.cs

@ -60,10 +60,10 @@ namespace NoGoop.ObjBrowser
/// </summary> /// </summary>
string[] PreviouslyOpenedAssemblies { string[] PreviouslyOpenedAssemblies {
get { get {
return properties.Get("PreviouslyOpenedAssemblies", new string[0]); return (string[]) properties.GetList<string>("PreviouslyOpenedAssemblies");
} }
set { set {
properties.Set("PreviouslyOpenedAssemblies", value); properties.SetList("PreviouslyOpenedAssemblies", value);
} }
} }

4
samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/PreviouslyOpenedTypeLibraryCollection.cs

@ -55,10 +55,10 @@ namespace NoGoop.ObjBrowser
/// </summary> /// </summary>
string[] PreviouslyOpenedTypeLibraries { string[] PreviouslyOpenedTypeLibraries {
get { get {
return properties.Get("PreviouslyOpenedTypeLibraries", new string[0]); return (string[]) properties.GetList<string>("PreviouslyOpenedTypeLibraries");
} }
set { set {
properties.Set("PreviouslyOpenedTypeLibraries", value); properties.SetList("PreviouslyOpenedTypeLibraries", value);
} }
} }

4
samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/SavedCastInfoCollection.cs

@ -56,10 +56,10 @@ namespace NoGoop.ObjBrowser
/// </summary> /// </summary>
string[] SavedCasts { string[] SavedCasts {
get { get {
return properties.Get("SavedCasts", new string[0]); return (string[]) properties.GetList<string>("SavedCasts");
} }
set { set {
properties.Set("SavedCasts", value); properties.SetList("SavedCasts", value);
} }
} }

14
samples/ComponentInspector/ComponentInspector.sln

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010 # Visual Studio 2010
# SharpDevelop 4.0.0.6209 # SharpDevelop 5.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComponentInspector", "ComponentInspector\ComponentInspector.csproj", "{000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComponentInspector", "ComponentInspector\ComponentInspector.csproj", "{000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComponentInspector.AddIn", "ComponentInspector.AddIn\ComponentInspector.AddIn.csproj", "{869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComponentInspector.AddIn", "ComponentInspector.AddIn\ComponentInspector.AddIn.csproj", "{869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}"
@ -14,17 +14,17 @@ Global
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}.Release|Any CPU.Build.0 = Release|Any CPU {000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}.Release|Any CPU.ActiveCfg = Release|Any CPU {000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}.Debug|Any CPU.Build.0 = Debug|Any CPU {000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD}.Release|Any CPU.Build.0 = Release|Any CPU
{869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}.Release|Any CPU.Build.0 = Release|Any CPU {869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}.Debug|Any CPU.Build.0 = Debug|Any CPU
{869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}.Release|Any CPU.ActiveCfg = Release|Any CPU {869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF}.Debug|Any CPU.Build.0 = Debug|Any CPU {869951D5-A0D6-4DC6-9F1D-E6B9A12AC446}.Release|Any CPU.Build.0 = Release|Any CPU
{E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF}.Release|Any CPU.Build.0 = Release|Any CPU {E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF}.Release|Any CPU.ActiveCfg = Release|Any CPU {E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

19
samples/ComponentInspector/ComponentInspector/ComponentInspector.csproj

@ -15,10 +15,13 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<NoWarn>0618</NoWarn> <NoWarn>0618</NoWarn>
<ApplicationIcon>..\ComponentInspector.Core\BitmapResources\CompInsp.ico</ApplicationIcon> <ApplicationIcon>..\ComponentInspector.Core\BitmapResources\CompInsp.ico</ApplicationIcon>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
<NoWin32Manifest>False</NoWin32Manifest>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\ComponentInspector\</OutputPath> <OutputPath>bin\ComponentInspector\</OutputPath>
@ -27,6 +30,7 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType> <DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\ComponentInspector\</OutputPath> <OutputPath>bin\ComponentInspector\</OutputPath>
@ -36,18 +40,29 @@
<DebugType>None</DebugType> <DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<Prefer32Bit>True</Prefer32Bit>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="ICSharpCode.Core"> <Reference Include="ICSharpCode.Core">
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath> <HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="ICSharpCode.SharpDevelop">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Configuration\AssemblyInfo.cs" /> <Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\ComponentInspectorApplication.cs" /> <Compile Include="Src\ComponentInspectorApplication.cs" />
<Compile Include="Src\PropertyService.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="app.config" /> <Content Include="app.config" />

19
samples/ComponentInspector/ComponentInspector/Src/ComponentInspectorApplication.cs

@ -6,6 +6,7 @@
// </file> // </file>
using System; using System;
using System.ComponentModel.Design;
using System.Configuration; using System.Configuration;
using System.IO; using System.IO;
using System.Resources; using System.Resources;
@ -14,6 +15,7 @@ using System.Security.Policy;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using NoGoop.Controls; using NoGoop.Controls;
using NoGoop.ObjBrowser.Dialogs; using NoGoop.ObjBrowser.Dialogs;
using NoGoop.Util; using NoGoop.Util;
@ -139,18 +141,21 @@ namespace NoGoop.ObjBrowser
void InitializeServices() void InitializeServices()
{ {
PropertyService.InitializeService(GetConfigurationDirectory(), String.Empty, "ComponentInspector"); SD.InitializeForUnitTests();
PropertyService.Load(); var container = ServiceSingleton.GetRequiredService<IServiceContainer>();
// Replace IPropertyService initialized by InitializeForUnitServices() with our own PropertyService
ResourceService.InitializeService(GetResourceDirectory()); container.RemoveService(typeof(IPropertyService));
ResourceService.RegisterNeutralStrings(new ResourceManager("ComponentInspector.Resources.StringResources", typeof(ComponentInspectorApplication).Assembly)); container.AddService(typeof(IPropertyService), new PropertyService());
container.AddService(typeof(ICSharpCode.Core.IResourceService), new ResourceServiceImpl(
GetResourceDirectory(), SD.PropertyService));
} }
string GetResourceDirectory() string GetResourceDirectory()
{ {
string resourceDirectory = ConfigurationSettings.AppSettings.Get("ResourceDirectory"); string resourceDirectory = ConfigurationSettings.AppSettings.Get("ResourceDirectory");
if (resourceDirectory != null) { if (resourceDirectory != null) {
return Path.Combine(Application.StartupPath, resourceDirectory); var path = new DirectoryName(Path.Combine(Application.StartupPath, resourceDirectory));
return path;
} }
return Path.Combine(Application.StartupPath, "resources"); return Path.Combine(Application.StartupPath, "resources");
} }
@ -170,7 +175,7 @@ namespace NoGoop.ObjBrowser
if (!Directory.Exists(configDirectory)) { if (!Directory.Exists(configDirectory)) {
Directory.CreateDirectory(configDirectory); Directory.CreateDirectory(configDirectory);
} }
PropertyService.Save(); SD.PropertyService.Save();
} }
} }
} }

75
samples/ComponentInspector/ComponentInspector/Src/PropertyService.cs

@ -0,0 +1,75 @@
/*
* Created by SharpDevelop.
* User: WheizWork
* Date: 16.01.2014
* Time: 00:35
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.IO;
using System.Threading;
using System.Xml;
using ICSharpCode.Core;
using NoGoop.Controls;
namespace NoGoop.ObjBrowser
{
/// <summary>
/// Description of PropertyService.
/// </summary>
public class PropertyService : PropertyServiceImpl
{
const string PropertiesName = "ComponentInspectorProperties";
DirectoryName dataDirectory;
DirectoryName configDirectory;
FileName propertiesFileName;
public PropertyService()
: base(LoadPropertiesFromStream(GetConfigDirectory().CombineFile(PropertiesName + ".xml")))
{
this.configDirectory = GetConfigDirectory();
this.dataDirectory = new DirectoryName(Environment.CurrentDirectory);
propertiesFileName = configDirectory.CombineFile(PropertiesName + ".xml");
}
private static DirectoryName GetConfigDirectory()
{
return new DirectoryName(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"ICSharpCode"));
}
public override DirectoryName ConfigDirectory {
get {
return configDirectory;
}
}
public override DirectoryName DataDirectory {
get {
return dataDirectory;
}
}
static Properties LoadPropertiesFromStream(FileName fileName)
{
if (!File.Exists(fileName)) {
return new Properties();
}
try {
return Properties.Load(fileName);
} catch (XmlException ex) {
ErrorDialog.Show("Error loading properties: " + ex.Message + "\nSettings have been restored to default values.");
} catch (IOException ex) {
ErrorDialog.Show("Error loading properties: " + ex.Message + "\nSettings have been restored to default values.");
}
return new Properties();
}
public override void Save()
{
ComponentInspectorProperties.Update();
this.MainPropertiesContainer.Save(propertiesFileName);
}
}
}

7
samples/ComponentInspector/ComponentInspector/app.config

@ -1,8 +1,11 @@
<configuration> <?xml version="1.0" encoding="utf-8"?><configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings> <appSettings>
<!-- The directory containing the resources relative to the <!-- The directory containing the resources relative to the
ComponentInspector executable --> ComponentInspector executable -->
<add key="ResourceDirectory" value="..\..\..\data\resources" /> <add key="ResourceDirectory" value="..\..\..\..\..\data\resources" />
</appSettings> </appSettings>
<system.diagnostics> <system.diagnostics>

4
src/Automated.proj

@ -91,10 +91,10 @@
<MSBuild Projects="$(SamplesSrc)\CodonCreation\CodonCreation.sln" <MSBuild Projects="$(SamplesSrc)\CodonCreation\CodonCreation.sln"
Targets="build;clean" Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/> Properties="Configuration=Release;BranchName=$(BranchName)"/>
<!-- <MSBuild Projects="$(SamplesSrc)\ComponentInspector\ComponentInspector.sln" <MSBuild Projects="$(SamplesSrc)\ComponentInspector\ComponentInspector.sln"
Targets="build;clean" Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/> Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\CppBackendBinding\CppBackendBinding.sln" <!-- <MSBuild Projects="$(SamplesSrc)\CppBackendBinding\CppBackendBinding.sln"
Targets="build;clean" Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>--> Properties="Configuration=Release;BranchName=$(BranchName)"/>-->
<MSBuild Projects="$(SamplesSrc)\CustomPad\CustomPad.sln" <MSBuild Projects="$(SamplesSrc)\CustomPad\CustomPad.sln"

Loading…
Cancel
Save