diff --git a/docs/Help/Topics/VersionHistory.xml b/docs/Help/Topics/VersionHistory.xml index cf424c6f03..dfe24af9cc 100644 --- a/docs/Help/Topics/VersionHistory.xml +++ b/docs/Help/Topics/VersionHistory.xml @@ -1,6 +1,6 @@  - + Version History Changes @@ -11,7 +11,7 @@ Version History Note: When an item has a matching GitHub ticket then the ticket number is behind the item in parentheses prefixed with #. You can find these tickets by going to:
https://github.com/X-Sharp/XSharpPublic/issues/nnn where nnn is the ticket number.
If you find an issue in X# we recommend that you report it on GitHub. You will be notified of the progress on the work on your issue.
- Changes in 2.21.0.0 + Changes in 2.21.0.3 Compiler Bug fixes @@ -24,7 +24,6 @@
  • Fixed problem passing array reference or ivar by reference in the XBase++ dialect (#1492)
  • Fixed AmbiguousMatchException in Evaluate() function for methods included in an interface (#1494)
  • Fixed problem with /fox1 switch being ignored in some cases (#1496)
  • -
  • Fixed problem with /enforceself compiler option being ignored (#1503)
  • The Build System now automatically adds a TargetFramework Attribute to assemblies compiled with X# (#1507)
  • Fixed an ambiguity problem with same named namespace and property and several issues when the /allowdot option is disabled (#1515)
  • Fixed problem in TEXT TO/ENDTEXT with TEXTMERGE clause (#1517)
  • @@ -65,6 +64,7 @@
  • Fixed a problem with putting the .resx file for windows forms user controls in an incorrect location in the Solution Explorer (#1560)
  • Fixed problem with editor snippets no longer working in VS 2022 version 17.11 (#1564)
  • Fix a problem with indenting lines with end keywords, such as NEXT and ENDDO, when these keywords were following by 'garbage'.
  • +
  • Opening a form in the VS Form designer could fail when one of the include files declared entities, such as USING SomeNameSpace (#1595, #1596)
  • New features diff --git a/docs/Help/XSHelp.hmxp b/docs/Help/XSHelp.hmxp index f03ad97c89..68508c960f 100644 --- a/docs/Help/XSHelp.hmxp +++ b/docs/Help/XSHelp.hmxp @@ -731,7 +731,7 @@ XSharp BV - Cahors (2.21.0.0) + Cahors (2.21.0.1) XSharp diff --git a/src/Common/BuildNumber.h b/src/Common/BuildNumber.h index 0d273a0a5e..c71d2761c3 100644 --- a/src/Common/BuildNumber.h +++ b/src/Common/BuildNumber.h @@ -10,7 +10,7 @@ // This is the file version number, which is ignored by .NET but used by Windows installer to determine // whether one file is newer than another. // This typically would change if we're generating a patch, otherwise it should be the same as VERSION_NUMBER -#define FILEVERSION_NUMBER "2.21.0.0" +#define FILEVERSION_NUMBER "2.21.0.3" // This is used for the assembly version number, which the CLR uses to determine binding // This generally changes when we release a new full build // NOTE: DO NOT FORGET THE VERSION NUMBER IN THE CONSTANTS.CS FILE and the Versions.Props file diff --git a/src/Common/Constants.cs b/src/Common/Constants.cs index 3ac3d3564a..459e35a1dc 100644 --- a/src/Common/Constants.cs +++ b/src/Common/Constants.cs @@ -18,7 +18,7 @@ internal static partial class Constants #else internal const string Version = FileVersion; #endif - internal const string FileVersion = "2.21.0.0"; + internal const string FileVersion = "2.21.0.3"; internal const string ProductVersion = "2.21 GA"; internal const string PublicKey = "ed555a0467764586"; internal const string Copyright = "Copyright © XSharp BV 2015-2024"; diff --git a/src/Common/version.Targets b/src/Common/version.Targets index 110f6c5e95..b1915dd5ce 100644 --- a/src/Common/version.Targets +++ b/src/Common/version.Targets @@ -2,10 +2,10 @@ 2.6 - 2.18.0.0 + 2.21.0.3 XSharp BV XSharp - Copyright (c) XSharp BV 2015-2023. + Copyright (c) XSharp BV 2015-2024. XSharp Cahors diff --git a/src/Compiler/eng/Versions.props b/src/Compiler/eng/Versions.props index 82150e1e69..c9abc76a21 100644 --- a/src/Compiler/eng/Versions.props +++ b/src/Compiler/eng/Versions.props @@ -15,7 +15,7 @@ See License.txt in the project root for license information. 2 21 0 - 0 + 2 $(MajorVersion).$(MinorVersion).$(PatchVersion) diff --git a/src/Tests/FoxEmbeddedSql/Program.prg b/src/Tests/FoxEmbeddedSql/Program.prg index e521a2579b..c408867bc7 100644 --- a/src/Tests/FoxEmbeddedSql/Program.prg +++ b/src/Tests/FoxEmbeddedSql/Program.prg @@ -66,14 +66,16 @@ FUNCTION Start() AS VOID STRICT ENDIF DELETE FROM employee where EmpID = 1 - DELETE FROM Database!employee where EmpID = 1 + + //DELETE FROM Database!employee where EmpID = 1 + DELETE MyProducts FROM MSRPList ; WHERE MSRPList.ProdID = MyProducts.ProdID; AND MSRPList.discontinued = .t. - DELETE DB!MyProducts FROM DB!MSRPList ; - WHERE MSRPList.ProdID = MyProducts.ProdID; - AND MSRPList.discontinued = .t. +// DELETE DB!MyProducts FROM DB!MSRPList ; +// WHERE MSRPList.ProdID = MyProducts.ProdID; +// AND MSRPList.discontinued = .t. UPDATE MyProducts SET MSRP=MyUpdates.MSRP FROM MyUpdates WHERE MyProducts.ProdID=MyUpdates.ProdID UPDATE products ; diff --git a/src/Tests/General/Program.prg b/src/Tests/General/Program.prg index 98420d88c4..c73e07c0e5 100644 --- a/src/Tests/General/Program.prg +++ b/src/Tests/General/Program.prg @@ -3,8 +3,11 @@ local s aS sYMBOL local str aS string local l as long - S := U + s := u str := u l := u - ? S, l + ? s, l + + wait + diff --git a/src/Tests/VFPXPorterTest/VFPXPorterTest.xsproj b/src/Tests/VFPXPorterTest/VFPXPorterTest.xsproj index 05aa8eaf72..5f85ad61b7 100644 --- a/src/Tests/VFPXPorterTest/VFPXPorterTest.xsproj +++ b/src/Tests/VFPXPorterTest/VFPXPorterTest.xsproj @@ -20,6 +20,10 @@ False UnitTest VFPXPorterTest + + True + True + True AnyCPU diff --git a/src/Tests/XSharp.VFP.UI_Test/MainWindow.prg b/src/Tests/XSharp.VFP.UI_Test/MainWindow.prg index 36c7dfda4e..e447a72374 100644 --- a/src/Tests/XSharp.VFP.UI_Test/MainWindow.prg +++ b/src/Tests/XSharp.VFP.UI_Test/MainWindow.prg @@ -21,7 +21,7 @@ BEGIN NAMESPACE XSharp.VFP.UI_Test public constructor() strict SUPER() - InitializeComponent() + SELF:InitializeComponent() return end constructor PRIVATE METHOD quitToolStripMenuItem_Click(sender AS System.Object, e AS System.EventArgs) AS VOID STRICT diff --git a/src/Tests/XSharp.VFP.UI_Test/MiscControl.prg b/src/Tests/XSharp.VFP.UI_Test/MiscControl.prg index 39c10d3497..c975899d16 100644 --- a/src/Tests/XSharp.VFP.UI_Test/MiscControl.prg +++ b/src/Tests/XSharp.VFP.UI_Test/MiscControl.prg @@ -17,7 +17,7 @@ BEGIN NAMESPACE XSharp.VFP.UI_Test PUBLIC CONSTRUCTOR() STRICT//Form1 USE Customer // - InitializeComponent() + SELF:InitializeComponent() // RETURN diff --git a/src/Tests/XSharp.VFP.UI_Test/TestVFPForm.prg b/src/Tests/XSharp.VFP.UI_Test/TestVFPForm.prg index ccfdac2566..f48dc65727 100644 --- a/src/Tests/XSharp.VFP.UI_Test/TestVFPForm.prg +++ b/src/Tests/XSharp.VFP.UI_Test/TestVFPForm.prg @@ -13,7 +13,7 @@ begin namespace XSharp.VFP.UI_Test public partial class TestVFPForm inherit XSharp.VFP.UI.Form public constructor() strict - InitializeComponent() + SELF:InitializeComponent() SELF:mDIForm := True return end constructor diff --git a/src/Tests/XSharp.VFP.UI_Test/TestVFPTextBox.prg b/src/Tests/XSharp.VFP.UI_Test/TestVFPTextBox.prg index bf17efe74f..8485514578 100644 --- a/src/Tests/XSharp.VFP.UI_Test/TestVFPTextBox.prg +++ b/src/Tests/XSharp.VFP.UI_Test/TestVFPTextBox.prg @@ -14,7 +14,7 @@ BEGIN NAMESPACE XSharp.VFP.UI_Test INHERIT System.Windows.Forms.Form public constructor() strict - InitializeComponent() + SELF:InitializeComponent() SELF:vfpTextBox2:Value := __Usual{0} SELF:vfpTextBox2:InputMask := "99,999.99" diff --git a/src/Tests/XSharp.VFP.UI_Test/XSharp.VFP.UI_Test.xsproj b/src/Tests/XSharp.VFP.UI_Test/XSharp.VFP.UI_Test.xsproj index 4df8c13d00..f92addd74d 100644 --- a/src/Tests/XSharp.VFP.UI_Test/XSharp.VFP.UI_Test.xsproj +++ b/src/Tests/XSharp.VFP.UI_Test/XSharp.VFP.UI_Test.xsproj @@ -21,6 +21,8 @@ True True True + False + True AnyCPU diff --git a/src/Tools/DeployMsBuildSupport/DeployMsBuildSupport.xsproj b/src/Tools/DeployMsBuildSupport/DeployMsBuildSupport.xsproj index 88aef5816f..14b667946a 100644 --- a/src/Tools/DeployMsBuildSupport/DeployMsBuildSupport.xsproj +++ b/src/Tools/DeployMsBuildSupport/DeployMsBuildSupport.xsproj @@ -18,6 +18,9 @@ true AnyCPU + True + True + True true @@ -48,12 +51,12 @@ Properties\constants.prg - + - + 4.3.1 diff --git a/src/Tools/RegisterProvider/RegisterProvider.xsproj b/src/Tools/RegisterProvider/RegisterProvider.xsproj index e8a5df0b64..fb50156b9b 100644 --- a/src/Tools/RegisterProvider/RegisterProvider.xsproj +++ b/src/Tools/RegisterProvider/RegisterProvider.xsproj @@ -17,6 +17,8 @@ true True + True + True AnyCPU diff --git a/src/Tools/UDCTester/Settings.prg b/src/Tools/UDCTester/Settings.prg index 57c0690ff3..6bbc52d5f3 100644 --- a/src/Tools/UDCTester/Settings.prg +++ b/src/Tools/UDCTester/Settings.prg @@ -13,8 +13,8 @@ BEGIN NAMESPACE UDCTesterApp PUBLIC PARTIAL CLASS Settings ; INHERIT System.Windows.Forms.Form - PUBLIC CONSTRUCTOR() STRICT - InitializeComponent() + PUBLIC CONSTRUCTOR() STRICT + SELF:InitializeComponent() SELF:tbOutputPath:Text := oSettings:OutputPath SELF:chkWriteToPPO:Checked := oSettings:WritePPO SELF:chkLexerTokens:Checked := oSettings:WriteLexTokens @@ -25,20 +25,20 @@ BEGIN NAMESPACE UDCTesterApp SELF:comboDialect:Text := oSettings:DefaultDialect RETURN PRIVATE METHOD btnOk_Click(sender AS System.Object, e AS System.EventArgs) AS VOID STRICT - oSettings:OutputPath := SELF:tbOutputPath:Text - oSettings:WritePPO := SELF:chkWriteToPPO:Checked - oSettings:WriteLexTokens := SELF:chkLexerTokens:Checked - oSettings:WritePPTokens := SELF:chkPreprocessorTokens:Checked + oSettings:OutputPath := SELF:tbOutputPath:Text + oSettings:WritePPO := SELF:chkWriteToPPO:Checked + oSettings:WriteLexTokens := SELF:chkLexerTokens:Checked + oSettings:WritePPTokens := SELF:chkPreprocessorTokens:Checked oSettings:DefaultNoStdDefs := SELF:chkNoStandardDefs:Checked oSettings:HideComments := SELF:chkHideComments:Checked - oSettings:HideWhitespace := SELF:chkHideWhitespace:Checked + oSettings:HideWhitespace := SELF:chkHideWhitespace:Checked oSettings:DefaultDialect := SELF:comboDialect:Text oSettings:WriteSettings() SELF:DialogResult := DialogResult.OK SELF:Close() - + RETURN - END CLASS + END CLASS END NAMESPACE diff --git a/src/Tools/UDCTester/UDCTester.prg b/src/Tools/UDCTester/UDCTester.prg index 5638d1492e..ae99705c21 100644 --- a/src/Tools/UDCTester/UDCTester.prg +++ b/src/Tools/UDCTester/UDCTester.prg @@ -113,7 +113,7 @@ BEGIN NAMESPACE UDCTesterApp VAR tokens := stream:GetTokens() sb:AppendLine("Nr,Channel, Position, Line, Column, Type, Text") FOREACH token AS XSharpToken IN tokens - WriteToken(sb, token) + SELF:WriteToken(sb, token) NEXT File.WriteAllText(cFile,sb:ToString()) RETURN diff --git a/src/Tools/UDCTester/UDCTester.xsproj b/src/Tools/UDCTester/UDCTester.xsproj index 76e1159ffd..321fccf89e 100644 --- a/src/Tools/UDCTester/UDCTester.xsproj +++ b/src/Tools/UDCTester/UDCTester.xsproj @@ -20,6 +20,10 @@ 4 true $(SolutionDir)Tools\VOXporter\Source\VOXPorter\Resources\XSharp.ico + + True + True + True NDEBUG @@ -44,11 +48,11 @@ - + Properties\CommonAssemblyInfo.prg - - Properties\constants.prg + + Properties\constants.prg Code diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/AboutDialog.prg b/src/Tools/VFPXPorter/Source/VFPXPorter/AboutDialog.prg index 8a21012085..952986a4c1 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/AboutDialog.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/AboutDialog.prg @@ -9,7 +9,7 @@ BEGIN NAMESPACE VFPXPorter PUBLIC PARTIAL CLASS AboutDialog ; INHERIT System.Windows.Forms.Form PUBLIC CONSTRUCTOR() STRICT //AboutDialog - InitializeComponent() + SELF:InitializeComponent() RETURN PRIVATE METHOD AboutDialog_Load(sender AS OBJECT, e AS System.EventArgs) AS VOID STRICT LOCAL currentAsm AS FabAssemblyInfo diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/ExportItemWindow.prg b/src/Tools/VFPXPorter/Source/VFPXPorter/ExportItemWindow.prg index 2e71a192d8..fc8efc5918 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/ExportItemWindow.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/ExportItemWindow.prg @@ -13,14 +13,14 @@ PUBLIC PARTIAL CLASS ExportItemWindow ; INHERIT System.Windows.Forms.Form PROPERTY xPorter AS IXPorter AUTO PROPERTY extension AS STRING AUTO - + PROPERTY Settings AS XPorterSettings AUTO - + PUBLIC CONSTRUCTOR() STRICT //ExportWindow - InitializeComponent() + SELF:InitializeComponent() extension := "scx" RETURN - + PRIVATE METHOD exportButton_Click(sender AS OBJECT, e AS System.EventArgs) AS VOID // Check what we try to export SELF:infoStripError:Text := "" @@ -33,19 +33,19 @@ PUBLIC PARTIAL CLASS ExportItemWindow ; MessageBox.Show( "Error during Component processing.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error ) RETURN ENDIF - DoExport() - + SELF:DoExport() + PUBLIC METHOD DoExport() AS VOID // DoBackup, ProcessFirst SELF:Processing( TRUE ) SELF:backgroundExport:RunWorkerAsync() RETURN - + METHOD Processing( state AS LOGIC ) AS VOID SELF:exportButton:Enabled := !state SELF:cancelBtn:Visible := state - - + + PRIVATE METHOD scxButton_Click(sender AS OBJECT, e AS System.EventArgs) AS VOID STRICT LOCAL ofd AS OpenFileDialog // @@ -158,7 +158,7 @@ PUBLIC PARTIAL CLASS ExportItemWindow ; PRIVATE METHOD cancelBtn_Click(sender AS OBJECT, e AS System.EventArgs) AS VOID STRICT SELF:backgroundExport:CancelAsync() RETURN - - + + END CLASS END NAMESPACE diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/ExportProjectWindow.prg b/src/Tools/VFPXPorter/Source/VFPXPorter/ExportProjectWindow.prg index f96e897edf..103faf5593 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/ExportProjectWindow.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/ExportProjectWindow.prg @@ -16,7 +16,7 @@ BEGIN NAMESPACE VFPXPorter PROPERTY Settings AS XPorterSettings AUTO PUBLIC CONSTRUCTOR() STRICT //ExportWindow - InitializeComponent() + SELF:InitializeComponent() RETURN PRIVATE METHOD exportButton_Click(sender AS OBJECT, e AS System.EventArgs) AS VOID @@ -175,7 +175,7 @@ BEGIN NAMESPACE VFPXPorter NEXT foreach subfolder AS String in Directory.GetDirectories(folderPath) - EraseFolder(subfolder, TRUE) + SELF:EraseFolder(subfolder, TRUE) NEXT IF eraseTop Directory.Delete( folderPath ) diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/FabAssemblyInfo.prg b/src/Tools/VFPXPorter/Source/VFPXPorter/FabAssemblyInfo.prg index 41f6a61cc4..5713f9413e 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/FabAssemblyInfo.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/FabAssemblyInfo.prg @@ -11,14 +11,14 @@ BEGIN NAMESPACE VFPXPorter PUBLIC CLASS FabAssemblyInfo PRIVATE asembly AS Assembly - PUBLIC PROPERTY Company AS STRING GET GetAssemblyAttribute({a AS AssemblyCompanyAttribute => a:Company}) - PUBLIC PROPERTY Product AS STRING GET GetAssemblyAttribute({a AS AssemblyProductAttribute => a:Product}) - PUBLIC PROPERTY Copyright AS STRING GET GetAssemblyAttribute({a AS AssemblyCopyrightAttribute => a:Copyright}) - PUBLIC PROPERTY Trademark AS STRING GET GetAssemblyAttribute({a AS AssemblyTrademarkAttribute => a:Trademark}) - PUBLIC PROPERTY Title AS STRING GET GetAssemblyAttribute({a AS AssemblyTitleAttribute => a:Title}) - PUBLIC PROPERTY Description AS STRING GET GetAssemblyAttribute({a AS AssemblyDescriptionAttribute => a:Description}) - PUBLIC PROPERTY Configuration AS STRING GET GetAssemblyAttribute({a AS AssemblyDescriptionAttribute => a:Description}) - PUBLIC PROPERTY FileVersion AS STRING GET GetAssemblyAttribute({a AS AssemblyFileVersionAttribute => a:Version}) + PUBLIC PROPERTY Company AS STRING GET SELF:GetAssemblyAttribute({a AS AssemblyCompanyAttribute => a:Company}) + PUBLIC PROPERTY Product AS STRING GET SELF:GetAssemblyAttribute({a AS AssemblyProductAttribute => a:Product}) + PUBLIC PROPERTY Copyright AS STRING GET SELF:GetAssemblyAttribute({a AS AssemblyCopyrightAttribute => a:Copyright}) + PUBLIC PROPERTY Trademark AS STRING GET SELF:GetAssemblyAttribute({a AS AssemblyTrademarkAttribute => a:Trademark}) + PUBLIC PROPERTY Title AS STRING GET SELF:GetAssemblyAttribute({a AS AssemblyTitleAttribute => a:Title}) + PUBLIC PROPERTY Description AS STRING GET SELF:GetAssemblyAttribute({a AS AssemblyDescriptionAttribute => a:Description}) + PUBLIC PROPERTY Configuration AS STRING GET SELF:GetAssemblyAttribute({a AS AssemblyDescriptionAttribute => a:Description}) + PUBLIC PROPERTY FileVersion AS STRING GET SELF:GetAssemblyAttribute({a AS AssemblyFileVersionAttribute => a:Version}) // PUBLIC PROPERTY Version AS Version GET asembly:GetName():Version diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/FabIniFileAsJSON.prg b/src/Tools/VFPXPorter/Source/VFPXPorter/FabIniFileAsJSON.prg index 6663346b2a..377b32ccc3 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/FabIniFileAsJSON.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/FabIniFileAsJSON.prg @@ -89,7 +89,7 @@ BEGIN NAMESPACE VFPXPorter PUBLIC METHOD WriteValue(Section AS STRING , Key AS STRING , newValue AS STRING ) AS VOID - WritePrivateProfileString(Section, Key, newValue) + SELF:WritePrivateProfileString(Section, Key, newValue) PUBLIC METHOD WriteLogic(Section AS STRING , Key AS STRING , newValue AS LOGIC ) AS VOID @@ -99,13 +99,13 @@ BEGIN NAMESPACE VFPXPorter IF (newValue) writeValue := "true" ENDIF - WritePrivateProfileString(Section, Key, writeValue) + SELF:WritePrivateProfileString(Section, Key, writeValue) PUBLIC METHOD WriteValue(Section AS STRING , Key AS STRING , newValue AS LOGIC ) AS VOID SELF:WriteLogic( Section, Key, newValue ) PUBLIC METHOD WriteLong(Section AS STRING , Key AS STRING , newValue AS LONG ) AS VOID - WritePrivateProfileString(Section, Key, newValue:ToString()) + SELF:WritePrivateProfileString(Section, Key, newValue:ToString()) PUBLIC METHOD WriteValue(Section AS STRING , Key AS STRING , newValue AS LONG ) AS VOID SELF:WriteLong( Section, Key, newValue ) @@ -115,7 +115,7 @@ BEGIN NAMESPACE VFPXPorter PUBLIC METHOD ReadValue(Section AS STRING , Key AS STRING , defValue AS STRING ) AS STRING - RETURN GetPrivateProfileString(Section, Key, defValue) + RETURN SELF:GetPrivateProfileString(Section, Key, defValue) PUBLIC METHOD ReadLogic(Section AS STRING , Key AS STRING , defValue AS LOGIC ) AS LOGIC @@ -160,4 +160,4 @@ BEGIN NAMESPACE VFPXPorter RETURN result END CLASS -END NAMESPACE // VFPXPorter \ No newline at end of file +END NAMESPACE // VFPXPorter diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/MainWindow.prg b/src/Tools/VFPXPorter/Source/VFPXPorter/MainWindow.prg index dc18540ed6..db8fd4930c 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/MainWindow.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/MainWindow.prg @@ -15,7 +15,7 @@ BEGIN NAMESPACE VFPXPorter INHERIT System.Windows.Forms.Form PRIVATE jsonSettings AS ExporterSettings PUBLIC CONSTRUCTOR() STRICT//Form1 - InitializeComponent() + SELF:InitializeComponent() //VAR storingPath := Path.GetDirectoryName( Application.ExecutablePath ) // // !!! Settings of VFPXPorter.exe are stored in %userfolder%/AppData/Roaming/XSharp diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/SettingsDialog.prg b/src/Tools/VFPXPorter/Source/VFPXPorter/SettingsDialog.prg index 955602474c..5bad468137 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/SettingsDialog.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/SettingsDialog.prg @@ -14,7 +14,7 @@ BEGIN NAMESPACE VFPXPorter PRIVATE iniSettings AS ExporterSettings PUBLIC CONSTRUCTOR( ini AS ExporterSettings ) STRICT //SettingsDialog - InitializeComponent() + SELF:InitializeComponent() SELF:iniSettings := ini RETURN diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/VFPXPorter.xsproj b/src/Tools/VFPXPorter/Source/VFPXPorter/VFPXPorter.xsproj index 24db6df09f..b544975c45 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/VFPXPorter.xsproj +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/VFPXPorter.xsproj @@ -20,6 +20,7 @@ True True True + True true diff --git a/src/Tools/VFPXPorter/Source/VFPXPorter/WarningDialog.prg b/src/Tools/VFPXPorter/Source/VFPXPorter/WarningDialog.prg index 662ceb83bb..070a1c6133 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorter/WarningDialog.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorter/WarningDialog.prg @@ -14,7 +14,7 @@ BEGIN NAMESPACE VFPXPorter INHERIT System.Windows.Forms.Form public constructor() strict - InitializeComponent() + SELF:InitializeComponent() return end constructor PRIVATE METHOD buttonAgreed_Click(sender AS System.Object, e AS System.EventArgs) AS VOID STRICT @@ -30,8 +30,8 @@ BEGIN NAMESPACE VFPXPorter // SELF:rtfWarning:Text += "Unfortunately, 100% compatibility is not possible to achieve, due to important design differences with the .Net framework, " // SELF:rtfWarning:Text += "so, depending on the size and type of your application(s), a small or larger amount of changes need to be made to your code, " // SELF:rtfWarning:Text += "in order to allow it to compile and execute properly in X#." - - SELF:rtfWarning:Text := VFPXPorter.Properties.Resources.Warning + // Set Warning content stored in Resources to RTF Content + SELF:rtfWarning:Rtf := VFPXPorter.Properties.Resources.Warning SELF:buttonAgreed:Enabled := TRUE SELF:checkDontShow:Enabled := TRUE diff --git a/src/Tools/VFPXPorter/Source/VFPXPorterCmd/VFPXPorterCmd.xsproj b/src/Tools/VFPXPorter/Source/VFPXPorterCmd/VFPXPorterCmd.xsproj index cdb11177f5..498dca151f 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorterCmd/VFPXPorterCmd.xsproj +++ b/src/Tools/VFPXPorter/Source/VFPXPorterCmd/VFPXPorterCmd.xsproj @@ -19,6 +19,8 @@ True True True + + True true diff --git a/src/Tools/VFPXPorter/Source/VFPXPorterLib/SCXVCXItem.prg b/src/Tools/VFPXPorter/Source/VFPXPorterLib/SCXVCXItem.prg index 28e0f4ff2d..c954543234 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorterLib/SCXVCXItem.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorterLib/SCXVCXItem.prg @@ -139,7 +139,7 @@ BEGIN NAMESPACE VFPXPorterLib newProp := newProp:Substring(0,newProp:Length-1) ENDIF ENDIF - newProp := ReplaceCaseInsensitive( newProp, "<@"+token+"@>", data) + newProp := SELF:ReplaceCaseInsensitive( newProp, "<@"+token+"@>", data) Found := TRUE ENDIF NEXT @@ -155,7 +155,7 @@ BEGIN NAMESPACE VFPXPorterLib // Get the value of this "Fox" Property VAR data := propList:Item[ token ] // and put that value at the replaceable position - newProp := ReplaceCaseInsensitive( newProp, "<@"+token+"@>", data) + newProp := SELF:ReplaceCaseInsensitive( newProp, "<@"+token+"@>", data) Found := TRUE ENDIF NEXT diff --git a/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterLib.xsproj b/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterLib.xsproj index fe11b2ecd7..5f6d83ae96 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterLib.xsproj +++ b/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterLib.xsproj @@ -19,6 +19,8 @@ True True True + + True true @@ -217,9 +219,6 @@ 13.0.1 - - 2.12.0 - 5.0.0 diff --git a/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterMenu.prg b/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterMenu.prg index 75dc1b23d3..732848fe4c 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterMenu.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterMenu.prg @@ -431,7 +431,7 @@ BEGIN NAMESPACE VFPXPorterLib Directory.CreateDirectory( tempPath ) // Now, extract code : // This will copy code to an External file, and replace the RawCode property with the FullPath of the External File - ExtractCode( tempPath, newList, "" ) + SELF:ExtractCode( tempPath, newList, "" ) // Serialize the Items List //VAR result := JsonConvert.SerializeObject( newList ) // Save the Serialization @@ -473,7 +473,7 @@ BEGIN NAMESPACE VFPXPorterLib item:PROCEDURE := destFile ENDIF IF item:Childs:Count > 0 - ExtractCode( tempPath, item:Childs, IIF( String.IsNullOrEmpty(parent), "", parent + "_" ) + item:Name ) + SELF:ExtractCode( tempPath, item:Childs, IIF( String.IsNullOrEmpty(parent), "", parent + "_" ) + item:Name ) ENDIF NEXT // @@ -485,7 +485,7 @@ BEGIN NAMESPACE VFPXPorterLib // total++ FOREACH VAR subItem IN item:Childs - total += EnumItems( subItem:Childs ) + total += SELF:EnumItems( subItem:Childs ) NEXT NEXT RETURN total diff --git a/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterReport.prg b/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterReport.prg index 7e4a7b5ee4..7a2d434e27 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterReport.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorterLib/VFPXPorterReport.prg @@ -63,12 +63,12 @@ BEGIN NAMESPACE VFPXPorterLib XPorterLogger.Instance:Information( "High Level Items : "+ Items:Count:ToString() ) XPorterLogger.Instance:Information( "Total Items : "+ tmpitems:Count:ToString() ) // Make some corrections if needed - PostProcessItems( SELF:Items ) + SELF:PostProcessItems( SELF:Items ) // For the Analyze text - EnumItems( SELF:Items, "" ) + SELF:EnumItems( SELF:Items, "" ) IF doBackup // Backup the MNX file to an XML file - Serialize( SELF:Items ) + SELF:Serialize( SELF:Items ) ENDIF ENDIF RETURN success diff --git a/src/Tools/VFPXPorter/Source/VFPXPorterLib/XPorterCtrlForm.prg b/src/Tools/VFPXPorter/Source/VFPXPorterLib/XPorterCtrlForm.prg index caaf9b102b..d2f5b51306 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorterLib/XPorterCtrlForm.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorterLib/XPorterCtrlForm.prg @@ -181,7 +181,7 @@ BEGIN NAMESPACE VFPXPorterLib ENDIF ENDIF IF item:Childs:Count > 0 - ExtractCode( tempPath, item:Childs, IIF( String.IsNullOrEmpty(parent), "", parent + "_" ) + item:Name ) + SELF:ExtractCode( tempPath, item:Childs, IIF( String.IsNullOrEmpty(parent), "", parent + "_" ) + item:Name ) ENDIF NEXT // @@ -242,7 +242,7 @@ BEGIN NAMESPACE VFPXPorterLib // Set of Rules LOCAL evtRules AS Dictionary // Use the Rendering ClassName in order to get the Events name - evtRules := BuildEventRules( eventList, subItem:BaseClassName ) + evtRules := SELF:BuildEventRules( eventList, subItem:BaseClassName ) // Apply Rules and Create EventHandlers subItem:ConvertEvents( evtRules, sttmnt, vfpElt, SELF:Settings ) // @@ -883,7 +883,7 @@ BEGIN NAMESPACE VFPXPorterLib VAR handlers := StringBuilder{} FOREACH VAR subItem IN oneItem:Childs // - handlers:AppendLine( BuildEventHandlers( subItem ) ) + handlers:AppendLine( SELF:BuildEventHandlers( subItem ) ) NEXT // Any event for the Form ? handlers:AppendLine( SELF:BuildEventHandlers( oneItem ) ) @@ -1072,7 +1072,7 @@ BEGIN NAMESPACE VFPXPorterLib setDataEnv:Append("{}") setDataEnv:Append(Environment.NewLine) // Set of Rules - dataRules := BuildControlRules( SELF:_propertiesRules, cursorItem:FoxClassName ) + dataRules := SELF:BuildControlRules( SELF:_propertiesRules, cursorItem:FoxClassName ) // Apply Rules to Properties cursorItem:ConvertProperties( dataRules, SELF:_defaultValues ) setDataEnv:Append( cursorItem:ApplyPropertiesRules( TRUE ) ) diff --git a/src/Tools/VFPXPorter/Source/VFPXPorterLib/XPorterProject.prg b/src/Tools/VFPXPorter/Source/VFPXPorterLib/XPorterProject.prg index 30d1c7f5b7..a01a14c59e 100644 --- a/src/Tools/VFPXPorter/Source/VFPXPorterLib/XPorterProject.prg +++ b/src/Tools/VFPXPorter/Source/VFPXPorterLib/XPorterProject.prg @@ -233,7 +233,7 @@ BEGIN NAMESPACE VFPXPorterLib METHOD ExportProject( doBackup AS LOGIC, asyncWorker AS BackgroundWorker ) AS LOGIC LOCAL result := TRUE AS LOGIC LOCAL exitExport := FALSE AS LOGIC - VAR Dependencies := EnumerateDependencies( ) + VAR Dependencies := SELF:EnumerateDependencies( ) // TRY // All strings written to ResultText will be written to the log File @@ -696,7 +696,7 @@ BEGIN NAMESPACE VFPXPorterLib Dependencies:Add( lib:Name ) NEXT // Ok, then, look for All dependencies, and Dependencies of dependencies, and ... - Dependencies := EnumerateDependencies( Dependencies ) + Dependencies := SELF:EnumerateDependencies( Dependencies ) RETURN Dependencies PRIVATE METHOD EnumerateDependencies( Dependencies AS HashSet ) AS HashSet diff --git a/src/Tools/VOXporter/Fab_VO_Entities.xsproj b/src/Tools/VOXporter/Fab_VO_Entities.xsproj index 7d069100fd..c7cf64bbf8 100644 --- a/src/Tools/VOXporter/Fab_VO_Entities.xsproj +++ b/src/Tools/VOXporter/Fab_VO_Entities.xsproj @@ -20,6 +20,8 @@ 165 win-x86 x86 + True + True true diff --git a/src/Tools/VOXporter/VOXPorter.xsproj b/src/Tools/VOXporter/VOXPorter.xsproj index 8bf170b4a7..052ddcd003 100644 --- a/src/Tools/VOXporter/VOXPorter.xsproj +++ b/src/Tools/VOXporter/VOXPorter.xsproj @@ -24,6 +24,7 @@ false True + True true diff --git a/src/Tools/XPorter/XPorter.xsproj b/src/Tools/XPorter/XPorter.xsproj index 75358d1faf..7142c3211e 100644 --- a/src/Tools/XPorter/XPorter.xsproj +++ b/src/Tools/XPorter/XPorter.xsproj @@ -2,7 +2,7 @@ - + XPorter 8a49a47c-ade7-416c-8b28-cd3b401cbc25 WinExe @@ -40,6 +40,8 @@ 1591 True True + True + True true diff --git a/src/VSIntegration2022.sln b/src/VSIntegration2022.sln index 60be6ea2c1..31f63a8ca2 100644 --- a/src/VSIntegration2022.sln +++ b/src/VSIntegration2022.sln @@ -63,89 +63,250 @@ EndProject Project("{AA6C8D78-22FF-423A-9C7C-5F2393824E04}") = "VOXPorter", "Tools\VOXporter\VOXPorter.xsproj", "{939B111B-6EBD-490F-A7F4-CE923D758A3B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeDomProvider", "VisualStudio\CodeDomProvider\CodeDomProvider.csproj", "{7B7D9574-66A7-4719-AA48-C2386D7BF153}" + EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|arm64 = Debug|arm64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|arm64 = Release|arm64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Debug|arm64.ActiveCfg = Debug|Any CPU + {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Debug|arm64.Build.0 = Debug|Any CPU + {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Debug|x86.ActiveCfg = Debug|Any CPU + {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Debug|x86.Build.0 = Debug|Any CPU {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Release|Any CPU.Build.0 = Release|Any CPU + {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Release|arm64.ActiveCfg = Release|Any CPU + {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Release|arm64.Build.0 = Release|Any CPU + {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Release|x86.ActiveCfg = Release|Any CPU + {63D22C03-1D1A-4746-8E24-7BB1248696EE}.Release|x86.Build.0 = Release|Any CPU {CACB60A9-1E76-4F92-8831-B134A658C696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CACB60A9-1E76-4F92-8831-B134A658C696}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CACB60A9-1E76-4F92-8831-B134A658C696}.Debug|arm64.ActiveCfg = Debug|Any CPU + {CACB60A9-1E76-4F92-8831-B134A658C696}.Debug|arm64.Build.0 = Debug|Any CPU + {CACB60A9-1E76-4F92-8831-B134A658C696}.Debug|x86.ActiveCfg = Debug|Any CPU + {CACB60A9-1E76-4F92-8831-B134A658C696}.Debug|x86.Build.0 = Debug|Any CPU {CACB60A9-1E76-4F92-8831-B134A658C696}.Release|Any CPU.ActiveCfg = Release|Any CPU {CACB60A9-1E76-4F92-8831-B134A658C696}.Release|Any CPU.Build.0 = Release|Any CPU + {CACB60A9-1E76-4F92-8831-B134A658C696}.Release|arm64.ActiveCfg = Release|Any CPU + {CACB60A9-1E76-4F92-8831-B134A658C696}.Release|arm64.Build.0 = Release|Any CPU + {CACB60A9-1E76-4F92-8831-B134A658C696}.Release|x86.ActiveCfg = Release|Any CPU + {CACB60A9-1E76-4F92-8831-B134A658C696}.Release|x86.Build.0 = Release|Any CPU {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Debug|arm64.ActiveCfg = Debug|arm64 + {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Debug|arm64.Build.0 = Debug|arm64 + {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Debug|x86.ActiveCfg = Debug|x86 + {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Debug|x86.Build.0 = Debug|x86 {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Release|Any CPU.ActiveCfg = Release|Any CPU {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Release|Any CPU.Build.0 = Release|Any CPU + {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Release|arm64.ActiveCfg = Release|arm64 + {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Release|arm64.Build.0 = Release|arm64 + {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Release|x86.ActiveCfg = Release|x86 + {FFA0338A-27ED-42BA-B801-EC5AD32A7396}.Release|x86.Build.0 = Release|x86 {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Debug|arm64.ActiveCfg = Debug|Any CPU + {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Debug|arm64.Build.0 = Debug|Any CPU + {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Debug|x86.ActiveCfg = Debug|Any CPU + {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Debug|x86.Build.0 = Debug|Any CPU {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Release|Any CPU.ActiveCfg = Release|Any CPU {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Release|Any CPU.Build.0 = Release|Any CPU + {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Release|arm64.ActiveCfg = Release|Any CPU + {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Release|arm64.Build.0 = Release|Any CPU + {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Release|x86.ActiveCfg = Release|Any CPU + {4484939E-DDA8-4033-8B1C-E8F60A2BAFE1}.Release|x86.Build.0 = Release|Any CPU {16272550-75E6-4B9D-91E3-653BD141C756}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {16272550-75E6-4B9D-91E3-653BD141C756}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16272550-75E6-4B9D-91E3-653BD141C756}.Debug|arm64.ActiveCfg = Debug|arm64 + {16272550-75E6-4B9D-91E3-653BD141C756}.Debug|arm64.Build.0 = Debug|arm64 + {16272550-75E6-4B9D-91E3-653BD141C756}.Debug|x86.ActiveCfg = Debug|x86 + {16272550-75E6-4B9D-91E3-653BD141C756}.Debug|x86.Build.0 = Debug|x86 {16272550-75E6-4B9D-91E3-653BD141C756}.Release|Any CPU.ActiveCfg = Release|Any CPU {16272550-75E6-4B9D-91E3-653BD141C756}.Release|Any CPU.Build.0 = Release|Any CPU + {16272550-75E6-4B9D-91E3-653BD141C756}.Release|arm64.ActiveCfg = Release|arm64 + {16272550-75E6-4B9D-91E3-653BD141C756}.Release|arm64.Build.0 = Release|arm64 + {16272550-75E6-4B9D-91E3-653BD141C756}.Release|x86.ActiveCfg = Release|x86 + {16272550-75E6-4B9D-91E3-653BD141C756}.Release|x86.Build.0 = Release|x86 {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Debug|arm64.ActiveCfg = Debug|arm64 + {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Debug|arm64.Build.0 = Debug|arm64 + {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Debug|x86.ActiveCfg = Debug|x86 + {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Debug|x86.Build.0 = Debug|x86 {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Release|Any CPU.ActiveCfg = Release|Any CPU {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Release|Any CPU.Build.0 = Release|Any CPU + {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Release|arm64.ActiveCfg = Release|arm64 + {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Release|arm64.Build.0 = Release|arm64 + {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Release|x86.ActiveCfg = Release|x86 + {F4ADEBDB-CD20-4532-B4E3-FE7424F5369D}.Release|x86.Build.0 = Release|x86 {5190E508-E052-41D5-8824-EA472241489A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5190E508-E052-41D5-8824-EA472241489A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5190E508-E052-41D5-8824-EA472241489A}.Debug|arm64.ActiveCfg = Debug|Any CPU + {5190E508-E052-41D5-8824-EA472241489A}.Debug|arm64.Build.0 = Debug|Any CPU + {5190E508-E052-41D5-8824-EA472241489A}.Debug|x86.ActiveCfg = Debug|Any CPU + {5190E508-E052-41D5-8824-EA472241489A}.Debug|x86.Build.0 = Debug|Any CPU {5190E508-E052-41D5-8824-EA472241489A}.Release|Any CPU.ActiveCfg = Release|Any CPU {5190E508-E052-41D5-8824-EA472241489A}.Release|Any CPU.Build.0 = Release|Any CPU + {5190E508-E052-41D5-8824-EA472241489A}.Release|arm64.ActiveCfg = Release|Any CPU + {5190E508-E052-41D5-8824-EA472241489A}.Release|arm64.Build.0 = Release|Any CPU + {5190E508-E052-41D5-8824-EA472241489A}.Release|x86.ActiveCfg = Release|Any CPU + {5190E508-E052-41D5-8824-EA472241489A}.Release|x86.Build.0 = Release|Any CPU {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Debug|arm64.ActiveCfg = Debug|Any CPU + {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Debug|arm64.Build.0 = Debug|Any CPU + {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Debug|x86.Build.0 = Debug|Any CPU {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Release|Any CPU.ActiveCfg = Release|Any CPU {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Release|Any CPU.Build.0 = Release|Any CPU + {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Release|arm64.ActiveCfg = Release|Any CPU + {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Release|arm64.Build.0 = Release|Any CPU + {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Release|x86.ActiveCfg = Release|Any CPU + {B9AA5DD9-28D1-445D-8FDD-6195DC479BCC}.Release|x86.Build.0 = Release|Any CPU {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Debug|arm64.ActiveCfg = Debug|Any CPU + {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Debug|arm64.Build.0 = Debug|Any CPU + {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Debug|x86.ActiveCfg = Debug|Any CPU + {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Debug|x86.Build.0 = Debug|Any CPU {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Release|Any CPU.ActiveCfg = Release|Any CPU {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Release|Any CPU.Build.0 = Release|Any CPU + {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Release|arm64.ActiveCfg = Release|Any CPU + {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Release|arm64.Build.0 = Release|Any CPU + {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Release|x86.ActiveCfg = Release|Any CPU + {8A49A47C-ADE7-416C-8B28-CD3B401CBC25}.Release|x86.Build.0 = Release|Any CPU {F9579349-9B33-44A3-A615-D091AB45DBB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F9579349-9B33-44A3-A615-D091AB45DBB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9579349-9B33-44A3-A615-D091AB45DBB8}.Debug|arm64.ActiveCfg = Debug|Any CPU + {F9579349-9B33-44A3-A615-D091AB45DBB8}.Debug|arm64.Build.0 = Debug|Any CPU + {F9579349-9B33-44A3-A615-D091AB45DBB8}.Debug|x86.ActiveCfg = Debug|Any CPU + {F9579349-9B33-44A3-A615-D091AB45DBB8}.Debug|x86.Build.0 = Debug|Any CPU {F9579349-9B33-44A3-A615-D091AB45DBB8}.Release|Any CPU.ActiveCfg = Release|Any CPU {F9579349-9B33-44A3-A615-D091AB45DBB8}.Release|Any CPU.Build.0 = Release|Any CPU + {F9579349-9B33-44A3-A615-D091AB45DBB8}.Release|arm64.ActiveCfg = Release|Any CPU + {F9579349-9B33-44A3-A615-D091AB45DBB8}.Release|arm64.Build.0 = Release|Any CPU + {F9579349-9B33-44A3-A615-D091AB45DBB8}.Release|x86.ActiveCfg = Release|Any CPU + {F9579349-9B33-44A3-A615-D091AB45DBB8}.Release|x86.Build.0 = Release|Any CPU {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Debug|arm64.ActiveCfg = Debug|Any CPU + {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Debug|arm64.Build.0 = Debug|Any CPU + {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Debug|x86.ActiveCfg = Debug|Any CPU + {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Debug|x86.Build.0 = Debug|Any CPU {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Release|Any CPU.ActiveCfg = Release|Any CPU {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Release|Any CPU.Build.0 = Release|Any CPU + {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Release|arm64.ActiveCfg = Release|Any CPU + {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Release|arm64.Build.0 = Release|Any CPU + {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Release|x86.ActiveCfg = Release|Any CPU + {F6DEA3EA-186C-4868-859A-C2EBBEE0D981}.Release|x86.Build.0 = Release|Any CPU {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Debug|arm64.ActiveCfg = Debug|Any CPU + {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Debug|arm64.Build.0 = Debug|Any CPU + {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Debug|x86.ActiveCfg = Debug|Any CPU + {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Debug|x86.Build.0 = Debug|Any CPU {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Release|Any CPU.ActiveCfg = Release|Any CPU {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Release|Any CPU.Build.0 = Release|Any CPU + {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Release|arm64.ActiveCfg = Release|Any CPU + {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Release|arm64.Build.0 = Release|Any CPU + {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Release|x86.ActiveCfg = Release|Any CPU + {B837AC3B-9C61-49E4-9F4F-C8AD1FAF21CC}.Release|x86.Build.0 = Release|Any CPU {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Debug|arm64.ActiveCfg = Debug|Any CPU + {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Debug|arm64.Build.0 = Debug|Any CPU + {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Debug|x86.ActiveCfg = Debug|Any CPU + {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Debug|x86.Build.0 = Debug|Any CPU {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Release|Any CPU.ActiveCfg = Release|Any CPU {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Release|Any CPU.Build.0 = Release|Any CPU + {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Release|arm64.ActiveCfg = Release|Any CPU + {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Release|arm64.Build.0 = Release|Any CPU + {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Release|x86.ActiveCfg = Release|Any CPU + {7619DB88-6286-4EF1-8273-2A08CC8AC70E}.Release|x86.Build.0 = Release|Any CPU {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Debug|arm64.ActiveCfg = Debug|Any CPU + {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Debug|arm64.Build.0 = Debug|Any CPU + {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Debug|x86.ActiveCfg = Debug|Any CPU + {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Debug|x86.Build.0 = Debug|Any CPU {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Release|Any CPU.Build.0 = Release|Any CPU + {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Release|arm64.ActiveCfg = Release|Any CPU + {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Release|arm64.Build.0 = Release|Any CPU + {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Release|x86.ActiveCfg = Release|Any CPU + {EED6843B-B727-4F08-AA32-CA0F48FDDE3F}.Release|x86.Build.0 = Release|Any CPU {BBD309AA-A928-461E-B91C-7C12B1145A06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BBD309AA-A928-461E-B91C-7C12B1145A06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BBD309AA-A928-461E-B91C-7C12B1145A06}.Debug|arm64.ActiveCfg = Debug|Any CPU + {BBD309AA-A928-461E-B91C-7C12B1145A06}.Debug|arm64.Build.0 = Debug|Any CPU + {BBD309AA-A928-461E-B91C-7C12B1145A06}.Debug|x86.ActiveCfg = Debug|Any CPU + {BBD309AA-A928-461E-B91C-7C12B1145A06}.Debug|x86.Build.0 = Debug|Any CPU {BBD309AA-A928-461E-B91C-7C12B1145A06}.Release|Any CPU.ActiveCfg = Release|Any CPU {BBD309AA-A928-461E-B91C-7C12B1145A06}.Release|Any CPU.Build.0 = Release|Any CPU + {BBD309AA-A928-461E-B91C-7C12B1145A06}.Release|arm64.ActiveCfg = Release|Any CPU + {BBD309AA-A928-461E-B91C-7C12B1145A06}.Release|arm64.Build.0 = Release|Any CPU + {BBD309AA-A928-461E-B91C-7C12B1145A06}.Release|x86.ActiveCfg = Release|Any CPU + {BBD309AA-A928-461E-B91C-7C12B1145A06}.Release|x86.Build.0 = Release|Any CPU {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Debug|arm64.ActiveCfg = Debug|arm64 + {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Debug|arm64.Build.0 = Debug|arm64 + {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Debug|x86.ActiveCfg = Debug|x86 + {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Debug|x86.Build.0 = Debug|x86 {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Release|Any CPU.Build.0 = Release|Any CPU + {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Release|arm64.ActiveCfg = Release|arm64 + {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Release|arm64.Build.0 = Release|arm64 + {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Release|x86.ActiveCfg = Release|x86 + {960714E8-FF93-4A42-B9BA-610B0F2014DB}.Release|x86.Build.0 = Release|x86 + + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Debug|arm64.ActiveCfg = Debug|Any CPU + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Debug|arm64.Build.0 = Debug|Any CPU + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Debug|x86.ActiveCfg = Debug|Any CPU + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Debug|x86.Build.0 = Debug|Any CPU {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Release|Any CPU.ActiveCfg = Release|Any CPU {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Release|Any CPU.Build.0 = Release|Any CPU + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Release|arm64.ActiveCfg = Release|Any CPU + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Release|arm64.Build.0 = Release|Any CPU + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Release|x86.ActiveCfg = Release|Any CPU + {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34}.Release|x86.Build.0 = Release|Any CPU {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Debug|arm64.ActiveCfg = Debug|Any CPU + {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Debug|arm64.Build.0 = Debug|Any CPU + {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Debug|x86.ActiveCfg = Debug|Any CPU + {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Debug|x86.Build.0 = Debug|Any CPU {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Release|Any CPU.Build.0 = Release|Any CPU + {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Release|arm64.ActiveCfg = Release|Any CPU + {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Release|arm64.Build.0 = Release|Any CPU + {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Release|x86.ActiveCfg = Release|Any CPU + {939B111B-6EBD-490F-A7F4-CE923D758A3B}.Release|x86.Build.0 = Release|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Debug|arm64.ActiveCfg = Debug|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Debug|arm64.Build.0 = Debug|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Debug|x86.ActiveCfg = Debug|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Debug|x86.Build.0 = Debug|Any CPU {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Release|Any CPU.Build.0 = Release|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Release|arm64.ActiveCfg = Release|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Release|arm64.Build.0 = Release|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Release|x86.ActiveCfg = Release|Any CPU + {7B7D9574-66A7-4719-AA48-C2386D7BF153}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -169,7 +330,9 @@ Global {960714E8-FF93-4A42-B9BA-610B0F2014DB} = {0D3C69B5-D236-42B3-B70D-2C9ABC9D434C} {73C0DCA6-BFE5-40CB-9240-3DB1C37F5B34} = {A6566CA0-CE3D-4F2E-A964-1D6BB3C3A9B1} {939B111B-6EBD-490F-A7F4-CE923D758A3B} = {A6566CA0-CE3D-4F2E-A964-1D6BB3C3A9B1} + {7B7D9574-66A7-4719-AA48-C2386D7BF153} = {9F285506-97D3-486E-B59E-7C30C56B95AE} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6F61AAF2-9C04-4D27-887F-8A475F079D9C} diff --git a/src/VisualStudio/CodeDomProvider/XSharpTreeDiscoverBase.cs b/src/VisualStudio/CodeDomProvider/XSharpTreeDiscoverBase.cs index cb066ddcf1..40bb429934 100644 --- a/src/VisualStudio/CodeDomProvider/XSharpTreeDiscoverBase.cs +++ b/src/VisualStudio/CodeDomProvider/XSharpTreeDiscoverBase.cs @@ -261,21 +261,34 @@ public override void ExitEnum_([NotNull] XSharpParser.Enum_Context context) } #endregion - private void _EnterSource(IToken start) + + private void _EnterSource(IList entities, IToken start) { + foreach (var ent in entities) + { + var sourcefile = ent.Start.TokenSource.SourceName; + if (string.Compare(sourcefile, CurrentFile, true) == 0) + { + start = ent.Start; + break; + } + } var source = (XSharpLexer)start.TokenSource; source.Reset(); _tokens = source.GetAllTokens(); - } - public override void EnterSource([NotNull] XSharpParser.SourceContext context) { - _EnterSource(context.Start); + // fetch the first token that is from OUR file (exclude tokens from the header files) + IToken start = context.Start; + _EnterSource(context._Entities, start); } + + public override void EnterFoxsource([NotNull] XSharpParser.FoxsourceContext context) { - _EnterSource(context.Start); + IToken start = context.Start; + _EnterSource(context._Entities, start); } diff --git a/src/VisualStudio/CodeGenerator/CodeGenerator.xsproj b/src/VisualStudio/CodeGenerator/CodeGenerator.xsproj index c8f9a52a2b..4bf949e18a 100644 --- a/src/VisualStudio/CodeGenerator/CodeGenerator.xsproj +++ b/src/VisualStudio/CodeGenerator/CodeGenerator.xsproj @@ -14,6 +14,8 @@ true v4.7.2 + True + True DEBUG;TRACE diff --git a/src/VisualStudio/LanguageService/Commands/GotoCommand.cs b/src/VisualStudio/LanguageService/Commands/GotoCommand.cs index 968418cbce..e9b9779cad 100644 --- a/src/VisualStudio/LanguageService/Commands/GotoCommand.cs +++ b/src/VisualStudio/LanguageService/Commands/GotoCommand.cs @@ -25,33 +25,56 @@ public static async Task InitializeAsync() private static void GotoBraceExt(DocumentView doc) { - GotoBraceWorker(doc, true); + try + { + GotoBraceWorker(doc, true); + } + catch (Exception) + { + + } } private static void GotoBraceNormal(DocumentView doc) { - GotoBraceWorker(doc, false); + try + { + GotoBraceWorker(doc, false); + } + catch (Exception) + { + + } } private static void GotoBraceWorker(DocumentView doc, bool ext) { var xDocument = doc.TextBuffer.GetDocument(); - var currentChar = doc.TextView.Caret.Position.BufferPosition; - if (char.IsWhiteSpace(currentChar.GetChar())) + var point = doc.TextView.Caret.Position.BufferPosition; + var Length = point.Snapshot.Length; + if (Length == 0) + return; + if (point.AtEnd()) + { + point -= 1; + } + if (char.IsWhiteSpace(point.GetChar())) { + if (point.AtStart()) + return; // Cursor after keyword? - var prevChar = currentChar - 1; + var prevChar = point - 1; if (!char.IsWhiteSpace(prevChar.GetChar())) - currentChar = prevChar; + point = prevChar; } - int currentLine = currentChar.GetContainingLine().LineNumber; + int currentLine = point.GetContainingLine().LineNumber; int tokenLine = currentLine + 1;// our tokens have 1 based line numbers var blocks = xDocument.Blocks.Where(b => b.Token.Line <= tokenLine && b.Last.Token.Line >= tokenLine); - var foundSpans = KeywordMatchingTagger.GetBlockSpans(blocks, currentChar, doc.TextBuffer); + var foundSpans = KeywordMatchingTagger.GetBlockSpans(blocks, point, doc.TextBuffer); if (foundSpans == null || foundSpans.Count == 0) { var entities = xDocument.Entities.Where(e => e.Range.StartLine <= currentLine && e.Range.EndLine >= currentLine); - foundSpans = KeywordMatchingTagger.GetEntitySpans(entities, currentChar, doc.TextBuffer); + foundSpans = KeywordMatchingTagger.GetEntitySpans(entities, point, doc.TextBuffer); } if (foundSpans != null) { @@ -60,17 +83,17 @@ private static void GotoBraceWorker(DocumentView doc, bool ext) // when the cursor is on a middle then we want to go to the next if (foundSpans.Count >= 2) { - SnapshotPoint end = currentChar; - SnapshotPoint start = currentChar; - SnapshotPoint target = currentChar; + SnapshotPoint end = point; + SnapshotPoint start = point; + SnapshotPoint target = point; bool reversed = false; start = target = foundSpans[0].Start; end = foundSpans[foundSpans.Count - 1].End; - if (foundSpans[0].Contains(currentChar)) + if (foundSpans[0].Contains(point)) { target = end; } - else if (foundSpans[foundSpans.Count - 1].Contains(currentChar)) + else if (foundSpans[foundSpans.Count - 1].Contains(point)) { target = start; reversed = true; @@ -79,7 +102,7 @@ private static void GotoBraceWorker(DocumentView doc, bool ext) { for (int i = 0; i < foundSpans.Count - 1; i++) { - if (foundSpans[i].Contains(currentChar)) + if (foundSpans[i].Contains(point)) { if (foundSpans[i].GetText().ToLower() == "end" && i >= foundSpans.Count - 2) { @@ -105,7 +128,7 @@ private static void GotoBraceWorker(DocumentView doc, bool ext) doc.TextBuffer.Properties.TryGetProperty(TaggerType, out property); if (property != null) { - var span = new SnapshotSpan(doc.TextBuffer.CurrentSnapshot, currentChar.Position, 1); + var span = new SnapshotSpan(doc.TextBuffer.CurrentSnapshot, point.Position, 1); NormalizedSnapshotSpanCollection spans = new NormalizedSnapshotSpanCollection(span); var mi = TaggerType.GetMethods().Where(m => m.Name == "GetTags").FirstOrDefault(); if (mi != null) @@ -117,7 +140,7 @@ private static void GotoBraceWorker(DocumentView doc, bool ext) foreach (var tag in tags) { var s = tag.Span; - if (s.Contains(currentChar)) + if (s.Contains(point)) { hasMatched = true; continue; @@ -126,17 +149,17 @@ private static void GotoBraceWorker(DocumentView doc, bool ext) continue; SnapshotPoint start, end, target; bool reversed = false; - if (currentChar.Position < s.Start.Position) + if (point.Position < s.Start.Position) { // cursor on or before opening paren / curly - start = currentChar; ; + start = point; ; end = s.End; target = end; } else { // cursor on or after closing paren / curly - end = currentChar; + end = point; start = s.Start; target = start; reversed = true; diff --git a/src/VisualStudio/LanguageService/Completion/CompletionXmlDoc.cs b/src/VisualStudio/LanguageService/Completion/CompletionXmlDoc.cs index a4be83dd08..fddeed74d3 100644 --- a/src/VisualStudio/LanguageService/Completion/CompletionXmlDoc.cs +++ b/src/VisualStudio/LanguageService/Completion/CompletionXmlDoc.cs @@ -16,6 +16,7 @@ using Microsoft.VisualStudio.Editor; using System.Collections.Generic; using System.Text; +using System.Runtime.Remoting.Messaging; namespace XSharp.LanguageService { internal class XSharpXMLCompletion @@ -27,6 +28,8 @@ internal static void InjectXMLDoc(ITextView textView) { // Retrieve Position SnapshotPoint caret = textView.Caret.Position.BufferPosition; + if (caret.AtEnd()) + return; var line = caret.GetContainingLine(); if ((line.LineNumber >= textView.TextSnapshot.LineCount - 1) || (line.LineNumber == 0)) return; @@ -61,6 +64,8 @@ internal static void InsertXMLDoc(ITextView textView) { // Retrieve Position SnapshotPoint caret = textView.Caret.Position.BufferPosition; + if (caret.AtEnd()) + return; var line = caret.GetContainingLine(); if (line.LineNumber >= textView.TextSnapshot.LineCount - 1) return; diff --git a/src/VisualStudio/LanguageService/Completion/XAMLCompletionSource.cs b/src/VisualStudio/LanguageService/Completion/XAMLCompletionSource.cs index cd771d9c64..41435e9b03 100644 --- a/src/VisualStudio/LanguageService/Completion/XAMLCompletionSource.cs +++ b/src/VisualStudio/LanguageService/Completion/XAMLCompletionSource.cs @@ -13,6 +13,7 @@ using Microsoft.VisualStudio.Shell; using XSharp.LanguageService; using XSharp.Settings; +using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox; namespace XSharpLanguage { [Export(typeof(ICompletionSourceProvider))] @@ -74,6 +75,9 @@ public void AugmentCompletionSession(ICompletionSession session, IList GetTokensInSingleLine(ITextSnapshotLine line, bool allowC } internal XSourceEntity GetCurrentEntity(IWpfTextView textView) { - var currentChar = textView.Caret.Position.BufferPosition; - int currentLine = currentChar.GetContainingLine().LineNumber; + var point = textView.Caret.Position.BufferPosition; + int currentLine = point.GetContainingLine().LineNumber; // LastOrDefault because we want the innermost entity // CLASS // METHOD diff --git a/src/VisualStudio/LanguageService/Extensions.cs b/src/VisualStudio/LanguageService/Extensions.cs index 89ee4806f3..722ff7fd74 100644 --- a/src/VisualStudio/LanguageService/Extensions.cs +++ b/src/VisualStudio/LanguageService/Extensions.cs @@ -340,5 +340,13 @@ internal static XFile GetFile(this ITextView textview) } return null; } + internal static bool AtEnd(this SnapshotPoint point) + { + return point.Position >= point.Snapshot.Length; + } + internal static bool AtStart(this SnapshotPoint point) + { + return point.Position == 0; + } } } diff --git a/src/VisualStudio/LanguageService/Formatting/FormattingCommandHandler.cs b/src/VisualStudio/LanguageService/Formatting/FormattingCommandHandler.cs index 4286382627..3591f3a5b8 100644 --- a/src/VisualStudio/LanguageService/Formatting/FormattingCommandHandler.cs +++ b/src/VisualStudio/LanguageService/Formatting/FormattingCommandHandler.cs @@ -236,6 +236,8 @@ private void registerLineForCaseSync(int line) internal int getCurrentLine() { SnapshotPoint caret = this._textView.Caret.Position.BufferPosition; + if (caret.AtEnd()) + return caret.Snapshot.LineCount - 1; ITextSnapshotLine line = caret.GetContainingLine(); return line.LineNumber; } diff --git a/src/VisualStudio/LanguageService/LightBulb/CommonActionProvider.cs b/src/VisualStudio/LanguageService/LightBulb/CommonActionProvider.cs index 9e1ae789ec..4776d19831 100644 --- a/src/VisualStudio/LanguageService/LightBulb/CommonActionProvider.cs +++ b/src/VisualStudio/LanguageService/LightBulb/CommonActionProvider.cs @@ -64,6 +64,8 @@ protected int SearchRealStartLine() return -1; } SnapshotPoint caret = this.m_textView.Caret.Position.BufferPosition; + if (caret.AtEnd()) + return caret.Snapshot.LineCount-1; ITextSnapshotLine line = caret.GetContainingLine(); // var lineNumber = line.LineNumber; diff --git a/src/VisualStudio/LanguageService/Lookup/XSharpLookup.cs b/src/VisualStudio/LanguageService/Lookup/XSharpLookup.cs index 79bef5fa6d..bfaf0d19e8 100644 --- a/src/VisualStudio/LanguageService/Lookup/XSharpLookup.cs +++ b/src/VisualStudio/LanguageService/Lookup/XSharpLookup.cs @@ -564,7 +564,8 @@ public static IList RetrieveElement(XSharpSearchLocation location, ILi // Could be USING or USING STATIC statement. // We allow the lookup of Namespaces or Types // - if (!state.HasFlag(CompletionState.Namespaces) && !state.HasFlag(CompletionState.Types)) + if (!state.HasFlag(CompletionState.Namespaces) && !state.HasFlag(CompletionState.Types) + && !state.HasFlag(CompletionState.General)) return result; StringBuilder sb = new StringBuilder(); foreach (var token in xtokenList) @@ -572,11 +573,11 @@ public static IList RetrieveElement(XSharpSearchLocation location, ILi sb.Append(token.Text); } var name = sb.ToString(); - if (state.HasFlag(CompletionState.Namespaces)) + if (state.HasFlag(CompletionState.Namespaces) || state.HasFlag(CompletionState.General)) { result.AddRange(SearchNamespaces(location, name)); } - if (state.HasFlag(CompletionState.Types)) + if (state.HasFlag(CompletionState.Types) || state.HasFlag(CompletionState.General)) { result.AddRange(SearchType(location, name)); } diff --git a/src/VisualStudio/LanguageService/MatchingTokens/AbstractMatching.cs b/src/VisualStudio/LanguageService/MatchingTokens/AbstractMatching.cs index 622eb1d11a..a702b57b1f 100644 --- a/src/VisualStudio/LanguageService/MatchingTokens/AbstractMatching.cs +++ b/src/VisualStudio/LanguageService/MatchingTokens/AbstractMatching.cs @@ -3,15 +3,12 @@ // Licensed under the Apache License, Version 2.0. // See License.txt in the project root for license information. // -using LanguageService.CodeAnalysis.XSharp.SyntaxParser; using LanguageService.SyntaxTree; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; -using Microsoft.VisualStudio.Utilities; using System; using System.Collections.Generic; -using System.ComponentModel.Composition; using XSharpModel; using XSharp.Settings; using Microsoft.VisualStudio.Language.StandardClassification; @@ -29,7 +26,7 @@ internal abstract class AbstractMatchingTagger : ITagger protected readonly XDocument _document; protected readonly IBufferTagAggregatorFactoryService _aggregator; protected readonly ITagAggregator _tagAggregator; - protected SnapshotPoint? _currentChar; + protected SnapshotPoint? _point; protected string _prefix; @@ -77,9 +74,9 @@ private void CaretPositionChanged(object sender, CaretPositionChangedEventArgs e private void UpdateAtCaretPosition(CaretPosition caretPosition) { - _currentChar = caretPosition.Point.GetPoint(_buffer, caretPosition.Affinity); + _point = caretPosition.Point.GetPoint(_buffer, caretPosition.Affinity); - if (_currentChar.HasValue) + if (_point.HasValue) { SnapshotSpan snapshot = new SnapshotSpan(_buffer.CurrentSnapshot, 0, _buffer.CurrentSnapshot.Length); TagsChanged?.Invoke(this, new SnapshotSpanEventArgs(snapshot)); @@ -113,13 +110,14 @@ internal static bool IsInActiveSpan(ClassificationSpan span) } return false; } - internal static protected bool matchesPosition(IToken token, SnapshotPoint? currentChar) + internal static protected bool matchesPosition(IToken token, SnapshotPoint? point) { - return token.StartIndex <= currentChar && token.StopIndex >= currentChar; + return token.StartIndex <= point && token.StopIndex >= point; } public abstract IEnumerable> GetTags(NormalizedSnapshotSpanCollection spans); internal abstract TextMarkerTag Tag { get; } } + } diff --git a/src/VisualStudio/LanguageService/MatchingTokens/IdentifierMatching.cs b/src/VisualStudio/LanguageService/MatchingTokens/IdentifierMatching.cs index 0ff29f469e..2d3185aad3 100644 --- a/src/VisualStudio/LanguageService/MatchingTokens/IdentifierMatching.cs +++ b/src/VisualStudio/LanguageService/MatchingTokens/IdentifierMatching.cs @@ -4,7 +4,6 @@ // See License.txt in the project root for license information. // using LanguageService.CodeAnalysis.XSharp.SyntaxParser; -using LanguageService.SyntaxTree; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; @@ -12,10 +11,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.Composition; -using XSharpModel; using XSharp.Settings; -using Microsoft.VisualStudio.Language.StandardClassification; -using Microsoft.VisualStudio.Text.Classification; namespace XSharp.LanguageService { @@ -84,28 +80,24 @@ public override IEnumerable> GetTags(NormalizedSnapshotS oStart = DateTime.Now; - if (spans.Count == 0 || _currentChar == null) //there is no content in the buffer + if (spans.Count == 0 || _point == null) //there is no content in the buffer yield break; - SnapshotPoint currentChar = _currentChar.Value; - if (currentChar.Position == currentChar.Snapshot.Length) - yield break; - - //hold on to a snapshot of the current character - var ch = currentChar.GetChar(); - if (char.IsWhiteSpace(ch)) + SnapshotPoint point = _point.Value; + if (point.AtEnd()) yield break; // Verify that the document and spans have the right version - if (currentChar.Snapshot.Version != _document.SnapShot.Version || spans[0].Snapshot != currentChar.Snapshot) + if (point.Snapshot.Version != _document.SnapShot.Version || spans[0].Snapshot != point.Snapshot) yield break; - // don't do anything if the current SnapshotPoint is not initialized or at the end of the buffer - if (currentChar.Position >= currentChar.Snapshot.Length ) + + var ch = point.GetChar(); + if (char.IsWhiteSpace(ch)) yield break; - int currentLine = _currentChar.Value.GetContainingLine().LineNumber; + int currentLine = point.GetContainingLine().LineNumber; IList> result = new List>(); try { @@ -114,7 +106,7 @@ public override IEnumerable> GetTags(NormalizedSnapshotS var lineTokens = _document.GetTokensInLineAndFollowing(currentLine); foreach (var token in lineTokens) { - if (token.Type == XSharpLexer.ID && matchesPosition(token, _currentChar)) + if (token.Type == XSharpLexer.ID && matchesPosition(token, point)) { // find all matching identifiers // when the classifier is "behind" then we may not find the token yet diff --git a/src/VisualStudio/LanguageService/MatchingTokens/KeywordMatching.cs b/src/VisualStudio/LanguageService/MatchingTokens/KeywordMatching.cs index bad89d5f94..0439c1f80a 100644 --- a/src/VisualStudio/LanguageService/MatchingTokens/KeywordMatching.cs +++ b/src/VisualStudio/LanguageService/MatchingTokens/KeywordMatching.cs @@ -71,21 +71,22 @@ static private IList GetSpansForBlock(XSourceBlock b, ITextBuffer return spans; } - internal static IList GetBlockSpans(IEnumerable blocks, SnapshotPoint? currentChar, ITextBuffer buffer) + internal static IList GetBlockSpans(IEnumerable blocks, SnapshotPoint? point + , ITextBuffer buffer) { foreach (var block in blocks) { - if (matchesPosition(block.Token, currentChar)) + if (matchesPosition(block.Token, point)) { return GetSpansForBlock(block, buffer); } - if (matchesPosition(block.Last.Token, currentChar)) + if (matchesPosition(block.Last.Token, point)) { return GetSpansForBlock(block, buffer); } foreach (var child in block.Children) { - if (matchesPosition(child.Token, currentChar)) + if (matchesPosition(child.Token, point)) { return GetSpansForBlock(block, buffer); } @@ -93,7 +94,7 @@ internal static IList GetBlockSpans(IEnumerable bloc } return null; } - internal static IList GetEntitySpans(IEnumerable entities, SnapshotPoint? currentChar, ITextBuffer buffer) + internal static IList GetEntitySpans(IEnumerable entities, SnapshotPoint? point, ITextBuffer buffer) { // The blockTokens contains the start and end tokens for an entity // like CLASS .. END CLASS @@ -102,7 +103,7 @@ internal static IList GetEntitySpans(IEnumerable en { foreach (var token in entity.BlockTokens) { - if (matchesPosition(token, currentChar)) + if (matchesPosition(token, point)) { var spans = new List(); var snapshot = buffer.CurrentSnapshot; @@ -138,42 +139,43 @@ public override IEnumerable> GetTags(NormalizedSnapshotS oStart = DateTime.Now; //don't do anything if the current SnapshotPoint is not initialized or at the end of the buffer - if (spans.Count == 0 || _currentChar == null || !_currentChar.HasValue) //there is no content in the buffer + if (spans.Count == 0 || _point == null || !_point.HasValue) //there is no content in the buffer yield break; - var snapshot = _currentChar.Value.Snapshot; - if (spans[0].Snapshot != snapshot || _currentChar.Value.Position > snapshot.Length) + SnapshotPoint point = _point.Value; + var snapshot = point.Snapshot; + if (spans[0].Snapshot != snapshot || snapshot.Length == 0 ) { yield break; } - SnapshotPoint currentChar = _currentChar.Value; // Cursor after keyword before EOF? - if (currentChar.Position == snapshot.Length) - currentChar -= 1; + if (point.AtEnd() && !point.AtStart()) + point -= 1; - //hold on to a snapshot of the current character - var ch = currentChar.GetChar(); - if (char.IsWhiteSpace(ch)) - { - currentChar -= 1; + var ch = point.GetChar(); + if (char.IsWhiteSpace(ch) ) + { + // try to get the preceding character + if (point.AtStart()) + yield break; + point -= 1; + ch = point.GetChar(); + if (char.IsWhiteSpace(ch)) + yield break; } - ch = currentChar.GetChar(); - if (char.IsWhiteSpace(ch)) - yield break; - - int currentLine = _currentChar.Value.GetContainingLine().LineNumber; + int currentLine = _point.Value.GetContainingLine().LineNumber; int tokenLine = currentLine + 1;// our tokens have 1 based line numbers IList> result = new List>(); try { // get all the blocks that surround the current position var blocks = _document.Blocks.Where(b => b.Token.Line <= tokenLine && b.Last.Token.Line >= tokenLine); - IList foundSpans = GetBlockSpans(blocks, currentChar, _buffer); + IList foundSpans = GetBlockSpans(blocks, point, _buffer); if (foundSpans == null) { var ents = _document.Entities.Where(e => e.Range.StartLine <= currentLine && e.Range.EndLine >= currentLine); // && e.BlockTokens.Count > 1); - foundSpans = GetEntitySpans(ents,currentChar, _buffer); + foundSpans = GetEntitySpans(ents,point, _buffer); } if (foundSpans != null) diff --git a/src/VisualStudio/LanguageService/Parameter Info/SignatureCommandHandler.cs b/src/VisualStudio/LanguageService/Parameter Info/SignatureCommandHandler.cs index 50d029c99e..7b5d07732c 100644 --- a/src/VisualStudio/LanguageService/Parameter Info/SignatureCommandHandler.cs +++ b/src/VisualStudio/LanguageService/Parameter Info/SignatureCommandHandler.cs @@ -21,8 +21,8 @@ using System.ComponentModel.Composition; using System.Linq; using System.Runtime.InteropServices; -using XSharpModel; using XSharp.Settings; +using XSharpModel; #pragma warning disable CS0649 // Field is never assigned to, for the imported fields namespace XSharp.LanguageService @@ -66,7 +66,7 @@ internal XSharpSignatureHelpCommandHandler(IVsTextView textViewAdapter, ITextVie { this._textView = textView; this._signatureBroker = broker; - _doc = textView.TextBuffer.GetDocument(); + _doc = textView.TextBuffer.GetDocument(); //add this to the filter chain textViewAdapter.AddCommandFilter(this, out m_nextCommandHandler); } @@ -107,11 +107,12 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv if (HasActiveSignatureSession) { SnapshotPoint ssp = _textView.Caret.Position.BufferPosition; - if (ssp.Position > 0) + if (!ssp.AtStart()) { - // get previous char - var previous = _textView.TextBuffer.CurrentSnapshot.GetText().Substring(ssp.Position - 1, 1); - if (previous == "(" || previous == "{") + // get preceding character + ssp -= 1; + var previous = ssp.GetChar(); + if (previous == '(' || previous == '{') { _signatureSession.Dismiss(); } @@ -186,7 +187,7 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv } _doc.SignatureStarting = false; break; - case (int)VSConstants.VSStd2KCmdID.RETURN when ! _doc.SignatureStarting: + case (int)VSConstants.VSStd2KCmdID.RETURN when !_doc.SignatureStarting: if (_doc.CompletionSession == null) { CancelSignatureSession(); @@ -199,7 +200,7 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv case (int)VSConstants.VSStd2KCmdID.BACKSPACE: if (HasActiveSignatureSession) { - MoveSignature(); + MoveSignature(); } break; case (int)VSConstants.VSStd2KCmdID.UP: @@ -230,9 +231,8 @@ bool cursorAfterOpenToken() bool done = false; bool inString = false; char closeChar = '\0'; - int pos = ssp.Position; int curLine = ssp.GetContainingLine().LineNumber; - while (!done && pos > 0) + while (!done && !ssp.AtStart()) { int line = ssp.GetContainingLine().LineNumber; if (line != curLine) @@ -245,8 +245,6 @@ bool cursorAfterOpenToken() } curLine = line; } - if (ssp.Position == 0) - break; ssp = ssp - 1; var ch = ssp.GetChar(); { @@ -265,7 +263,7 @@ bool cursorAfterOpenToken() closeChar = '\0'; } break; - case '(' when ! inString: + case '(' when !inString: case '{' when !inString: level += 1; break; @@ -452,10 +450,13 @@ internal bool StartSignatureSession(IXTypeSymbol type = null, string methodName bool command = triggerchar == '\0'; IXMemberSymbol currentElement = null; SnapshotPoint ssp = this._textView.Caret.Position.BufferPosition; - if (triggerchar == '(' && ssp.Position < ssp.Snapshot.Length && ssp.GetChar() == ')') - ssp -= 1; - if (triggerchar == '{' && ssp.Position < ssp.Snapshot.Length && ssp.GetChar() == '}') - ssp -= 1; + if (!ssp.AtStart()) + { + if (triggerchar == '(' && !ssp.AtEnd() && ssp.GetChar() == ')') + ssp -= 1; + if (triggerchar == '{' && !ssp.AtEnd() && ssp.GetChar() == '}') + ssp -= 1; + } var location = _textView.FindLocation(ssp); if (location == null || location.Member == null) return false; @@ -619,7 +620,7 @@ bool MoveSignature() return false; SnapshotPoint ssp = this._textView.Caret.Position.BufferPosition; var line = ssp.GetContainingLine().LineNumber; - if ( line != props.triggerLine) + if (line != props.triggerLine) { var doc = this._textView.TextBuffer.GetDocument(); LineFlags flags; diff --git a/src/VisualStudio/LanguageService/QuickInfo/XSharpQuickInfo.cs b/src/VisualStudio/LanguageService/QuickInfo/XSharpQuickInfo.cs index 83995d3e43..1c93184712 100644 --- a/src/VisualStudio/LanguageService/QuickInfo/XSharpQuickInfo.cs +++ b/src/VisualStudio/LanguageService/QuickInfo/XSharpQuickInfo.cs @@ -97,7 +97,7 @@ public async Task GetQuickInfoItemAsync(IAsyncQuickInfoSession se if (lookupresult.Count > 0) { var element = lookupresult[0]; - if (element.Name == location.Member.Name) + if (element.Name == location.Member?.Name) { if (location.LineNumber == location.Member.FirstSourceLine(location.Document)) element = location.Member; diff --git a/src/VisualStudio/LanguageService/XSharpShellLink.cs b/src/VisualStudio/LanguageService/XSharpShellLink.cs index 326d92af99..2ca2e0f636 100644 --- a/src/VisualStudio/LanguageService/XSharpShellLink.cs +++ b/src/VisualStudio/LanguageService/XSharpShellLink.cs @@ -14,6 +14,7 @@ using System.Linq; using System.Reflection; using System.Text; +using VSLangProj; using XSharp.Settings; using XSharpModel; using static XSharp.Parser.VsParser; @@ -531,6 +532,34 @@ private void BuildEvents_SolutionBuildStarted(object sender, EventArgs e) } #endregion + + public object FindProject(string sUrl) + { + var sol = VS.Solutions.GetCurrentSolution(); + return findProject(sol, sUrl); + } + private Project findProject(SolutionItem parent, string sUrl) + { + foreach(var child in parent.Children) + { + if (child is null) + continue; + if (child is Project project) + { + if (string.Compare(project.FullPath, sUrl, StringComparison.OrdinalIgnoreCase) == 0) + { + return project; + } + } + foreach (var item in child.Children) + { + var prj = findProject(item, sUrl); + if (prj != null) + return prj; + } + } + return null; + } public void RunInForeGroundThread(Action a) { diff --git a/src/VisualStudio/ProjectBase/ProjectNode.cs b/src/VisualStudio/ProjectBase/ProjectNode.cs index d2c8fe5752..9801240de8 100644 --- a/src/VisualStudio/ProjectBase/ProjectNode.cs +++ b/src/VisualStudio/ProjectBase/ProjectNode.cs @@ -4288,7 +4288,7 @@ protected internal virtual void ProcessFiles() var duplicates = new List(); // Process Files - foreach (MSBuild.ProjectItem item in this.buildProject.ItemsIgnoringCondition) + foreach (MSBuild.ProjectItem item in this.buildProject.Items) { // Ignore the item if it is a reference or folder if (this.FilterItemTypeToBeAddedToHierarchy(item.ItemType)) diff --git a/src/VisualStudio/ProjectPackage/Nodes/XSharpProjectNode.cs b/src/VisualStudio/ProjectPackage/Nodes/XSharpProjectNode.cs index b2267bfde7..8f023843b0 100644 --- a/src/VisualStudio/ProjectPackage/Nodes/XSharpProjectNode.cs +++ b/src/VisualStudio/ProjectPackage/Nodes/XSharpProjectNode.cs @@ -1523,62 +1523,8 @@ public override void AddURL(string url, HierarchyNode node) }); } - private List GetSolutionProjects() - { - List list = new List(); - EnvDTE.DTE dte = null; - ThreadHelper.JoinableTaskFactory.Run(async delegate - { - await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); - var tmp = this.Site.GetService(typeof(EnvDTE.DTE)); - if (tmp != null) - { - dte = (EnvDTE.DTE)tmp; - - foreach (EnvDTE.Project p in dte.Solution.Projects) - { - if (p == null || p.Properties == null) // unloaded ? - { - continue; - } - if (p.Kind.ToUpper() == EnvDTE80.ProjectKinds.vsProjectKindSolutionFolder.ToUpper()) - { - list.AddRange(GetSolutionFolderProjects(p)); - } - else - { - list.Add(p); - } - } - } - }); - return list; - } - - public Object FindProject(string sProject) - { - ThreadHelper.ThrowIfNotOnUIThread(); - - foreach (var p in GetSolutionProjects()) - { - string name = ""; - try - { - name = p.FullName; - } - catch (Exception e) - { - Debug.WriteLine(e.Message); - } - if (name.Equals(sProject, StringComparison.InvariantCultureIgnoreCase)) - { - return p; - } - } - return null; - } - - public override void RemoveURL(String url) + + public override void RemoveURL(string url) { if (!_closing) { diff --git a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/Form/form.prg b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/Form/form.prg index 37d960640d..6719e0d327 100644 --- a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/Form/form.prg +++ b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/Form/form.prg @@ -15,7 +15,7 @@ begin namespace $rootnamespace$ public partial class $safeitemrootname$ inherit System.Windows.Forms.Form public constructor() strict - InitializeComponent() + SELF:InitializeComponent() return end constructor end class diff --git a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/FormSimple/formsimple.prg b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/FormSimple/formsimple.prg index ee0d1cd0e2..1455517265 100644 --- a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/FormSimple/formsimple.prg +++ b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/FormSimple/formsimple.prg @@ -15,7 +15,7 @@ begin namespace $rootnamespace$ public partial class $safeitemrootname$ inherit System.Windows.Forms.Form public constructor() strict - InitializeComponent() + SELF:InitializeComponent() return end constructor /// diff --git a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/UserControl/UserControl.prg b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/UserControl/UserControl.prg index 53b8340a42..def55ac27b 100644 --- a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/UserControl/UserControl.prg +++ b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/Forms/UserControl/UserControl.prg @@ -15,8 +15,8 @@ begin namespace $rootnamespace$ partial class $safeitemrootname$ inherit System.Windows.Forms.UserControl public constructor() strict - InitializeComponent() - return + SELF:InitializeComponent() + return end constructor diff --git a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFPageFunction/PageFunction1.xaml.prg b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFPageFunction/PageFunction1.xaml.prg index 8feaf5f28c..a7e40a0ea6 100644 --- a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFPageFunction/PageFunction1.xaml.prg +++ b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFPageFunction/PageFunction1.xaml.prg @@ -21,7 +21,7 @@ begin namespace $rootnamespace$ public partial class $safeitemrootname$ inherit PageFunction public constructor() STRICT - InitializeComponent() - return + SELF:InitializeComponent() + return end class end namespace diff --git a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFUserControl/UserControl1.xaml.prg b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFUserControl/UserControl1.xaml.prg index 36a3389d1d..713c87b066 100644 --- a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFUserControl/UserControl1.xaml.prg +++ b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFUserControl/UserControl1.xaml.prg @@ -21,8 +21,8 @@ begin namespace $rootnamespace$ public partial class $safeitemname$ INHERIT UserControl public CONSTRUCTOR() STRICT //$safeitemname$() - InitializeComponent() - RETURN + SELF:InitializeComponent() + RETURN end class diff --git a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFWindow/WPFWindow.xaml.prg b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFWindow/WPFWindow.xaml.prg index 89418ac79d..1d3fcf79d5 100644 --- a/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFWindow/WPFWindow.xaml.prg +++ b/src/VisualStudio/ProjectPackage/Templates/ProjectItems/WPF/WPFWindow/WPFWindow.xaml.prg @@ -21,8 +21,8 @@ begin namespace $rootnamespace$ public partial class $safeitemname$ INHERIT Window public CONSTRUCTOR() STRICT //$safeitemname$() - InitializeComponent() - RETURN + SELF:InitializeComponent() + RETURN end class diff --git a/src/VisualStudio/ProjectPackage/Templates/Projects/Windows/CoreWPFApp/MainWindow.xaml.prg b/src/VisualStudio/ProjectPackage/Templates/Projects/Windows/CoreWPFApp/MainWindow.xaml.prg index 4e0965612a..f066193a05 100644 --- a/src/VisualStudio/ProjectPackage/Templates/Projects/Windows/CoreWPFApp/MainWindow.xaml.prg +++ b/src/VisualStudio/ProjectPackage/Templates/Projects/Windows/CoreWPFApp/MainWindow.xaml.prg @@ -21,7 +21,7 @@ BEGIN NAMESPACE $safeprojectname$ PUBLIC PARTIAL CLASS $safeitemname$ INHERIT Window PUBLIC CONSTRUCTOR() STRICT - InitializeComponent() + SELF:InitializeComponent() RETURN END CONSTRUCTOR diff --git a/src/VisualStudio/ProjectPackage/Templates/Projects/Windows/CoreWinFormApp/Form1.prg b/src/VisualStudio/ProjectPackage/Templates/Projects/Windows/CoreWinFormApp/Form1.prg index 931547ca7a..855ebc7236 100644 --- a/src/VisualStudio/ProjectPackage/Templates/Projects/Windows/CoreWinFormApp/Form1.prg +++ b/src/VisualStudio/ProjectPackage/Templates/Projects/Windows/CoreWinFormApp/Form1.prg @@ -15,7 +15,7 @@ BEGIN NAMESPACE $safeprojectname$ PUBLIC PARTIAL CLASS Form1 INHERIT System.Windows.Forms.Form PUBLIC CONSTRUCTOR() STRICT//$safeitemrootname$ - InitializeComponent() + SELF:InitializeComponent() RETURN END CONSTRUCTOR END CLASS diff --git a/src/VisualStudio/ProjectPackage/source.extension.2022.vsixmanifest b/src/VisualStudio/ProjectPackage/source.extension.2022.vsixmanifest index 852c9dba2c..c16e92d7d9 100644 --- a/src/VisualStudio/ProjectPackage/source.extension.2022.vsixmanifest +++ b/src/VisualStudio/ProjectPackage/source.extension.2022.vsixmanifest @@ -1,7 +1,7 @@  - + XSharp VS Integration for 2022 and later X# Visual Studio Integration. Includes a Project System, Language Service , Debugger Support, Custom Editors etc. diff --git a/src/VisualStudio/ProjectPackage/source.extension.vsixmanifest b/src/VisualStudio/ProjectPackage/source.extension.vsixmanifest index 6e00aa4fe8..c16e92d7d9 100644 --- a/src/VisualStudio/ProjectPackage/source.extension.vsixmanifest +++ b/src/VisualStudio/ProjectPackage/source.extension.vsixmanifest @@ -1,8 +1,8 @@  - - XSharp Visual Studio Integration + + XSharp VS Integration for 2022 and later X# Visual Studio Integration. Includes a Project System, Language Service , Debugger Support, Custom Editors etc. http://www.xsharp.eu @@ -13,33 +13,40 @@ Includes a Project System, Language Service , Debugger Support, Custom Editors e XSharp, XBase, FoxPro, Visual Objects, Xbase++, Harbour - + + amd64 + + + arm64 + - - + + - - - - + + + + - - - - + + + + + + ProjectTemplates ItemTemplates - - - + + + diff --git a/src/VisualStudio/XSharpCodeModelXs/CodeModel.xsproj b/src/VisualStudio/XSharpCodeModelXs/CodeModel.xsproj index 033dd19cc5..8cdf43a35f 100644 --- a/src/VisualStudio/XSharpCodeModelXs/CodeModel.xsproj +++ b/src/VisualStudio/XSharpCodeModelXs/CodeModel.xsproj @@ -22,8 +22,9 @@ false - False + True True + True diff --git a/src/VisualStudio/XSharpCodeModelXs/Interfaces.prg b/src/VisualStudio/XSharpCodeModelXs/Interfaces.prg index b8e871f796..0e2214b022 100644 --- a/src/VisualStudio/XSharpCodeModelXs/Interfaces.prg +++ b/src/VisualStudio/XSharpCodeModelXs/Interfaces.prg @@ -20,7 +20,6 @@ INTERFACE IXSharpProject /// /// /// EnvDte project - METHOD FindProject(sUrl AS STRING) AS Object METHOD HasFileNode(fileName AS STRING) AS LOGIC // Properties PROPERTY DisplayName AS STRING GET @@ -66,6 +65,7 @@ INTERFACE IXVsShellLink METHOD ClearIntellisenseErrors(file AS STRING) AS VOID METHOD SynchronizeKeywordCase(code AS STRING, fileName as string) AS STRING METHOD RunInForeGroundThread( a as Action) AS VOID + METHOD FindProject(sUrl AS STRING) AS Object END INTERFACE diff --git a/src/VisualStudio/XSharpCodeModelXs/Parser/XsParser.prg b/src/VisualStudio/XSharpCodeModelXs/Parser/XsParser.prg index 3f5ac9be33..386f650f7b 100644 --- a/src/VisualStudio/XSharpCodeModelXs/Parser/XsParser.prg +++ b/src/VisualStudio/XSharpCodeModelXs/Parser/XsParser.prg @@ -635,7 +635,7 @@ CLASS XsParser IMPLEMENTS VsParser.IErrorListener token:Type := XSharpLexer.PP_ENDTEXT return otherwise - var xt := GetNextKeyword() + var xt := SELF:GetNextKeyword() if XFormattingRule.IsStartKeyword(xt) RETURN ENDIF diff --git a/src/VisualStudio/XSharpCodeModelXs/ProjectSystem/XProject.prg b/src/VisualStudio/XSharpCodeModelXs/ProjectSystem/XProject.prg index 7c3d8597a6..1e181c356a 100644 --- a/src/VisualStudio/XSharpCodeModelXs/ProjectSystem/XProject.prg +++ b/src/VisualStudio/XSharpCodeModelXs/ProjectSystem/XProject.prg @@ -19,8 +19,8 @@ USING XSharp.Settings #pragma options ("az", ON) BEGIN NAMESPACE XSharpModel -[DebuggerDisplay("{NameId,nq}")]; -CLASS XProject + [DebuggerDisplay("{NameId,nq}")]; + CLASS XProject #region Fields // Fields PROTECTED _id := -1 AS INT64 @@ -45,6 +45,7 @@ CLASS XProject PRIVATE _dependentAssemblyList AS STRING PRIVATE _name AS STRING PRIVATE _lastRefCheck AS DateTime + PRIVATE _resolvingReferences AS LOGIC PRIVATE _cachedAllNamespaces AS IList PRIVATE _cachedUsingStatics AS IList @@ -61,117 +62,117 @@ CLASS XProject PROPERTY DisplayName AS STRING GET _projectNode?.DisplayName PROPERTY DependentAssemblyList AS STRING - GET - IF String.IsNullOrEmpty(_dependentAssemblyList) - SELF:_AssemblyDict := XDictionary{} - SELF:_AssemblyTypeCache := XDictionary{} - VAR result := "" - var core := SystemTypeController.mscorlib - if core != null - result := core:Id:ToString() - ENDIF - FOREACH VAR assembly IN SELF:AssemblyReferences:ToArray() - _AssemblyDict:Add(assembly:Id, assembly) - IF result:Length > 0 - result += "," + GET + IF String.IsNullOrEmpty(_dependentAssemblyList) + SELF:_AssemblyDict := XDictionary{} + SELF:_AssemblyTypeCache := XDictionary{} + VAR result := "" + var core := SystemTypeController.mscorlib + if core != null + result := core:Id:ToString() ENDIF - result += assembly:Id:ToString() - NEXT - if core != NULL - IF ! _AssemblyDict.ContainsKey(core:Id) - _AssemblyDict:Add(core:Id, core) - _AssemblyReferences:Add(core) + FOREACH VAR assembly IN SELF:AssemblyReferences:ToArray() + _AssemblyDict:Add(assembly:Id, assembly) + IF result:Length > 0 + result += "," + ENDIF + result += assembly:Id:ToString() + NEXT + if core != NULL + IF ! _AssemblyDict.ContainsKey(core:Id) + _AssemblyDict:Add(core:Id, core) + _AssemblyReferences:Add(core) + endif endif - endif - _dependentAssemblyList := result - ENDIF - RETURN _dependentAssemblyList + _dependentAssemblyList := result + ENDIF + RETURN _dependentAssemblyList - END GET + END GET END PROPERTY PROPERTY DependentProjectList AS STRING - GET - IF String.IsNullOrEmpty(_dependentProjectList) .OR. ; - (_dependentProjectList == SELF:Id:ToString() .AND. _ReferencedProjects:Count > 0) - VAR result := "" - result := SELF:Id:ToString() - FOREACH VAR dependent IN _ReferencedProjects:ToArray() - result += "," - result += dependent:Id:ToString() - NEXT - _dependentProjectList := result - ENDIF - RETURN _dependentProjectList + GET + IF String.IsNullOrEmpty(_dependentProjectList) .OR. ; + (_dependentProjectList == SELF:Id:ToString() .AND. _ReferencedProjects:Count > 0) + VAR result := "" + result := SELF:Id:ToString() + FOREACH VAR dependent IN _ReferencedProjects:ToArray() + result += "," + result += dependent:Id:ToString() + NEXT + _dependentProjectList := result + ENDIF + RETURN _dependentProjectList - END GET + END GET END PROPERTY PROPERTY Dialect AS XDialect - GET - TRY - IF _parseOptions != NULL - RETURN _parseOptions:Dialect - ENDIF - CATCH e AS Exception - XSettings.Exception(e,__FUNCTION__) - END TRY - RETURN XDialect.Core + GET + TRY + IF _parseOptions != NULL + RETURN _parseOptions:Dialect + ENDIF + CATCH e AS Exception + XSettings.Exception(e,__FUNCTION__) + END TRY + RETURN XDialect.Core - END GET + END GET END PROPERTY PROPERTY FunctionClasses AS List - GET - IF _FunctionClasses == NULL - VAR result := List{} - result.Add(XLiterals.GlobalName) - FOREACH VAR asm IN SELF:AssemblyReferences:ToArray() - VAR gcn := asm:GlobalClassName - IF !String.IsNullOrEmpty(gcn) .AND. result:IndexOf(gcn) == -1 - result:Add(gcn) - ENDIF - NEXT - _FunctionClasses := result - ENDIF - RETURN _FunctionClasses - END GET - END PROPERTY - - PROPERTY ImplicitNamespaces AS List - GET - IF _ImplicitNamespaces == NULL - VAR result := List{} - IF SELF:ParseOptions:ImplicitNamespace - FOREACH project AS XProject IN SELF:ReferencedProjects:ToArray() - VAR ns := project:ProjectNode?:ParseOptions?:DefaultNamespace - IF ! String.IsNullOrEmpty(ns) .AND. result:IndexOf(ns) == -1 - result:Add(ns) - ENDIF - NEXT + GET + IF _FunctionClasses == NULL + VAR result := List{} + result.Add(XLiterals.GlobalName) FOREACH VAR asm IN SELF:AssemblyReferences:ToArray() - IF asm:IsXSharp - FOREACH VAR ns IN asm:ImplicitNamespaces - IF result:IndexOf(ns) == -1 - result:Add(ns) - ENDIF - NEXT + VAR gcn := asm:GlobalClassName + IF !String.IsNullOrEmpty(gcn) .AND. result:IndexOf(gcn) == -1 + result:Add(gcn) ENDIF NEXT + _FunctionClasses := result ENDIF - _ImplicitNamespaces := result - ENDIF - RETURN _ImplicitNamespaces - END GET + RETURN _FunctionClasses + END GET + END PROPERTY + + PROPERTY ImplicitNamespaces AS List + GET + IF _ImplicitNamespaces == NULL + VAR result := List{} + IF SELF:ParseOptions:ImplicitNamespace + FOREACH project AS XProject IN SELF:ReferencedProjects:ToArray() + VAR ns := project:ProjectNode?:ParseOptions?:DefaultNamespace + IF ! String.IsNullOrEmpty(ns) .AND. result:IndexOf(ns) == -1 + result:Add(ns) + ENDIF + NEXT + FOREACH VAR asm IN SELF:AssemblyReferences:ToArray() + IF asm:IsXSharp + FOREACH VAR ns IN asm:ImplicitNamespaces + IF result:IndexOf(ns) == -1 + result:Add(ns) + ENDIF + NEXT + ENDIF + NEXT + ENDIF + _ImplicitNamespaces := result + ENDIF + RETURN _ImplicitNamespaces + END GET END PROPERTY PROPERTY IncludeFiles as List - GET - return XDatabase.GetProjectIncludeFiles(SELF) - END GET + GET + return XDatabase.GetProjectIncludeFiles(SELF) + END GET END PROPERTY PROPERTY RootNamespace as STRING GET _projectNode:RootNameSpace - #endregion +#endregion CONSTRUCTOR(project AS IXSharpProject) SELF(project,"") @@ -325,52 +326,68 @@ CLASS XProject RETURN PROPERTY RefCheckTimeOut as LOGIC - GET - var now := DateTime.Now - LOCAL diff := now - SELF:_lastRefCheck as TimeSpan - IF diff:TotalSeconds < 15 - RETURN FALSE - ENDIF - SELF:_lastRefCheck := now - RETURN TRUE - END GET + GET + var now := DateTime.Now + LOCAL diff := now - SELF:_lastRefCheck as TimeSpan + IF diff:TotalSeconds < 15 + RETURN FALSE + ENDIF + SELF:_lastRefCheck := now + RETURN TRUE + END GET END PROPERTY METHOD ResolveReferences() AS VOID - IF SELF:hasUnprocessedReferences - IF ! SELF:RefCheckTimeOut - RETURN - ENDIF - SELF:LogReferenceMessage("<<-- ResolveReferences()") - XSolution.SetStatusBarText(String.Format("Loading referenced types for project {0}", SELF:Name)) - - TRY - SELF:ResolveUnprocessedAssemblyReferences() - SELF:ResolveUnprocessedProjectReferences() - SELF:ResolveUnprocessedStrangerReferences() - FOREACH DLL AS STRING IN SELF:_projectOutputDLLs:Values:ToArray() - VAR fullName := SystemTypeController.FindAssemblyByLocation(DLL) - LOCAL asm := NULL as XAssembly - if ! String.IsNullOrEmpty(fullName) - asm := SystemTypeController.FindAssembly(fullName) - ENDIF - local lAdd := TRUE as LOGIC - IF asm != NULL .and. SELF:AssemblyReferences:Contains(asm) - lAdd := FALSE - ENDIF - IF lAdd - SELF:AddAssemblyReference(DLL) - ENDIF - NEXT - // repeat the assemblyreferences because we can have _projectOutputDLLs added to the list - SELF:ResolveUnprocessedAssemblyReferences() - CATCH - NOP - END TRY - SELF:LogReferenceMessage(">>-- ResolveReferences()") + IF _resolvingReferences + RETURN ENDIF + TRY + _resolvingReferences := TRUE + IF SELF:RefCheckTimeOut + IF SELF:hasUnprocessedReferences + SELF:LogReferenceMessage("<<-- ResolveReferences()") + XSolution.SetStatusBarText(String.Format("Loading referenced types for project {0}", SELF:Name)) + + TRY + SELF:ResolveUnprocessedAssemblyReferences() + SELF:ResolveUnprocessedProjectReferences() + SELF:ResolveUnprocessedStrangerReferences() + FOREACH DLL AS STRING IN SELF:_projectOutputDLLs:Values:ToArray() + VAR fullName := SystemTypeController.FindAssemblyByLocation(DLL) + LOCAL asm := NULL as XAssembly + if ! String.IsNullOrEmpty(fullName) + asm := SystemTypeController.FindAssembly(fullName) + ENDIF + local lAdd := TRUE as LOGIC + IF asm != NULL .and. SELF:AssemblyReferences:Contains(asm) + lAdd := FALSE + ENDIF + IF lAdd + SELF:AddAssemblyReference(DLL) + ENDIF + NEXT + // repeat the assemblyreferences because we can have _projectOutputDLLs added to the list + SELF:ResolveUnprocessedAssemblyReferences() + CATCH + NOP + END TRY + SELF:LogReferenceMessage(">>-- ResolveReferences()") + ENDIF + SELF:RefreshAssemblyReferences() + ENDIF + FINALLY + _resolvingReferences := FALSE + END TRY RETURN + METHOD RefreshAssemblyReferences as VOID + FOREACH asm as XAssembly in SELF:AssemblyReferences:ToArray() + if asm:IsModifiedOnDisk + asm:Read() + SELF:_AssemblyTypeCache?:Clear() + endif + NEXT + METHOD UpdateAssemblyReference(fileName AS STRING) AS VOID IF ! XSettings.DisableAssemblyReferences .AND. ! String.IsNullOrEmpty(fileName) SystemTypeController.LoadAssembly(fileName):AddProject(SELF) @@ -386,17 +403,27 @@ CLASS XProject ENDIF NEXT RETURN NULL - METHOD AddProjectReference(url AS STRING) AS LOGIC - IF ! String.IsNullOrEmpty(url) - VAR prj := SELF:FindProjectReference(url) + + STATIC METHOD IsXSharpProject(fileName as string) AS LOGIC + if (String.IsNullOrEmpty(fileName)) + return false + endif + return String.Equals(System.IO.Path.GetExtension(fileName), ".xsproj", StringComparison.OrdinalIgnoreCase) + + METHOD AddProjectReference(Url AS STRING) AS LOGIC + IF !IsXSharpProject(Url) + RETURN SELF:AddStrangerProjectReference(Url) + ENDIF + IF ! String.IsNullOrEmpty(Url) + VAR prj := SELF:FindProjectReference(Url) IF (prj != NULL) // Project has already been added and has been resolved RETURN FALSE ENDIF SELF:_clearTypeCache() - IF ! SELF:_unprocessedProjectReferences:Contains(url) - SELF:LogReferenceMessage("Add XSharp ProjectReference "+url) - SELF:_unprocessedProjectReferences:Add(url) + IF ! SELF:_unprocessedProjectReferences:Contains(Url) + SELF:LogReferenceMessage("Add XSharp ProjectReference "+Url) + SELF:_unprocessedProjectReferences:Add(Url) RETURN TRUE ENDIF ENDIF @@ -502,32 +529,10 @@ CLASS XProject PRIVATE METHOD GetStrangerOutputDLL(sProject AS STRING, p AS Dynamic) AS STRING VAR outputFile := "" TRY - VAR properties := p:Properties - VAR propType := properties:Item("OutputType") - VAR propName := properties:Item("AssemblyName") - var confMan := p:ConfigurationManager - var activeConf := confMan:ActiveConfiguration - var props := activeConf:Properties - VAR propPath := props:Item( "OutputPath") - IF propName != NULL .AND. propPath != NULL .AND. propType != NULL - - VAR path := (STRING) propPath:Value - VAR type := (INT) propType:Value - outputFile := (STRING) propName:Value - IF type == 2 // __VSPROJOUTPUTTYPE.VSPROJ_OUTPUTTYPE_LIBRARY, in Microsoft.VisualStudio.Shell.Interop.11.0.dll - outputFile += ".dll" - ELSE - outputFile += ".exe" - ENDIF - outputFile := System.IO.Path.Combine(path, outputFile) - IF ! System.IO.Path.IsPathRooted(outputFile) - outputFile := System.IO.Path.Combine(System.IO.Path.GetDirectoryName(sProject), outputFile) - // remove ../ and other garbage from the path - outputFile := System.IO.Path.GetFullPath(outputFile) - ENDIF - ENDIF - CATCH exception AS Exception - XSettings.Exception(exception,__FUNCTION__) + // p is the Community Toolkit Project object here + outputFile := p:GetAttributeAsync("TargetPath").Result + CATCH Exception AS Exception + XSettings.Exception(Exception,__FUNCTION__) END TRY RETURN outputFile @@ -548,7 +553,7 @@ CLASS XProject ENDIF SELF:RemoveProjectOutput(url) - var prj := SELF:ProjectNode:FindProject(url) + var prj := XSettings.ShellLink.FindProject(url) IF prj != NULL .AND. SELF:_StrangerProjects:Contains(prj) SELF:_StrangerProjects:Remove(prj) RETURN TRUE @@ -558,7 +563,7 @@ CLASS XProject METHOD RefreshStrangerProjectDLLOutputFiles_Worker AS VOID FOREACH proj as Dynamic IN SELF:_StrangerProjects:ToArray() - LOCAL sProjectURL := proj:FullName AS STRING + LOCAL sProjectURL := proj:FullPath AS STRING VAR mustAdd := FALSE LOCAL outputFile := SELF:GetStrangerOutputDLL(sProjectURL, proj) AS STRING IF SELF:_projectOutputDLLs:ContainsKey(sProjectURL) @@ -593,7 +598,7 @@ CLASS XProject SELF:LogReferenceMessage("ResolveUnprocessedStrangerReferences()" +_unprocessedStrangerProjectReferences:Count:ToString()) existing := List{} FOREACH sProject AS STRING IN SELF:_unprocessedStrangerProjectReferences:ToArray() - VAR p := SELF:ProjectNode:FindProject(sProject) + VAR p := XSettings.ShellLink.FindProject(sProject) IF (p != NULL) SELF:_StrangerProjects:Add(p) outputFile := SELF:GetStrangerOutputDLL(sProject, p) @@ -613,6 +618,7 @@ CLASS XProject SELF:_unprocessedStrangerProjectReferences:Remove(sProject) ENDIF NEXT + SELF:ResolveUnprocessedAssemblyReferences() PRIVATE METHOD ResolveUnprocessedStrangerReferences() AS VOID IF SELF:_unprocessedStrangerProjectReferences:Count > 0 .AND. ! XSettings.DisableForeignProjectReferences XSettings.RunInForeGroundThread ( { => SELF:ResolveUnprocessedStrangerReferences_Worker() }) @@ -693,7 +699,7 @@ CLASS XProject SELF:LogTypeMessage(i"FindGlobalsInAssemblyReferences {name}, found {result.Count} occurences") RETURN result - METHOD FindFunctionsInAssemblyReferences(name AS STRING, lLike := FALSE as LOGIC) AS IList + METHOD FindFunctionsInAssemblyReferences(name AS STRING, lLike := FALSE as LOGIC) AS IList SELF:LogTypeMessage(i"FindFunctionsInAssemblyReferences {name} {lLike} ") var dbresult := XDatabase.FindAssemblyFunction(name, SELF:DependentAssemblyList, lLike) var result := SELF:_MembersFromGlobalType(dbresult) @@ -919,16 +925,17 @@ CLASS XProject type := peTypes:FirstOrDefault() IF type != NULL SELF:LogTypeMessage("FindSystemType() "+name+" found "+type:FullName) + ELSE SELF:LogTypeMessage("FindSystemType() "+name+" not found ") ENDIF RETURN type PROPERTY AssemblyNamespaces AS IList - GET - SELF:ResolveReferences() - RETURN XDatabase.GetAssemblyNamespaces(SELF:DependentAssemblyList) - END GET + GET + SELF:ResolveReferences() + RETURN XDatabase.GetAssemblyNamespaces(SELF:DependentAssemblyList) + END GET END PROPERTY @@ -1399,32 +1406,32 @@ CLASS XProject #region Properties PROPERTY AssemblyReferences AS List - GET - SELF:ResolveReferences() - RETURN SELF:_AssemblyReferences - END GET + GET + SELF:ResolveReferences() + RETURN SELF:_AssemblyReferences + END GET END PROPERTY PROPERTY AssemblyReferenceNames AS IList - GET - var result := List{} - result:AddRange(SELF:_unprocessedAssemblyReferences) - FOREACH var reference in SELF:_AssemblyReferences - result:Add(reference:FileName) - NEXT - return result:ToArray() - END GET + GET + var result := List{} + result:AddRange(SELF:_unprocessedAssemblyReferences) + FOREACH var reference in SELF:_AssemblyReferences + result:Add(reference:FileName) + NEXT + return result:ToArray() + END GET END PROPERTY PRIVATE PROPERTY hasUnprocessedReferences AS LOGIC - GET - IF SELF:Loaded - RETURN SELF:_unprocessedAssemblyReferences:Count + ; - SELF:_unprocessedProjectReferences:Count + ; - SELF:_unprocessedStrangerProjectReferences:Count > 0 - ENDIF - RETURN FALSE - END GET + GET + IF SELF:Loaded + RETURN SELF:_unprocessedAssemblyReferences:Count + ; + SELF:_unprocessedProjectReferences:Count + ; + SELF:_unprocessedStrangerProjectReferences:Count > 0 + ENDIF + RETURN FALSE + END GET END PROPERTY PROPERTY Loaded AS LOGIC AUTO @@ -1437,12 +1444,12 @@ CLASS XProject RETURN PROPERTY Name AS STRING - GET - RETURN _name - END GET - INTERNAL SET - _name := value - END SET + GET + RETURN _name + END GET + INTERNAL SET + _name := value + END SET END PROPERTY PROPERTY NameId as STRING GET @@ -1459,59 +1466,59 @@ CLASS XProject PRIVATE _prjNameSpaces AS IList PRIVATE _lastNameSpaces := DateTime.MinValue AS DateTime PROPERTY ProjectNamespaces AS IList - GET - if _prjNameSpaces != NULL .and. DateTime.Now:Subtract(_lastNameSpaces) < TimeSpan{0,0,10} + GET + if _prjNameSpaces != NULL .and. DateTime.Now:Subtract(_lastNameSpaces) < TimeSpan{0,0,10} + return _prjNameSpaces + ENDIF + _prjNameSpaces := XDatabase.GetProjectNamespaces(SELF:DependentProjectList) + _lastNameSpaces := DateTime.Now return _prjNameSpaces - ENDIF - _prjNameSpaces := XDatabase.GetProjectNamespaces(SELF:DependentProjectList) - _lastNameSpaces := DateTime.Now - return _prjNameSpaces - END GET + END GET END PROPERTY PROPERTY AllNamespaces AS IList - GET - IF _cachedAllNamespaces != NULL - RETURN _cachedAllNamespaces - ENDIF - VAR result := SELF:ProjectNamespaces - VAR asmNS := SELF:AssemblyNamespaces - IF result:Count > asmNS:Count - FOREACH ns AS STRING IN asmNS - IF !result:Contains(ns) - result:Add(ns) - ENDIF - NEXT - ELSE - FOREACH ns AS STRING IN result - IF !asmNS:Contains(ns) - asmNS:Add(ns) - ENDIF - NEXT - result := asmNS - ENDIF - _cachedAllNamespaces := result - RETURN result - END GET + GET + IF _cachedAllNamespaces != NULL + RETURN _cachedAllNamespaces + ENDIF + VAR result := SELF:ProjectNamespaces + VAR asmNS := SELF:AssemblyNamespaces + IF result:Count > asmNS:Count + FOREACH ns AS STRING IN asmNS + IF !result:Contains(ns) + result:Add(ns) + ENDIF + NEXT + ELSE + FOREACH ns AS STRING IN result + IF !asmNS:Contains(ns) + asmNS:Add(ns) + ENDIF + NEXT + result := asmNS + ENDIF + _cachedAllNamespaces := result + RETURN result + END GET END PROPERTY PROPERTY AllUsingStatics as IList - GET - IF _cachedUsingStatics != NULL + GET + IF _cachedUsingStatics != NULL + RETURN _cachedUsingStatics + ENDIF + VAR statics := List{} + IF SELF:ProjectNode != NULL .AND. SELF:ProjectNode:ParseOptions:HasRuntime + FOREACH asm AS XAssembly IN SELF:AssemblyReferences + VAR globalclass := asm:GlobalClassName + IF (! String.IsNullOrEmpty(globalclass)) + statics:AddUnique(globalclass) + ENDIF + NEXT + ENDIF + _cachedUsingStatics := statics:ToArray() RETURN _cachedUsingStatics - ENDIF - VAR statics := List{} - IF SELF:ProjectNode != NULL .AND. SELF:ProjectNode:ParseOptions:HasRuntime - FOREACH asm AS XAssembly IN SELF:AssemblyReferences - VAR globalclass := asm:GlobalClassName - IF (! String.IsNullOrEmpty(globalclass)) - statics:AddUnique(globalclass) - ENDIF - NEXT - ENDIF - _cachedUsingStatics := statics:ToArray() - RETURN _cachedUsingStatics - END GET + END GET END PROPERTY @@ -1522,37 +1529,37 @@ CLASS XProject RETURN PROPERTY ParseOptions AS XParseOptions - GET - IF SELF:_parseOptions == NULL - IF SELF:ProjectNode == NULL - SELF:_parseOptions := XParseOptions.Default - ELSE - SELF:_parseOptions := SELF:ProjectNode:ParseOptions + GET + IF SELF:_parseOptions == NULL + IF SELF:ProjectNode == NULL + SELF:_parseOptions := XParseOptions.Default + ELSE + SELF:_parseOptions := SELF:ProjectNode:ParseOptions + ENDIF ENDIF - ENDIF - RETURN SELF:_parseOptions - END GET + RETURN SELF:_parseOptions + END GET END PROPERTY PROPERTY ProjectNode AS IXSharpProject GET SELF:_projectNode PROPERTY ReferencedProjects AS IList - GET - SELF:ResolveUnprocessedProjectReferences() - RETURN SELF:_ReferencedProjects.ToArray() - END GET + GET + SELF:ResolveUnprocessedProjectReferences() + RETURN SELF:_ReferencedProjects.ToArray() + END GET END PROPERTY PROPERTY SourceFiles AS List - GET - RETURN SELF:_SourceFilesDict:Keys:ToList() - END GET + GET + RETURN SELF:_SourceFilesDict:Keys:ToList() + END GET END PROPERTY PROPERTY StrangerProjects AS Object[] - GET - SELF:ResolveUnprocessedStrangerReferences() - RETURN SELF:_StrangerProjects:ToArray() - END GET + GET + SELF:ResolveUnprocessedStrangerReferences() + RETURN SELF:_StrangerProjects:ToArray() + END GET END PROPERTY #endregion diff --git a/src/VisualStudio/XSharpVoEditors/Designers/Base.prg b/src/VisualStudio/XSharpVoEditors/Designers/Base.prg index 44df5e0207..a32e91ea9a 100644 --- a/src/VisualStudio/XSharpVoEditors/Designers/Base.prg +++ b/src/VisualStudio/XSharpVoEditors/Designers/Base.prg @@ -221,11 +221,11 @@ CLASS DesignerBase RETURN ENDIF IF lShow - oGridForm:Show() + oGridForm:Show() oToolForm:Show() SELF:GiveFocus() ELSE - IF !SELF:oSurface:ContainsFocus + IF !SELF:oSurface:CanFocus oGridForm:Hide() oToolForm:Hide() END IF diff --git a/src/VisualStudio/XSharpVoEditors/Designers/ControlOrder.prg b/src/VisualStudio/XSharpVoEditors/Designers/ControlOrder.prg index c166ceb07c..e03aaa219c 100644 --- a/src/VisualStudio/XSharpVoEditors/Designers/ControlOrder.prg +++ b/src/VisualStudio/XSharpVoEditors/Designers/ControlOrder.prg @@ -28,6 +28,8 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form PROTECT oTimer AS Timer PROTECT nMouseIndex AS INT + + CONSTRUCTOR(_oEditor AS VOWindowEditor , aDesign AS ArrayList) SUPER() @@ -135,6 +137,7 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form SELF:oCancelButton:Size := System.Drawing.Size{ 75 , 23 } SELF:oCancelButton:Text := "&Cancel" SELF:oCancelButton:TabIndex := 5 + SELF:oCancelButton:Click += System.EventHandler{ SELF , @CancelButtonClick() } SELF:oCancelButton:Anchor := System.Windows.Forms.AnchorStyles.Bottom + System.Windows.Forms.AnchorStyles.Right SELF:Controls:Add(SELF:oCancelButton) @@ -234,10 +237,18 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form RETURN PROTECTED METHOD UseMouseButtonClick(o AS OBJECT , e AS EventArgs) AS VOID - SELF:oEditor:SelectMainItem() - SELF:lUsingMouse := TRUE - SELF:nMouseIndex := 0 - SELF:oTimer:Start() + + if SELF:nMouseIndex>0 + SELF:lUsingMouse := TRUE + SELF:oTimer:Start() + else + SELF:oEditor:SelectMainItem() + SELF:lUsingMouse := TRUE + SELF:nMouseIndex := 0 + SELF:oTimer:Start() + endif + + RETURN METHOD TimerTicked(o AS OBJECT , e AS EventArgs) AS VOID IF SELF:lUsingMouse @@ -349,7 +360,17 @@ CLASS VOControlCreationOrderDlg INHERIT System.Windows.Forms.Form SELF:aNewOrder:Add(oItem:Tag ASTYPE DesignWindowItem) NEXT SELF:DialogResult := DialogResult.OK + + Self:Close() RETURN + + PROTECTED METHOD CancelButtonClick(o AS OBJECT , e AS System.EventArgs) AS VOID + SELF:DialogResult := DialogResult.Cancel + Self:Close() + RETURN + + + END CLASS diff --git a/src/VisualStudio/XSharpVoEditors/Designers/PropGrid.prg b/src/VisualStudio/XSharpVoEditors/Designers/PropGrid.prg index ff8527d341..56174b3910 100644 --- a/src/VisualStudio/XSharpVoEditors/Designers/PropGrid.prg +++ b/src/VisualStudio/XSharpVoEditors/Designers/PropGrid.prg @@ -171,7 +171,8 @@ CLASS DesignerGrid INHERIT Panel RETURN END IF - oDesign := (DesignItem)SELF:aSelected[0] + //CS: Show the props from the last selected and not from the first item + oDesign := (DesignItem)SELF:aSelected[_aSelected:Count-1] SELF:SetPages(oDesign:aPages) diff --git a/src/VisualStudio/XSharpVoEditors/Designers/VOWindowEditor.prg b/src/VisualStudio/XSharpVoEditors/Designers/VOWindowEditor.prg index c8cd74690f..bf0aa620b8 100644 --- a/src/VisualStudio/XSharpVoEditors/Designers/VOWindowEditor.prg +++ b/src/VisualStudio/XSharpVoEditors/Designers/VOWindowEditor.prg @@ -19,15 +19,16 @@ ENUM ViewMode END ENUM INTERNAL CLASS MultiPropertyDescriptor - CONSTRUCTOR(cName AS STRING, nLineInCode AS INT) - SELF:Name := cName - SELF:LineInCode := nLineInCode - SELF:SubProperties := ArrayList{} - RETURN - - PROPERTY Name AS STRING AUTO GET PRIVATE SET - PROPERTY LineInCode AS INT AUTO GET PRIVATE SET - PROPERTY SubProperties AS ArrayList AUTO GET PRIVATE SET + CONSTRUCTOR(cName AS STRING, nLineInCode AS INT) + SELF:Name := cName + SELF:LineInCode := nLineInCode + SELF:SubProperties := ArrayList{} + RETURN + + + PROPERTY Name AS STRING AUTO GET PRIVATE SET + PROPERTY LineInCode AS INT AUTO GET PRIVATE SET + PROPERTY SubProperties AS ArrayList AUTO GET PRIVATE SET END CLASS PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase @@ -48,6 +49,7 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase PROTECT cDefaultFileName AS STRING // PROTECT oStatusBar AS StatusBar PROTECT lAlreadySavedBefore AS LOGIC + PROTECT oDlg AS VOControlCreationOrderDlg STATIC PROTECT oClipboard := DesignerClipboard{} AS DesignerClipboard STATIC ACCESS Clipboard AS DesignerClipboard @@ -129,6 +131,7 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase SELF:oDummy:LostFocus += EventHandler{SELF , @DummyLostFocus() } SELF:oSurface:Controls:Add(SELF:oDummy) RETURN + METHOD DummyGotFocus(o AS OBJECT , e AS EventArgs) AS VOID SELF:ShowHideTools(TRUE) IF SELF:oGrid:FindForm() != NULL @@ -140,8 +143,9 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase SELF:oGrid:UseHierarchy(TRUE) SELF:oToolBox:SetViewMode(SELF:ViewMode) RETURN + METHOD DummyLostFocus(o AS OBJECT , e AS EventArgs) AS VOID - SELF:ShowHideTools(FALSE) + SELF:ShowHideTools(FALSE) RETURN VIRTUAL METHOD GiveFocus() AS VOID @@ -253,13 +257,14 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase // PRIVATE METHOD TimerTicked(o AS OBJECT,e AS EventArgs) AS VOID // TODO: should be allowed? /* IF SELF:eCurrent == WEDAction.None SELF:oSurface:Invalidate(TRUE) - ENDIF*/ - // Check periodically if the WED is active and if not, hide the toolwindows - IF SELF:oGrid != NULL .AND. SELF:oGrid:oActiveDesigner == SELF - IF SELF:eCurrent == WEDAction.None .AND. !SELF:oSurface:ContainsFocus - SELF:ShowHideTools(FALSE) - ENDIF ENDIF + */ + // Check periodically if the WED is active and if not, hide the toolwindows + IF SELF:oGrid != NULL .AND. SELF:oGrid:oActiveDesigner == SELF + IF SELF:eCurrent == WEDAction.None .AND. !SELF:oSurface:CanFocus + SELF:ShowHideTools(FALSE) + ENDIF + ENDIF RETURN PROTECTED VIRTUAL METHOD ControlPaint(o AS OBJECT , e AS PaintEventArgs) AS VOID @@ -1393,11 +1398,11 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase IF aMultiple:ContainsKey(oProp:cMember) aList := aMultiple[oProp:cMember]:SubProperties ELSE - aCode:Add("") // create an empty line code, placeholder to be filled later - LOCAL oMulti AS MultiPropertyDescriptor - oMulti := MultiPropertyDescriptor{oProp:cMember, aCode:Count} - aList := oMulti:SubProperties - aMultiple:Add(oProp:cMember , oMulti) + aCode:Add("") // create an empty line code, placeholder to be filled later + LOCAL oMulti AS MultiPropertyDescriptor + oMulti := MultiPropertyDescriptor{oProp:cMember, aCode:Count} + aList := oMulti:SubProperties + aMultiple:Add(oProp:cMember , oMulti) ENDIF DO WHILE aList:Count < oProp:nMultiPos aList:Add("") @@ -1649,10 +1654,25 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase NEXT RETURN oRet - METHOD ShowTabOrder() AS VOID - LOCAL oDlg AS VOControlCreationOrderDlg - LOCAL oDesign AS DesignWindowItem + METHOD CloseTabOrder(o AS OBJECT , e AS System.EventArgs) AS VOID + LOCAL oDesign AS DesignWindowItem LOCAL n AS INT + IF Self:oDlg:DialogResult == DialogResult.OK + SELF:BeginAction() + FOR n := 0 UPTO Self:oDlg:aNewOrder:Count - 1 + oDesign := (DesignWindowItem)Self:oDlg:aNewOrder[n] + SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{oDesign:cGuid , "__Order" , n + 1}) + NEXT + SELF:EndAction() + ENDIF + Self:oDlg := NULL + SELF:SelectMainItem() + return + + METHOD ShowTabOrder() AS VOID + + //LOCAL oDesign AS DesignWindowItem + //LOCAL n AS INT IF SELF:oWindow == NULL .OR. SELF:oWindowDesign == NULL RETURN ENDIF @@ -1660,16 +1680,13 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase RETURN ENDIF SELF:SelectMainItem() - oDlg := VOControlCreationOrderDlg{SELF , SELF:GetAllDesignItemsByCreationOrder()} - IF oDlg:ShowDialog() == DialogResult.OK - SELF:BeginAction() - FOR n := 0 UPTO oDlg:aNewOrder:Count - 1 - oDesign := (DesignWindowItem)oDlg:aNewOrder[n] - SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{oDesign:cGuid , "__Order" , n + 1}) - NEXT - SELF:EndAction() - ENDIF - SELF:SelectMainItem() + self:oDlg := VOControlCreationOrderDlg{SELF , SELF:GetAllDesignItemsByCreationOrder()} + self:oDlg:Closed += System.EventHandler{ SELF , @CloseTabOrder() } + + self:oDlg:TopMost := True + self:oDlg:Show() + self:oDlg:Focus() + RETURN METHOD DoDummyChange() AS VOID @@ -1716,6 +1733,7 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase SELF:oSurface:Invalidate(TRUE) RETURN + METHOD Open() AS VOID LOCAL oDialog AS OpenFileDialog oDialog := OpenFileDialog{} @@ -1741,6 +1759,7 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase IF oDlg:ShowDialog() == DialogResult.OK SELF:Save(oDlg:FileName , FALSE) ENDIF + RETURN @@ -1774,7 +1793,7 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase oPrgStream := EditorStream{} oVhStream := EditorStream{} - oRcStream := EditorStream{} + oRCStream := EditorStream{} oCode := SELF:GetCodeContents() IF SELF:GetSaveFileStreams(cFileName , REF oVNFrmStream , oRCStream , oPrgStream , oVhStream , REF cVhName , lVnfrmOnly , REF lRcInSameFolder) @@ -2839,26 +2858,26 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase NEXT - SELF:oGrid:Fill(SELF:aSelected) - SELF:UpdateControlOrders() - // ((DesignWindowItem)SELF:aSelected[ self:aSelected:Count - 1 ]):Control:BringToFront() - // ((DesignWindowItem)SELF:aSelected[0]):AdjustSelectors() + SELF:oGrid:Fill(SELF:aSelected) + SELF:UpdateControlOrders() + // ((DesignWindowItem)SELF:aSelected[ self:aSelected:Count - 1 ]):Control:BringToFront() + // ((DesignWindowItem)SELF:aSelected[0]):AdjustSelectors() - /* Application.DoEvents() - System.Threading.Thread.Sleep(20) - FOR n := 0 UPTO SELF:oWindow:Controls:Count - 1 - SELF:oWindow:Controls[n]:Invalidate() - NEXT - SELF:oWindow:Invalidate() - SELF:oSurface:Invalidate()*/ - // SELF:oSurface:Invalidate(TRUE) + /* Application.DoEvents() + System.Threading.Thread.Sleep(20) + FOR n := 0 UPTO SELF:oWindow:Controls:Count - 1 + SELF:oWindow:Controls[n]:Invalidate() + NEXT + SELF:oWindow:Invalidate() + SELF:oSurface:Invalidate()*/ + // SELF:oSurface:Invalidate(TRUE) - IF SELF:IsDirtyChanged != NULL - SELF:IsDirtyChanged:Invoke(SELF , EventArgs{}) - ENDIF + IF SELF:IsDirtyChanged != NULL + SELF:IsDirtyChanged:Invoke(SELF , EventArgs{}) + ENDIF - SELF:PrintStatus() + SELF:PrintStatus() ENDIF @@ -2977,10 +2996,44 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase CASE eAction == DesignerBasicActionType.SetProperty oDesign := SELF:GetDesignItemFromGuid(uData:cGuid) - oProp := oDesign:GetProperty(uData:cData) - IF !oProp:TextValue == oProp:GetTextValue(uData:oData) - SELF:lDidAction := TRUE - IF !oAction:lExecuted + if oDesign == NULL + SELF:ShowHideTools(FALSE) + oRet := False + else + + oProp := oDesign:GetProperty(uData:cData) + IF !oProp:TextValue == oProp:GetTextValue(uData:oData) + SELF:lDidAction := TRUE + IF !oAction:lExecuted + oUndo := DesignerBasicAction{TRUE} + oUndo:eAction := DesignerBasicActionType.SetProperty + oUndo:uData := ActionData{oDesign:cGuid , uData:cData , oProp:Value} + oAction:aUndo:Add(oUndo) + + oRedo := DesignerBasicAction{TRUE} + oRedo:eAction := DesignerBasicActionType.SetProperty + oRedo:uData := ActionData{oDesign:cGuid , uData:cData , uData:oData} + oAction:aRedo:Add(oRedo) + ENDIF + oProp:Value := uData:oData + SELF:PropertyGotUpdated(oDesign , oProp) + SELF:AddAffected(oDesign) + ENDIF + endif + + + + CASE eAction == DesignerBasicActionType.SetIndex + oDesign := SELF:GetDesignItemFromGuid(uData:cGuid) + if oDesign == NULL + SELF:ShowHideTools(FALSE) + oRet := False + else + n := INT(uData:oData) + IF oDesign:Control:Parent:Controls:GetChildIndex(oDesign:Control) != n + oDesign:Control:Parent:Controls:SetChildIndex(oDesign:Control , n) + SELF:lDidAction := TRUE + /* IF !oAction:lExecuted oUndo := DesignerBasicAction{TRUE} oUndo:eAction := DesignerBasicActionType.SetProperty oUndo:uData := ActionData{oDesign:cGuid , uData:cData , oProp:Value} @@ -2990,32 +3043,11 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase oRedo:eAction := DesignerBasicActionType.SetProperty oRedo:uData := ActionData{oDesign:cGuid , uData:cData , uData:oData} oAction:aRedo:Add(oRedo) + ENDIF*/ + SELF:AddAffected(oDesign) ENDIF - oProp:Value := uData:oData - SELF:PropertyGotUpdated(oDesign , oProp) - SELF:AddAffected(oDesign) - ENDIF - - - CASE eAction == DesignerBasicActionType.SetIndex - oDesign := SELF:GetDesignItemFromGuid(uData:cGuid) - n := INT(uData:oData) - IF oDesign:Control:Parent:Controls:GetChildIndex(oDesign:Control) != n - oDesign:Control:Parent:Controls:SetChildIndex(oDesign:Control , n) - SELF:lDidAction := TRUE - /* IF !oAction:lExecuted - oUndo := DesignerBasicAction{TRUE} - oUndo:eAction := DesignerBasicActionType.SetProperty - oUndo:uData := ActionData{oDesign:cGuid , uData:cData , oProp:Value} - oAction:aUndo:Add(oUndo) - oRedo := DesignerBasicAction{TRUE} - oRedo:eAction := DesignerBasicActionType.SetProperty - oRedo:uData := ActionData{oDesign:cGuid , uData:cData , uData:oData} - oAction:aRedo:Add(oRedo) - ENDIF*/ - SELF:AddAffected(oDesign) - ENDIF + endif END CASE @@ -3037,18 +3069,21 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase DO CASE CASE eAction == DesignerActionType.Select oDesign := SELF:GetDesignItemFromGuid(cGuid) - IF !oDesign:lSelected - SELF:DoAction(DesignerActionType.DeSelectAll) - oDesign:lSelected := TRUE - SELF:aSelected:Add(oDesign) - SELF:AddAffected(oDesign) - ENDIF + if !oDesign == null + IF !oDesign:lSelected + SELF:DoAction(DesignerActionType.DeSelectAll) + oDesign:lSelected := TRUE + SELF:aSelected:Add(oDesign) + SELF:AddAffected(oDesign) + ENDIF + endif CASE eAction == DesignerActionType.SelectAdd oDesign := SELF:GetDesignItemFromGuid(cGuid) IF !oDesign:lSelected oDesign:lSelected := TRUE SELF:aSelected:Add(oDesign) SELF:AddAffected(oDesign) + ENDIF CASE eAction == DesignerActionType.SelectDefault IF SELF:aSelected:Count >= 2 @@ -3515,7 +3550,7 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase LOCAL oEntry AS DesignerClipboardEntry LOCAL lNameConflict AS LOGIC LOCAL cGuid AS STRING - LOCAL n,m AS INT + LOCAL n,m, neworder AS INT IF SELF:lReadOnly RETURN @@ -3530,25 +3565,34 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase SELF:BeginAction() SELF:DoAction(DesignerActionType.DeSelectAll) + + neworder := SELF:ArrangeControlOrder():Count + FOR n := 0 UPTO Clipboard:Count - 1 oEntry := Clipboard:GetEntry(n) lNameConflict := SELF:NameExists(oEntry:cName) oEntry:nPasted ++ cGuid := Guid.NewGuid():ToString() + SELF:StartAction(DesignerBasicActionType.Create , ActionData{cGuid , oEntry:cClass , ""}) + FOR m := 0 UPTO oEntry:aProperties:Count - 1 SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , oEntry:aProperties:GetName(m) , oEntry:aProperties:GetValue(m)}) NEXT + IF lNameConflict SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "Name" , SELF:GetNextName(oEntry:cName)}) END IF SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "_Left" , oEntry:x + XCustomEditorSettings.PasteOffSetX * oEntry:nPasted}) SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "_Top" , oEntry:y + XCustomEditorSettings.PasteOffSetY * oEntry:nPasted}) + //set the order to end + SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "__Order" , neworder++}) IF SELF:ViewMode == ViewMode.Browse SELF:StartAction(DesignerBasicActionType.SetProperty , ActionData{cGuid , "_Deleted" , 1}) END IF SELF:DoAction(DesignerActionType.SelectAdd , cGuid) NEXT + SELF:ArrangeControlOrder() SELF:EndAction() RETURN @@ -3971,22 +4015,25 @@ PARTIAL CLASS VOWindowEditor INHERIT WindowDesignerBase LOCAL aDesign AS ArrayList LOCAL aSorted AS SortedList LOCAL oDesign AS DesignWindowItem - LOCAL n AS INT + LOCAL n1, n2 AS INT SELF:oWindowDesign:GetProperty("__Order"):Value := 0 aDesign := SELF:GetAllDesignItems() aSorted := SortedList{} - FOR n := 0 UPTO aDesign:Count - 1 - oDesign := (DesignWindowItem)aDesign[n] + + FOR n1 := 0 UPTO aDesign:Count - 1 + oDesign := (DesignWindowItem)aDesign[n1] DO WHILE aSorted:ContainsKey(oDesign:Order) oDesign:GetProperty("__Order"):Value := oDesign:Order + 1 ENDDO aSorted:Add(oDesign:Order , oDesign) NEXT - FOR n := 0 UPTO aSorted:Count - 1 - oDesign := (DesignWindowItem)aSorted:GetByIndex(n) - oDesign:GetProperty("__Order"):Value := n + 1 + + FOR n2 := 0 UPTO aSorted:Count - 1 + oDesign := (DesignWindowItem)aSorted:GetByIndex(n2) + oDesign:GetProperty("__Order"):Value := n2 + 1 NEXT RETURN aSorted + METHOD GetAllDesignItemsByCreationOrder() AS ArrayList LOCAL aSorted AS SortedList LOCAL aDesign AS ArrayList @@ -4224,7 +4271,7 @@ CLASS DesignWindowItem INHERIT DesignItem LOCAL oProp,oTest AS VODesignProperty LOCAL cProp AS STRING - LOCAL n,m,k AS INT + LOCAL n,m,K AS INT IF oTemplate == NULL oTemplate := VOWindowEditorTemplate.Get("PUSHBUTTON") @@ -4440,8 +4487,8 @@ CLASS DesignWindowItem INHERIT DesignItem oProp:cPage := cCaption ENDIF*/ // lFound := FALSE - FOR k := 0 UPTO oTemplate:aProperties:Count - 1 - oTest := (VODesignProperty)oTemplate:aProperties[k] + FOR K := 0 UPTO oTemplate:aProperties:Count - 1 + oTest := (VODesignProperty)oTemplate:aProperties[K] IF (!lBasic .AND. oTest:Caption:ToUpper() == cProp) .OR. (lBasic .AND. oTest:Name:ToUpper() == cProp) // lFound := TRUE // IF oTest:Name:ToUpper() == "TAB KEY" .and. SELF:cFullClass:IndexOf("FORM:DIALOGWINDOW") == 0 @@ -4870,6 +4917,14 @@ CLASS DesignWindowItem INHERIT DesignItem LOOP // Let the Tab Key property decide on WS_CHILD and DS_CONTROL styles END IF ENDIF + // IF oProp:Name:ToUpper() == "TAB KEY" + // // LOCAL oTypeProp AS VODesignProperty + // // oTypeProp := SELF:GetPropertyByCaption("Type") + // IF SELF:GetPropertyByCaption("Type") != NULL .AND. SELF:GetPropertyByCaption("Type"):Value != NULL .AND. SELF:GetPropertyByCaption("Type"):Value:GetType() == TypeOf(INT) .AND. (INT)SELF:GetPropertyByCaption("Type"):Value == 0 + // LOOP + // END IF + // ENDIF + IF oProp:Name:ToUpper() == "TAB KEY" LOCAL oTypeProp AS VODesignProperty oTypeProp := SELF:GetPropertyByCaption("Type") @@ -5037,13 +5092,13 @@ INTERNAL CLASS WindowTypeSelectDlg INHERIT Form EXPORT cName AS STRING EXPORT cCloneFrom := NULL AS STRING - PROTECT xfile AS XFile + PROTECT XFile AS XFile PROTECT cDefaultFileName AS STRING - CONSTRUCTOR(file AS XFile, cFileName AS STRING) + CONSTRUCTOR(File AS XFile, cFileName AS STRING) SUPER() - xfile := file + XFile := File cDefaultFileName := cFileName LOCAL oTemplate AS VOControlTemplate LOCAL n AS INT @@ -5062,7 +5117,7 @@ INTERNAL CLASS WindowTypeSelectDlg INHERIT Form SELF:oTypeListBox:SelectedIndex := 0 END IF // we need the xfile object to get to the XProject and read the files from the database - IF xfile == NULL + IF XFile == NULL SELF:oCloneButton:Enabled := FALSE ENDIF diff --git a/src/VisualStudio/XSharpVoEditors/Dialogs/WindowCloneSelectDlg.Designer.prg b/src/VisualStudio/XSharpVoEditors/Dialogs/WindowCloneSelectDlg.Designer.prg index ace3b4d9f6..b2b6b14287 100644 --- a/src/VisualStudio/XSharpVoEditors/Dialogs/WindowCloneSelectDlg.Designer.prg +++ b/src/VisualStudio/XSharpVoEditors/Dialogs/WindowCloneSelectDlg.Designer.prg @@ -3,7 +3,8 @@ // This code was generated by a tool. // Runtime version: 4.0.30319.42000 // Generator : XSharp.CodeDomProvider 2.20.0.3 -// Timestamp : 05/07/2024 13:12:43 + +// Timestamp : 15.07.2024 08:13:36 // // Changes to this file may cause incorrect behavior and may be lost if // the code is regenerated. @@ -16,10 +17,14 @@ BEGIN NAMESPACE XSharp.VOEditors.Dialogs /// /// Required designer variable. /// - PRIVATE components := NULL AS System.ComponentModel.IContainer + + PRIVATE components := NULL AS System.ComponentModel.IContainer PRIVATE oCancelButton AS System.Windows.Forms.Button PRIVATE oOKButton AS System.Windows.Forms.Button PRIVATE oFilesList AS System.Windows.Forms.ListBox + PRIVATE SelectFolder AS System.Windows.Forms.Button + PRIVATE SearchButton AS System.Windows.Forms.Button + PRIVATE oSearchTextbox AS System.Windows.Forms.TextBox /// /// Clean up any resources being used. @@ -39,57 +44,98 @@ BEGIN NAMESPACE XSharp.VOEditors.Dialogs /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// - PRIVATE METHOD InitializeComponent() AS VOID STRICT - SELF:oCancelButton := System.Windows.Forms.Button{} - SELF:oOKButton := System.Windows.Forms.Button{} - SELF:oFilesList := System.Windows.Forms.ListBox{} - SELF:SuspendLayout() - // - // oCancelButton - // - SELF:oCancelButton:Anchor := System.Windows.Forms.AnchorStyles.Right - SELF:oCancelButton:DialogResult := System.Windows.Forms.DialogResult.Cancel - SELF:oCancelButton:Location := System.Drawing.Point{346, 353} - SELF:oCancelButton:Name := "oCancelButton" - SELF:oCancelButton:Size := System.Drawing.Size{115, 23} - SELF:oCancelButton:TabIndex := 2 - SELF:oCancelButton:Text := "&Cancel" - // - // oOKButton - // - SELF:oOKButton:Anchor := System.Windows.Forms.AnchorStyles.Left - SELF:oOKButton:Location := System.Drawing.Point{12, 353} - SELF:oOKButton:Name := "oOKButton" - SELF:oOKButton:Size := System.Drawing.Size{115, 23} - SELF:oOKButton:TabIndex := 1 - SELF:oOKButton:Text := "&OK" - SELF:oOKButton:Click += System.EventHandler{ SELF, @oOKButton_Click() } - // - // oFilesList - // - SELF:oFilesList:Anchor := System.Windows.Forms.AnchorStyles.Top - SELF:oFilesList:Location := System.Drawing.Point{12, 10} - SELF:oFilesList:Name := "oFilesList" - SELF:oFilesList:Size := System.Drawing.Size{449, 329} - SELF:oFilesList:TabIndex := 0 - SELF:oFilesList:DoubleClick += System.EventHandler{ SELF, @oOKButton_Click() } - // - // WindowCloneSelectDlg - // - SELF:AcceptButton := SELF:oOKButton - SELF:CancelButton := SELF:oCancelButton - SELF:ClientSize := System.Drawing.Size{473, 385} - SELF:Controls:Add(SELF:oCancelButton) - SELF:Controls:Add(SELF:oOKButton) - SELF:Controls:Add(SELF:oFilesList) - SELF:Location := System.Drawing.Point{100, 100} - SELF:MaximizeBox := false - SELF:MinimizeBox := false - SELF:Name := "WindowCloneSelectDlg" - SELF:StartPosition := System.Windows.Forms.FormStartPosition.Manual - SELF:Text := "Choose source window to duplicate:" - SELF:ResumeLayout(false) - END METHOD + +PRIVATE METHOD InitializeComponent() AS VOID STRICT + SELF:oCancelButton := System.Windows.Forms.Button{} + SELF:oOKButton := System.Windows.Forms.Button{} + SELF:oFilesList := System.Windows.Forms.ListBox{} + SELF:oSearchTextbox := System.Windows.Forms.TextBox{} + SELF:SelectFolder := System.Windows.Forms.Button{} + SELF:SearchButton := System.Windows.Forms.Button{} + SELF:SuspendLayout() + // + // oCancelButton + // + SELF:oCancelButton:Anchor := ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))) + SELF:oCancelButton:DialogResult := System.Windows.Forms.DialogResult.Cancel + SELF:oCancelButton:Location := System.Drawing.Point{332, 348} + SELF:oCancelButton:Name := "oCancelButton" + SELF:oCancelButton:Size := System.Drawing.Size{115, 23} + SELF:oCancelButton:TabIndex := 5 + SELF:oCancelButton:Text := "&Cancel" + // + // oOKButton + // + SELF:oOKButton:Anchor := ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))) + SELF:oOKButton:Location := System.Drawing.Point{12, 348} + SELF:oOKButton:Name := "oOKButton" + SELF:oOKButton:Size := System.Drawing.Size{115, 23} + SELF:oOKButton:TabIndex := 3 + SELF:oOKButton:Text := "&OK" + SELF:oOKButton:Click += System.EventHandler{ SELF, @oOKButton_Click() } + // + // oFilesList + // + SELF:oFilesList:Anchor := ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) ; + | System.Windows.Forms.AnchorStyles.Right))) + SELF:oFilesList:Location := System.Drawing.Point{12, 10} + SELF:oFilesList:Name := "oFilesList" + SELF:oFilesList:Size := System.Drawing.Size{435, 290} + SELF:oFilesList:TabIndex := 0 + SELF:oFilesList:DoubleClick += System.EventHandler{ SELF, @oOKButton_Click() } + // + // oSearchTextbox + // + SELF:oSearchTextbox:Anchor := ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) ; + | System.Windows.Forms.AnchorStyles.Right))) + SELF:oSearchTextbox:Location := System.Drawing.Point{12, 306} + SELF:oSearchTextbox:Name := "oSearchTextbox" + SELF:oSearchTextbox:Size := System.Drawing.Size{314, 20} + SELF:oSearchTextbox:TabIndex := 1 + // + // SelectFolder + // + SELF:SelectFolder:Anchor := ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))) + SELF:SelectFolder:Location := System.Drawing.Point{179, 348} + SELF:SelectFolder:Name := "SelectFolder" + SELF:SelectFolder:Size := System.Drawing.Size{115, 23} + SELF:SelectFolder:TabIndex := 4 + SELF:SelectFolder:Text := "Select &Folder" + SELF:SelectFolder:UseVisualStyleBackColor := true + SELF:SelectFolder:Click += System.EventHandler{ SELF, @SelectFolder_Click() } + // + // SearchButton + // + SELF:SearchButton:Anchor := ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))) + SELF:SearchButton:Location := System.Drawing.Point{334, 304} + SELF:SearchButton:Name := "SearchButton" + SELF:SearchButton:Size := System.Drawing.Size{113, 23} + SELF:SearchButton:TabIndex := 2 + SELF:SearchButton:Text := "&Search" + SELF:SearchButton:UseVisualStyleBackColor := true + SELF:SearchButton:Click += System.EventHandler{ SELF, @SearchButton_Click() } + // + // WindowCloneSelectDlg + // + SELF:AcceptButton := SELF:oOKButton + SELF:CancelButton := SELF:oCancelButton + SELF:ClientSize := System.Drawing.Size{459, 386} + SELF:Controls:Add(SELF:SearchButton) + SELF:Controls:Add(SELF:SelectFolder) + SELF:Controls:Add(SELF:oSearchTextbox) + SELF:Controls:Add(SELF:oCancelButton) + SELF:Controls:Add(SELF:oOKButton) + SELF:Controls:Add(SELF:oFilesList) + SELF:Location := System.Drawing.Point{100, 100} + SELF:MaximizeBox := false + SELF:MinimizeBox := false + SELF:Name := "WindowCloneSelectDlg" + SELF:StartPosition := System.Windows.Forms.FormStartPosition.Manual + SELF:Text := "Choose source window to duplicate:" + SELF:ResumeLayout(false) + SELF:PerformLayout() + END METHOD + #endregion END CLASS END NAMESPACE diff --git a/src/VisualStudio/XSharpVoEditors/Dialogs/WindowCloneSelectDlg.prg b/src/VisualStudio/XSharpVoEditors/Dialogs/WindowCloneSelectDlg.prg index c60198b66e..ad026b62a1 100644 --- a/src/VisualStudio/XSharpVoEditors/Dialogs/WindowCloneSelectDlg.prg +++ b/src/VisualStudio/XSharpVoEditors/Dialogs/WindowCloneSelectDlg.prg @@ -1,4 +1,7 @@ USING System + +USING System.IO + USING System.Collections.Generic USING System.ComponentModel USING System.Data @@ -13,35 +16,113 @@ USING XSharp.Settings BEGIN NAMESPACE XSharp.VOEditors.Dialogs - PUBLIC PARTIAL CLASS WindowCloneSelectDlg ; + +PUBLIC PARTIAL CLASS WindowCloneSelectDlg ; INHERIT System.Windows.Forms.Form + PRIVATE listedFileNames as IList + PRIVATE cSelected := NULL AS STRING + PRIVATE cCompareFileName AS STRING + Private cStartUpDir as STRING + + + public constructor(file AS XFile, cFileName AS STRING) strict + InitializeComponent() + Self:cCompareFileName := cFileName + Self:listedFileNames:= List{} + local fiProjectFile := FileInfo{file:Project:FileName} as FileInfo + + Self:cStartUpDir := fiProjectFile:DirectoryName + + //save the first loadet filelist + listedFileNames := file:Project:GetFilesOfType(XFileType.VOForm, TRUE) + + FOREACH VAR FileName IN listedFileNames + // Suppress the frm that we are adding ! + IF !String.Equals(FileName, Self:cCompareFileName,StringComparison.OrdinalIgnoreCase) + SELF:oFilesList:Items:Add(FileName) + ENDIF + NEXT + + return + end constructor + + PROPERTY SelectedFile AS STRING GET SELF:cSelected + + PRIVATE METHOD oOKButton_Click(sender AS System.Object, e AS System.EventArgs) AS VOID STRICT + IF SELF:oFilesList:SelectedIndex == -1 + SELF:DialogResult := System.Windows.Forms.DialogResult.Cancel + RETURN + END IF + SELF:cSelected := SELF:oFilesList:SelectedItem:ToString() + SELF:DialogResult := System.Windows.Forms.DialogResult.OK + RETURN + END METHOD + PRIVATE METHOD SearchButton_Click(sender AS System.Object, e AS System.EventArgs) AS VOID STRICT + ListBoxSearch() + RETURN + END METHOD - PRIVATE cSelected := NULL AS STRING - public constructor(file AS XFile, cFileName AS STRING) strict - InitializeComponent() + PRIVATE METHOD ListBoxSearch() AS VOID + local searchString:=self:oSearchTextbox:Text as String - VAR fileNames := file:Project:GetFilesOfType(XFileType.VOForm, TRUE) - FOREACH VAR filename IN fileNames + //clear list + SELF:oFilesList:Items:Clear() + + //on empty string, reset the liste to original only + if String.IsNullOrEmpty(searchString) + FOREACH VAR FileName IN listedFileNames // Suppress the frm that we are adding ! - IF !String.Equals(filename, cFileName,StringComparison.OrdinalIgnoreCase) - SELF:oFilesList:Items:Add(filename) - ENDIF + SELF:oFilesList:Items:Add(FileName) NEXT - return - end constructor + end if + //filter list + local nl as IList + nl:= List{} + foreach var li in listedFileNames + IF !String.Equals(li, Self:cCompareFileName,StringComparison.OrdinalIgnoreCase) + if li:ToUpper():Contains(searchString:ToUpper()) + nl:Add(li) + endif + endif + next - PROPERTY SelectedFile AS STRING GET SELF:cSelected + //set listitems + FOREACH VAR FileName IN nl + // Suppress the frm that we are adding ! + SELF:oFilesList:Items:Add(FileName) + NEXT + + + + RETURN + + PRIVATE METHOD SelectFolder_Click(sender AS System.Object, e AS System.EventArgs) AS VOID STRICT + + begin using var fbd := FolderBrowserDialog{} + + local result as DialogResult + fbd:SelectedPath := Self:cStartUpDir + result := fbd:ShowDialog() + if result == DialogResult.OK .AND. !String.IsNullOrWhiteSpace(fbd:SelectedPath) + //replace or add the files.... + listedFileNames := Directory.GetFiles(fbd:SelectedPath, "*.xsfrm",System.IO.SearchOption.AllDirectories ) + + SELF:oFilesList:Items:Clear() + //load files + FOREACH VAR FileName IN listedFileNames + // Suppress the frm that we are adding ! + IF !String.Equals(FileName, Self:cCompareFileName,StringComparison.OrdinalIgnoreCase) + SELF:oFilesList:Items:Add(FileName) + ENDIF + NEXT + endif + + end using + RETURN + END METHOD + +END CLASS - PRIVATE METHOD oOKButton_Click(sender AS System.Object, e AS System.EventArgs) AS VOID STRICT - IF SELF:oFilesList:SelectedIndex == -1 - SELF:DialogResult := System.Windows.Forms.DialogResult.Cancel - RETURN - END IF - SELF:cSelected := SELF:oFilesList:SelectedItem:ToString() - SELF:DialogResult := System.Windows.Forms.DialogResult.OK - RETURN - END METHOD - END CLASS END NAMESPACE diff --git a/src/VisualStudio/XSharpVoEditors/VoEditors.xsproj b/src/VisualStudio/XSharpVoEditors/VoEditors.xsproj index 4fc6687084..7d5d0e5a27 100644 --- a/src/VisualStudio/XSharpVoEditors/VoEditors.xsproj +++ b/src/VisualStudio/XSharpVoEditors/VoEditors.xsproj @@ -17,6 +17,7 @@ true False + True 4 @@ -45,15 +46,14 @@ XSharp.Core.dll False True - $(RTOutputPath)XSharp.Core.dll - + ..\..\..\Artifacts\Debug\XSharp.Core.dll XSharp.RT XSharp.RT.dll False True - $(RTOutputPath)XSharp.RT.dll + ..\..\..\Artifacts\Debug\XSharp.RT.dll System.Drawing diff --git a/src/VisualStudio/XSharpVoEditors/XSharp_WED.prg b/src/VisualStudio/XSharpVoEditors/XSharp_WED.prg index 5f7deeccdd..b59395d444 100644 --- a/src/VisualStudio/XSharpVoEditors/XSharp_WED.prg +++ b/src/VisualStudio/XSharpVoEditors/XSharp_WED.prg @@ -342,7 +342,7 @@ CLASS XSharp_VOWindowEditor INHERIT VOWindowEditor aLines:Add("") aLines:Add("RETURN NIL") ELSE - aLines := GetTemplate(cName) + aLines := SELF:GetTemplate(cName) END IF IF aLines == NULL XFuncs.WarningBox("Could not find code template for event: " + cName) diff --git a/src/VisualStudio/XSharpVoEditors/XSharp_WedControl.prg b/src/VisualStudio/XSharpVoEditors/XSharp_WedControl.prg index ab47f5a66f..ad603a7d50 100644 --- a/src/VisualStudio/XSharpVoEditors/XSharp_WedControl.prg +++ b/src/VisualStudio/XSharpVoEditors/XSharp_WedControl.prg @@ -104,15 +104,15 @@ CLASS XSharp_VOWEDControl INHERIT VOWEDControl IMPLEMENTS IVOWEDControl // Menu options METHOD CanDoAction(nType AS Actions) AS LOGIC - VAR lOk := CanDoAction( (DesignerActionType) (INT) nType) + VAR lOk := SELF:CanDoAction( (DesignerActionType) (INT) nType) RETURN lOk METHOD Action(nType AS Actions) AS VOID - DoAction( (DesignerActionType) (INT) nType) + SELF:DoAction( (DesignerActionType) (INT) nType) METHOD ShowStatusBarMessage(cMessage AS STRING) AS VOID IF (SELF:StatusMessage != NULL) - StatusMessage(cMessage) + SELF:StatusMessage(cMessage) ENDIF END CLASS