XSharp.VS fixes.

Added back the Cosmos Graphic Subsystem demo.
This commit is contained in:
José Pedro 2017-05-18 01:25:13 +01:00
parent 490506edab
commit 86a5ee339e
23 changed files with 382 additions and 407 deletions

View file

@ -169,6 +169,12 @@ Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "GuessKernelBoot", "Demos\Gu
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Core.Memory.Test", "Tests\Cosmos.Core.Memory.Test\Cosmos.Core.Memory.Test.csproj", "{408E5ACC-EA9A-41E8-AA95-514C5F47BD34}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cosmos Graphic Subsystem", "Cosmos Graphic Subsystem", "{A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos Graphic Subsystem", "Demos\Cosmos Graphic Subsystem\Cosmos Graphic Subsystem.csproj", "{49F2C01D-D2C5-4564-810B-1AE92236C5C1}"
EndProject
Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "Cosmos Graphic SubsystemBoot", "Demos\Cosmos Graphic Subsystem\Cosmos Graphic SubsystemBoot.Cosmos", "{79D68062-46C5-466D-9289-C033F7348485}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -649,6 +655,21 @@ Global
{408E5ACC-EA9A-41E8-AA95-514C5F47BD34}.Release|Any CPU.Build.0 = Release|Any CPU
{408E5ACC-EA9A-41E8-AA95-514C5F47BD34}.Release|x86.ActiveCfg = Release|Any CPU
{408E5ACC-EA9A-41E8-AA95-514C5F47BD34}.Release|x86.Build.0 = Release|Any CPU
{49F2C01D-D2C5-4564-810B-1AE92236C5C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49F2C01D-D2C5-4564-810B-1AE92236C5C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49F2C01D-D2C5-4564-810B-1AE92236C5C1}.Debug|x86.ActiveCfg = Debug|Any CPU
{49F2C01D-D2C5-4564-810B-1AE92236C5C1}.Debug|x86.Build.0 = Debug|Any CPU
{49F2C01D-D2C5-4564-810B-1AE92236C5C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49F2C01D-D2C5-4564-810B-1AE92236C5C1}.Release|Any CPU.Build.0 = Release|Any CPU
{49F2C01D-D2C5-4564-810B-1AE92236C5C1}.Release|x86.ActiveCfg = Release|Any CPU
{49F2C01D-D2C5-4564-810B-1AE92236C5C1}.Release|x86.Build.0 = Release|Any CPU
{79D68062-46C5-466D-9289-C033F7348485}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79D68062-46C5-466D-9289-C033F7348485}.Debug|x86.ActiveCfg = Debug|Any CPU
{79D68062-46C5-466D-9289-C033F7348485}.Debug|x86.Build.0 = Debug|Any CPU
{79D68062-46C5-466D-9289-C033F7348485}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79D68062-46C5-466D-9289-C033F7348485}.Release|Any CPU.Build.0 = Release|Any CPU
{79D68062-46C5-466D-9289-C033F7348485}.Release|x86.ActiveCfg = Release|Any CPU
{79D68062-46C5-466D-9289-C033F7348485}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -723,5 +744,8 @@ Global
{E35E0DBF-555F-4D38-8F28-ACDFA9DC97BD} = {5FF9BF2A-5162-4F12-82B6-1693AD776636}
{77DD08F5-0751-4EFC-B222-78F9F06E1F7C} = {5FF9BF2A-5162-4F12-82B6-1693AD776636}
{408E5ACC-EA9A-41E8-AA95-514C5F47BD34} = {52D81759-C7CC-427F-8C96-89CA10C914B5}
{A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7} = {B56A6119-1B8F-44E4-9446-291E52F47D4C}
{49F2C01D-D2C5-4564-810B-1AE92236C5C1} = {A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}
{79D68062-46C5-466D-9289-C033F7348485} = {A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<ProjectGuid>{49f2c01d-d2c5-4564-810b-1ae92236c5c1}</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<None Remove="Cosmos Graphic SubsystemBoot.Cosmos" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\source\Cosmos.Debug.Kernel\Cosmos.Debug.Kernel.csproj" />
<ProjectReference Include="..\..\source\Cosmos.System\Cosmos.System.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,60 @@
<Project Sdk="Microsoft.Net.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<BinFormat>elf</BinFormat>
<DebugEnabled>True</DebugEnabled>
<DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode>
<EnableGDB>False</EnableGDB>
<StartCosmosGDB>False</StartCosmosGDB>
<Deployment>ISO</Deployment>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<StackCorruptionDetectionEnabled>True</StackCorruptionDetectionEnabled>
<StackCorruptionDetectionLevel>MethodFooters</StackCorruptionDetectionLevel>
<IgnoreDebugStubAttribute>False</IgnoreDebugStubAttribute>
<CosmosDebugPort>Serial: COM1</CosmosDebugPort>
<Launch>VMware</Launch>
<Profile>VMware</Profile>
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
</PropertyGroup>
<ItemGroup>
<None Remove="*" />
<Compile Remove="*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs.Asm\Cosmos.Core.Plugs.Asm.csproj">
<Name>Cosmos.Core.Plugs.Asm</Name>
<Project>{3c186d37-21c3-417c-95f1-19be538af88a}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs\Cosmos.Core.Plugs.csproj">
<Name>Cosmos.Core.Plugs</Name>
<Project>{1132e689-18b0-4d87-94e8-934d4802c540}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.Debug.Kernel.Plugs.Asm\Cosmos.Debug.Kernel.Plugs.Asm.csproj">
<Name>Cosmos.Debug.Kernel.Plugs.Asm</Name>
<Project>{7e450662-b34c-49b0-a826-f45ad3a18891}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.System.Plugs\Cosmos.System.Plugs.csproj">
<Name>Cosmos.System.Plugs</Name>
<Project>{9431ff1f-ad75-4a1e-b38a-46e0f109411d}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\Cosmos Graphic Subsystem\Cosmos Graphic Subsystem.csproj">
<Name>Cosmos Graphic Subsystem</Name>
<Project>{49f2c01d-d2c5-4564-810b-1ae92236c5c1}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Cosmos\Cosmos.targets" />
</Project>

View file

@ -1,36 +0,0 @@
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Package Name")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Company")]
[assembly: AssemblyProduct("Package Name")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
[assembly: NeutralResourcesLanguage("en-US")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{49F2C01D-D2C5-4564-810B-1AE92236C5C1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Cosmos_Graphic_Subsytem</RootNamespace>
<AssemblyName>Cosmos Graphic Subsytem</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Kernel.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\source\Cosmos.Debug.Kernel\Cosmos.Debug.Kernel.csproj">
<Project>{61607f1e-58f9-41cf-972f-128384f3e115}</Project>
<Name>Cosmos.Debug.Kernel</Name>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.System\Cosmos.System.csproj">
<Project>{3def0461-08ab-471a-8f03-a9c556652a0f}</Project>
<Name>Cosmos.System</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1bc71853-22f3-415d-a068-8e1fa8e8f05b}</ProjectGuid>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<Name>Cosmos Graphic SubsytemBoot</Name>
<BinFormat>elf</BinFormat>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<Profile>Bochs</Profile>
<DebugEnabled>true</DebugEnabled>
<DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode>
<EnableGDB>False</EnableGDB>
<StartCosmosGDB>false</StartCosmosGDB>
<VMWareEdition>Player</VMWareEdition>
<OutputPath>bin\Debug\</OutputPath>
<Name>Cosmos Graphic SubsytemBoot</Name>
<Description>Use Bochs emulator to deploy and debug.</Description>
<Deployment>ISO</Deployment>
<Launch>Bochs</Launch>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<PxeInterface>192.168.0.3</PxeInterface>
<VMware_Name>Cosmos Graphic SubsytemBoot</VMware_Name>
<VMware_Description>Use VMware Player or Workstation to deploy and debug.</VMware_Description>
<VMware_Deployment>ISO</VMware_Deployment>
<VMware_Launch>VMware</VMware_Launch>
<VMware_DebugEnabled>true</VMware_DebugEnabled>
<VMware_DebugMode>Source</VMware_DebugMode>
<VMware_VisualStudioDebugPort>Pipe: Cosmos\Serial</VMware_VisualStudioDebugPort>
<VMware_PxeInterface>192.168.0.3</VMware_PxeInterface>
<VMware_VMwareEdition>Player</VMware_VMwareEdition>
<VMware_OutputPath>bin\Debug\</VMware_OutputPath>
<VMware_EnableGDB>False</VMware_EnableGDB>
<VMware_StartCosmosGDB>false</VMware_StartCosmosGDB>
<Bochs_Name>Cosmos Graphic SubsytemBoot</Bochs_Name>
<Bochs_Description>Use Bochs emulator to deploy and debug.</Bochs_Description>
<Bochs_Deployment>ISO</Bochs_Deployment>
<Bochs_Launch>Bochs</Bochs_Launch>
<Bochs_DebugEnabled>true</Bochs_DebugEnabled>
<Bochs_DebugMode>Source</Bochs_DebugMode>
<Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort>
<Bochs_PxeInterface>192.168.0.3</Bochs_PxeInterface>
<Bochs_VMwareEdition>Player</Bochs_VMwareEdition>
<Bochs_OutputPath>bin\Debug\</Bochs_OutputPath>
<Bochs_EnableGDB>False</Bochs_EnableGDB>
<Bochs_StartCosmosGDB>false</Bochs_StartCosmosGDB>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include=".\Cosmos Graphic Subsytem.csproj">
<Name>Cosmos Graphic Subsytem</Name>
<Project>{49f2c01d-d2c5-4564-810b-1ae92236c5c1}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Cosmos.Core.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.System.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.Debug.Kernel.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
</ItemGroup>
<!--<ItemGroup>
<Content Include="Cosmos.bxrc">
<SubType>Content</SubType>
</Content>
</ItemGroup>-->
<Import Project="$(MSBuildExtensionsPath)\Cosmos\Cosmos.targets" />
</Project>

View file

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<ProjectGuid>{e35e0dbf-555f-4d38-8f28-acdfa9dc97bd}</ProjectGuid>
</PropertyGroup>
<ItemGroup>

View file

@ -4,7 +4,8 @@
<TargetFramework>net462</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup>
<BinFormat>elf</BinFormat>
<DebugEnabled>True</DebugEnabled>
<DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode>
@ -27,18 +28,32 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs.Asm\Cosmos.Core.Plugs.Asm.csproj">
<Name>Cosmos.Core.Plugs.Asm</Name>
<Project>{3c186d37-21c3-417c-95f1-19be538af88a}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs\Cosmos.Core.Plugs.csproj">
<Name>Cosmos.Core.Plugs</Name>
<Project>{1132e689-18b0-4d87-94e8-934d4802c540}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.Debug.Kernel.Plugs.Asm\Cosmos.Debug.Kernel.Plugs.Asm.csproj">
<Name>Cosmos.Debug.Kernel.Plugs.Asm</Name>
<Project>{7e450662-b34c-49b0-a826-f45ad3a18891}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.System.Plugs\Cosmos.System.Plugs.csproj">
<Name>Cosmos.System.Plugs</Name>
<Project>{9431ff1f-ad75-4a1e-b38a-46e0f109411d}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\Guess\GuessKernel.csproj">
<Name>GuessKernel</Name>
<Project>{e35e0dbf-555f-4d38-8f28-acdfa9dc97bd}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Cosmos.Core.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.Core.Plugs.Asm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.Debug.Kernel.Plugs.Asm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.System.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Cosmos\Cosmos.targets" />
</Project>

View file

@ -92,7 +92,8 @@ Source: ".\Build\VSIP\Cosmos.Common.*"; DestDir: "{app}\Kernel"; Flags: ignoreve
Source: ".\Build\VSIP\KernelPackages\*.nupkg"; DestDir: "{app}\Kernel\packages"; Flags: ignoreversion uninsremovereadonly
; Icon
Source: ".\Artwork\Cosmos.ico"; DestDir: "{app}"; Flags: ignoreversion uninsremovereadonly
; XSharp Source
; XSharp
Source: ".\Artwork\XSharp\XSharp.ico"; DestDir: "{app}\XSharp\"; Flags: ignoreversion uninsremovereadonly
Source: ".\source\Cosmos.Debug.DebugStub\*.xs"; DestDir: "{app}\XSharp\DebugStub\"; Flags: ignoreversion uninsremovereadonly
; VMware
Source: ".\Build\VMware\*"; DestDir: "{app}\Build\VMware"; Flags: ignoreversion uninsremovereadonly overwritereadonly recursesubdirs
@ -109,14 +110,19 @@ Source: ".\Build\mboot.c32"; DestDir: "{app}\Build\PXE\"
Source: ".\Build\syslinux.cfg"; DestDir: "{app}\Build\PXE\pxelinux.cfg"; DestName: "default"
; VSIP
Source: ".\Build\Tools\VSIXBootstrapper.exe"; DestDir: "{app}\Build\Tools"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.VS.ProjectSystem.vsix"; DestDir: "{app}"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.VS.Windows.vsix"; DestDir: "{app}"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.VS.DebugEngine.vsix"; DestDir: "{app}"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\XSharp.VS.vsix"; DestDir: "{app}"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.VS.ProjectSystem.vsix"; DestDir: "{app}\VSIX\"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\Cosmos.VS.Windows.vsix"; DestDir: "{app}"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\Cosmos.VS.DebugEngine.vsix"; DestDir: "{app}"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\XSharp.VS.vsix"; DestDir: "{app}\VSIX\"; Flags: ignoreversion uninsremovereadonly
; MSBuild targets
Source: ".\Build\VSIP\Cosmos.targets"; DestDir: "{code:GetMSBuildDirectory}\Cosmos"; Flags: ignoreversion uninsremovereadonly
[Registry]
; Regiter .xs Extension
Root: HKCR; Subkey: ".xs"; ValueType: string; ValueName: ""; ValueData: "XSharp"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "XSharp"; ValueType: string; ValueName: ""; ValueData: "X# source file"; Flags: uninsdeletekey
Root: HKCR; Subkey: "XSharp\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\XSharp\XSharp.ico,0"
Root: HKCR; Subkey: "XSharp\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\Build\XSharp\XSC.exe"" ""%1"""
; User Kit Folder
Root: HKLM; SubKey: Software\Cosmos; ValueType: string; ValueName: "UserKit"; ValueData: {app}; Flags: uninsdeletekey
; Dev Kit Folder - Set by builder only, but we delete it here. See comments in builder.
@ -131,7 +137,9 @@ UseRelativePaths=True
Filename: "{app}\Build\Tools\nuget.exe"; Parameters: "init ""{app}\Kernel\packages"" ""{app}\Kernel\packages"""; WorkingDir: "{app}"; Description: "Install Kernel Packages"; StatusMsg: "Installing Kernel Packages"
Filename: "{app}\Build\Tools\nuget.exe"; Parameters: "sources Add -Name ""Cosmos Local Package Feed"" -Source ""{app}\Kernel\packages"""; WorkingDir: "{app}"; Description: "Install Kernel Packages"; StatusMsg: "Installing Kernel Packages"
Filename: "{app}\Build\Tools\VSIXBootstrapper.exe"; Parameters: "/q /a /u:Cosmos.VS.ProjectSystem"; Description: "Remove Cosmos Project System"; StatusMsg: "Removing Visual Studio Extension: Cosmos Project System"
Filename: "{app}\Build\Tools\VSIXBootstrapper.exe"; Parameters: "/q /a Cosmos.VS.ProjectSystem.vsix"; WorkingDir: "{app}"; Description: "Install Cosmos Project System"; StatusMsg: "Installing Visual Studio Extension: Cosmos Project System"
;Filename: "{app}\Build\Tools\VSIXBootstrapper.exe"; Parameters: "/q /a /u:XSharp.VS"; Description: "Remove Cosmos Project System"; StatusMsg: "Removing Visual Studio Extension: Cosmos X# Language"
Filename: "{app}\Build\Tools\VSIXBootstrapper.exe"; Parameters: "/q /a Cosmos.VS.ProjectSystem.vsix"; WorkingDir: "{app}\Extensions\"; Description: "Install Cosmos Project System"; StatusMsg: "Installing Visual Studio Extension: Cosmos Project System"
;Filename: "{app}\Build\Tools\VSIXBootstrapper.exe"; Parameters: "/q /a XSharp.VS.vsix"; WorkingDir: "{app}\Extensions\"; Description: "Install Cosmos Project System"; StatusMsg: "Installing Visual Studio Extension: Cosmos X# Language"
[UninstallRun]
Filename: "{code:GetVsixInstallCommand}"; Parameters: "{code:GetVsixUninstallParams|Cosmos.VS.ProjectSystem}"

View file

@ -11,14 +11,14 @@ namespace Cosmos.System.Graphics
public abstract class Canvas
{
protected Mode mode;
protected List<Mode> aviableModes;
protected List<Mode> availableModes;
static protected Mode defaultGraphicMode;
protected Canvas(Mode mode)
{
//Global.mDebugger.SendInternal($"Creating a new Canvas with Mode ${mode}");
aviableModes = getAviableModes();
availableModes = getAvailableModes();
defaultGraphicMode = getDefaultGraphicMode();
this.mode = mode;
}
@ -27,20 +27,20 @@ namespace Cosmos.System.Graphics
{
Global.mDebugger.SendInternal($"Creating a new Canvas with default graphic Mode");
aviableModes = getAviableModes();
availableModes = getAvailableModes();
defaultGraphicMode = getDefaultGraphicMode();
this.mode = defaultGraphicMode;
}
abstract public List<Mode> getAviableModes();
abstract public List<Mode> getAvailableModes();
abstract protected Mode getDefaultGraphicMode();
public List<Mode> AviableModes
public List<Mode> AvailableModes
{
get
{
return aviableModes;
return availableModes;
}
}
@ -253,11 +253,11 @@ namespace Cosmos.System.Graphics
if (mode == null)
return false;
foreach (var elem in aviableModes)
foreach (var elem in availableModes)
{
if (elem == mode)
{
return true; // All OK mode does exists in aviableModes
return true; // All OK mode does exists in availableModes
}
}
@ -273,21 +273,21 @@ namespace Cosmos.System.Graphics
}
#if false
/* This would have been the more "modern" version but LINQ is not working */
if (!aviableModes.Exists(element => element == mode))
if (!availableModes.Exists(element => element == mode))
throw new ArgumentOutOfRangeException($"Mode {mode} is not supported by this Driver");
#endif
foreach (var elem in aviableModes)
foreach (var elem in availableModes)
{
if (elem == mode)
{
Global.mDebugger.SendInternal($"mode {mode} found");
return; // All OK mode does exists in aviableModes
return; // All OK mode does exists in availableModes
}
}
Global.mDebugger.SendInternal($"foreach ended mode is not found! Raising exception...");
/* 'mode' was not in the 'aviableModes' List ==> 'mode' in NOT Valid */
/* 'mode' was not in the 'availableModes' List ==> 'mode' in NOT Valid */
throw new ArgumentOutOfRangeException(nameof(mode), $"Mode {mode} is not supported by this Driver");
}

View file

@ -47,13 +47,13 @@ namespace Cosmos.System
}
}
#region Display
#region Display
/// <summary>
/// All the aviable screen modes VBE supports, I would like to query the hardware and obtain from it the list but I have
/// All the available screen modes VBE supports, I would like to query the hardware and obtain from it the list but I have
/// not yet find how to do it! For now I hardcode the most used VESA modes, VBE seems to support until HDTV resolution
/// without problems that is well... excellent :-)
/// </summary>
public override List<Mode> getAviableModes()
public override List<Mode> getAvailableModes()
{
return new List<Mode>
{
@ -92,9 +92,9 @@ namespace Cosmos.System
//set the screen
VBEDriver.VBESet(xres, yres, bpp);
}
#endregion
#endregion
#region Drawing
#region Drawing
public override void Clear(Color color)
{
@ -160,12 +160,12 @@ namespace Cosmos.System
{
throw new NotImplementedException();
}
#endregion
#endregion
#region Reading
#region Reading
// TODO add to Canvas GetPointColor()
#endregion
#endregion
}
}

View file

@ -38,6 +38,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DeployExtension>False</DeployExtension>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View file

@ -39,6 +39,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DeployExtension>False</DeployExtension>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View file

@ -2,13 +2,11 @@
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<AssemblyName>$safeprojectname$</AssemblyName>
<PackageId>$safeprojectname$</PackageId>
<ProjectGuid>$KernelProjectGuid$</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<None Remove="$CosmosProjectName$.Cosmos" />
<None Remove="$safeprojectname$Boot.Cosmos" />
</ItemGroup>
<ItemGroup>

View file

@ -2,8 +2,6 @@
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<AssemblyName>$safeprojectname$</AssemblyName>
<PackageId>$safeprojectname$</PackageId>
<ProjectGuid>$KernelProjectGuid$</ProjectGuid>
</PropertyGroup>

View file

@ -38,6 +38,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DeployExtension>False</DeployExtension>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View file

@ -25,7 +25,7 @@ namespace XSharp.VS
static Scanner()
{
int xEnumMax = Enum.GetValues(typeof(TokenType)).GetUpperBound(0);
int xEnumMax = Enum.GetValues(typeof(XSC.TokenType)).GetUpperBound(0);
mTokenMap = new TokenData[xEnumMax + 1];
// Set Default values

View file

@ -3,6 +3,14 @@
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<UseCodebase>true</UseCodebase>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\Cosmos.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@ -22,10 +30,6 @@
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Cosmos.snk</AssemblyOriginatorKeyFile>
<UseCodebase>true</UseCodebase>
<CreateVsixContainer>True</CreateVsixContainer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -49,10 +53,10 @@
<Compile Include="Guids.cs" />
<Compile Include="Parser.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Package.cs" />
<Compile Include="XSharpPackage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Scanner.cs" />
<Compile Include="LanguageService.cs" />
<Compile Include="XSharpLanguageService.cs" />
<Compile Include="XsToAsmFileGenerator.cs" />
</ItemGroup>
<ItemGroup>
@ -66,7 +70,9 @@
<Link>Cosmos.snk</Link>
</None>
<None Include=".editorconfig" />
<None Include="app.config" />
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
@ -149,17 +155,15 @@
<HintPath>..\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Threading">
<HintPath>..\..\packages\Microsoft.VisualStudio.Threading.15.0.240\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.Threading.15.3.20\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.Utilities">
<HintPath>..\..\packages\Microsoft.VisualStudio.Utilities.15.0.26201\lib\net45\Microsoft.VisualStudio.Utilities.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Validation">
<HintPath>..\..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.VisualStudio.Validation.15.3.15\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@ -171,16 +175,20 @@
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Reflection, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reflection.4.1.0\lib\net462\System.Reflection.dll</HintPath>
<ForceIncludeInVSIX>True</ForceIncludeInVSIX>
</Reference>
<Reference Include="System.Reflection.TypeExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reflection.TypeExtensions.4.1.0\lib\net462\System.Reflection.TypeExtensions.dll</HintPath>
<ForceIncludeInVSIX>True</ForceIncludeInVSIX>
</Reference>
<Reference Include="System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.4.1.0\lib\net462\System.Runtime.dll</HintPath>
<ForceIncludeInVSIX>True</ForceIncludeInVSIX>
</Reference>
<Reference Include="System.Runtime.InteropServices, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.InteropServices.4.1.0\lib\net462\System.Runtime.InteropServices.dll</HintPath>
<ForceIncludeInVSIX>True</ForceIncludeInVSIX>
</Reference>
<Reference Include="System.Threading.Thread, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll</HintPath>
<Reference Include="System.Runtime.Extensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.Extensions.4.1.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
<ForceIncludeInVSIX>True</ForceIncludeInVSIX>
</Reference>
<Reference Include="System.Windows.Forms" />
@ -210,6 +218,10 @@
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets'))" />
</Target>
<!--VSIX Signing-->
<!--<Target Name="SignVSIX" AfterTargets="CreateVsixContainer">
<Exec Command="..\..\packages\Microsoft.VSSDK.Vsixsigntool.15.0.26201\tools\vssdk\vsixsigntool.exe sign /f certfile" />
</Target>-->
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -1,52 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Package;
using Microsoft.VisualStudio.TextManager.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using System.Runtime.InteropServices;
// Walkthrough: Creating a Language Service (MPF)
// http://msdn.microsoft.com/en-us/library/bb165744
// Language Service Features (MPF)
// http://msdn.microsoft.com/en-us/library/bb166215
// Syntax Colorizing
// http://msdn.microsoft.com/en-us/library/bb165041
// Managed Babel
// http://msdn.microsoft.com/en-us/library/bb165037.aspx
namespace XSharp.VS {
[Guid(Guids.guidCosmos_VS_XSharpLangSvcString)]
public class XSharpLanguageService : LanguageService {
public override string GetFormatFilterList() {
return "X# files (*.xs)\n*.xs\n";
}
private LanguagePreferences mPreferences;
public override LanguagePreferences GetLanguagePreferences() {
if (mPreferences == null) {
mPreferences = new LanguagePreferences(Site, typeof(XSharpLanguageService).GUID, Name);
mPreferences.Init();
}
return mPreferences;
}
private Scanner mScanner;
public override IScanner GetScanner(IVsTextLines aBuffer) {
if (mScanner == null) {
mScanner = new Scanner(aBuffer);
}
return mScanner;
}
public override string Name {
get { return "X#"; }
}
public override AuthoringScope ParseSource(ParseRequest req) {
return new Parser();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Package;
using Microsoft.VisualStudio.TextManager.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using System.Runtime.InteropServices;
// Walkthrough: Creating a Language Service (MPF)
// http://msdn.microsoft.com/en-us/library/bb165744
// Language Service Features (MPF)
// http://msdn.microsoft.com/en-us/library/bb166215
// Syntax Colorizing
// http://msdn.microsoft.com/en-us/library/bb165041
// Managed Babel
// http://msdn.microsoft.com/en-us/library/bb165037.aspx
namespace XSharp.VS {
[Guid(Guids.guidCosmos_VS_XSharpLangSvcString)]
public class XSharpLanguageService : LanguageService {
public override string GetFormatFilterList() {
return "X# files (*.xs)\n*.xs\n";
}
private LanguagePreferences mPreferences;
public override LanguagePreferences GetLanguagePreferences() {
if (mPreferences == null) {
mPreferences = new LanguagePreferences(Site, typeof(XSharpLanguageService).GUID, Name);
mPreferences.Init();
}
return mPreferences;
}
private Scanner mScanner;
public override IScanner GetScanner(IVsTextLines aBuffer) {
if (mScanner == null) {
mScanner = new Scanner(aBuffer);
}
return mScanner;
}
public override string Name {
get { return "X#"; }
}
public override AuthoringScope ParseSource(ParseRequest req) {
return new Parser();
}
}
}

View file

@ -1,123 +1,125 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.ComponentModel.Design;
using Microsoft.Win32;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Package;
using Microsoft.VisualStudio.TextManager.Interop;
namespace XSharp.VS
{
/// This is the class that implements the package exposed by this assembly.
///
/// The minimum requirement for a class to be considered a valid package for Visual Studio
/// is to implement the IVsPackage interface and register itself with the shell.
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
/// to do it: it derives from the Package class that provides the implementation of the
/// IVsPackage interface and uses the registration attributes defined in the framework to
/// register itself and its components with the shell.
//
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
[ProvideLanguageService(typeof(XSharpLanguageService), "X#", 0, RequestStockColors = true)]
[Guid(Guids.guidCosmos_VS_XSharpPkgString)]
public sealed class Cosmos_VS_XSharpPackage : Package, IOleComponent
{
uint mComponentID;
// Default constructor of the package.
// Inside this method you can place any initialization code that does not require
// any Visual Studio service because at this point the package object is created but
// not sited yet inside Visual Studio environment. The place to do all the other
// initialization is the Initialize method.
public Cosmos_VS_XSharpPackage()
{
}
/// Initialization of the package; this method is called right after the package is sited, so this is the place
/// where you can put all the initilaization code that rely on services provided by VisualStudio.
protected override void Initialize()
{
base.Initialize();
// Proffer the service.
var serviceContainer = this as IServiceContainer;
var langService = new XSharpLanguageService();
langService.SetSite(this);
serviceContainer.AddService(typeof(XSharpLanguageService), langService, true);
// Register a timer to call our language service during idle periods.
var xMgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
if (mComponentID == 0 && xMgr != null)
{
OLECRINFO[] crinfo = new OLECRINFO[1];
crinfo[0].cbSize = (uint)Marshal.SizeOf(typeof(OLECRINFO));
crinfo[0].grfcrf = (uint)_OLECRF.olecrfNeedIdleTime | (uint)_OLECRF.olecrfNeedPeriodicIdleTime;
crinfo[0].grfcadvf = (uint)_OLECADVF.olecadvfModal | (uint)_OLECADVF.olecadvfRedrawOff | (uint)_OLECADVF.olecadvfWarningsOff;
crinfo[0].uIdleTimeInterval = 1000;
xMgr.FRegisterComponent(this, crinfo, out mComponentID);
}
}
protected override void Dispose(bool disposing)
{
if (mComponentID != 0)
{
var xMgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
if (xMgr != null)
{
xMgr.FRevokeComponent(mComponentID);
}
mComponentID = 0;
}
base.Dispose(disposing);
}
public int FDoIdle(uint grfidlef)
{
bool bPeriodic = (grfidlef & (uint)_OLEIDLEF.oleidlefPeriodic) != 0;
// Use typeof(TestLanguageService) because we need to reference the GUID for our language service.
LanguageService xService = GetService(typeof(XSharpLanguageService)) as LanguageService;
if (xService != null)
{
xService.OnIdle(bPeriodic);
}
return 0;
}
public int FContinueMessageLoop(uint uReason, IntPtr pvLoopData, MSG[] pMsgPeeked)
{
return 1;
}
public int FPreTranslateMessage(MSG[] pMsg)
{
return 0;
}
public int FQueryTerminate(int fPromptUser)
{
return 1;
}
public int FReserved1(uint dwReserved, uint message, IntPtr wParam, IntPtr lParam)
{
return 1;
}
public IntPtr HwndGetWindow(uint dwWhich, uint dwReserved)
{
return IntPtr.Zero;
}
public void OnActivationChange(IOleComponent pic, int fSameComponent, OLECRINFO[] pcrinfo, int fHostIsActivating, OLECHOSTINFO[] pchostinfo, uint dwReserved) { }
public void OnAppActivate(int fActive, uint dwOtherThreadID) { }
public void OnEnterState(uint uStateID, int fEnter) { }
public void OnLoseActivation() { }
public void Terminate() { }
}
}
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.ComponentModel.Design;
using Microsoft.Win32;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Package;
using Microsoft.VisualStudio.TextManager.Interop;
namespace XSharp.VS
{
/// This is the class that implements the package exposed by this assembly.
///
/// The minimum requirement for a class to be considered a valid package for Visual Studio
/// is to implement the IVsPackage interface and register itself with the shell.
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
/// to do it: it derives from the Package class that provides the implementation of the
/// IVsPackage interface and uses the registration attributes defined in the framework to
/// register itself and its components with the shell.
//
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
[ProvideService(typeof(XSharpLanguageService))]
[ProvideLanguageExtension(typeof(XSharpLanguageService), ".xs")]
[ProvideLanguageService(typeof(XSharpLanguageService), "X#", 0, RequestStockColors = true)]
[Guid(Guids.guidCosmos_VS_XSharpPkgString)]
public sealed class XSharpPackage : Package, IOleComponent
{
uint mComponentID;
// Default constructor of the package.
// Inside this method you can place any initialization code that does not require
// any Visual Studio service because at this point the package object is created but
// not sited yet inside Visual Studio environment. The place to do all the other
// initialization is the Initialize method.
public XSharpPackage()
{
}
/// Initialization of the package; this method is called right after the package is sited, so this is the place
/// where you can put all the initilaization code that rely on services provided by VisualStudio.
protected override void Initialize()
{
base.Initialize();
// Proffer the service.
var serviceContainer = this as IServiceContainer;
var langService = new XSharpLanguageService();
langService.SetSite(this);
serviceContainer.AddService(typeof(XSharpLanguageService), langService, true);
// Register a timer to call our language service during idle periods.
var xMgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
if (mComponentID == 0 && xMgr != null)
{
OLECRINFO[] crinfo = new OLECRINFO[1];
crinfo[0].cbSize = (uint)Marshal.SizeOf(typeof(OLECRINFO));
crinfo[0].grfcrf = (uint)_OLECRF.olecrfNeedIdleTime | (uint)_OLECRF.olecrfNeedPeriodicIdleTime;
crinfo[0].grfcadvf = (uint)_OLECADVF.olecadvfModal | (uint)_OLECADVF.olecadvfRedrawOff | (uint)_OLECADVF.olecadvfWarningsOff;
crinfo[0].uIdleTimeInterval = 1000;
xMgr.FRegisterComponent(this, crinfo, out mComponentID);
}
}
protected override void Dispose(bool disposing)
{
if (mComponentID != 0)
{
var xMgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
if (xMgr != null)
{
xMgr.FRevokeComponent(mComponentID);
}
mComponentID = 0;
}
base.Dispose(disposing);
}
public int FDoIdle(uint grfidlef)
{
bool bPeriodic = (grfidlef & (uint)_OLEIDLEF.oleidlefPeriodic) != 0;
// Use typeof(TestLanguageService) because we need to reference the GUID for our language service.
LanguageService xService = GetService(typeof(XSharpLanguageService)) as LanguageService;
if (xService != null)
{
xService.OnIdle(bPeriodic);
}
return 0;
}
public int FContinueMessageLoop(uint uReason, IntPtr pvLoopData, MSG[] pMsgPeeked)
{
return 1;
}
public int FPreTranslateMessage(MSG[] pMsg)
{
return 0;
}
public int FQueryTerminate(int fPromptUser)
{
return 1;
}
public int FReserved1(uint dwReserved, uint message, IntPtr wParam, IntPtr lParam)
{
return 1;
}
public IntPtr HwndGetWindow(uint dwWhich, uint dwReserved)
{
return IntPtr.Zero;
}
public void OnActivationChange(IOleComponent pic, int fSameComponent, OLECRINFO[] pcrinfo, int fHostIsActivating, OLECHOSTINFO[] pchostinfo, uint dwReserved) { }
public void OnAppActivate(int fActive, uint dwOtherThreadID) { }
public void OnEnterState(uint uStateID, int fEnter) { }
public void OnLoseActivation() { }
public void Terminate() { }
}
}

View file

@ -6,6 +6,10 @@
<assemblyIdentity name="EnvDTE" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.3.0.0" newVersion="15.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View file

@ -14,12 +14,13 @@
<package id="Microsoft.VisualStudio.Shell.Interop.9.0" version="9.0.30729" targetFramework="net462" />
<package id="Microsoft.VisualStudio.TextManager.Interop" version="7.10.6070" targetFramework="net462" />
<package id="Microsoft.VisualStudio.TextManager.Interop.8.0" version="8.0.50727" targetFramework="net462" />
<package id="Microsoft.VisualStudio.Threading" version="15.0.240" targetFramework="net462" />
<package id="Microsoft.VisualStudio.Threading" version="15.3.20" targetFramework="net462" />
<package id="Microsoft.VisualStudio.Utilities" version="15.0.26201" targetFramework="net462" />
<package id="Microsoft.VisualStudio.Validation" version="15.0.82" targetFramework="net462" />
<package id="Microsoft.VisualStudio.Validation" version="15.3.15" targetFramework="net462" />
<package id="Microsoft.VSSDK.BuildTools" version="15.0.26201" targetFramework="net462" developmentDependency="true" />
<package id="Microsoft.Win32.Registry" version="4.0.0" targetFramework="net462" />
<package id="Microsoft.VSSDK.Vsixsigntool" version="15.0.26201" targetFramework="net462" />
<package id="System.Reflection" version="4.1.0" targetFramework="net462" />
<package id="System.Reflection.TypeExtensions" version="4.1.0" targetFramework="net462" />
<package id="System.Runtime" version="4.1.0" targetFramework="net462" />
<package id="System.Runtime.InteropServices" version="4.1.0" targetFramework="net462" />
<package id="System.Threading.Thread" version="4.3.0" targetFramework="net462" />
<package id="System.Runtime.Extensions" version="4.1.0" targetFramework="net462" />
</packages>