├── src ├── GeneralTools │ └── DataverseClient │ │ ├── ConnectControl │ │ ├── Properties │ │ │ ├── Messages.ar-sa.Designer.cs │ │ │ ├── Messages.de-de.Designer.cs │ │ │ ├── Messages.es-es.Designer.cs │ │ │ ├── Messages.fr-fr.Designer.cs │ │ │ ├── Messages.hi-IN.Designer.cs │ │ │ ├── Messages.it-IT.Designer.cs │ │ │ ├── Messages.ja-jp.Designer.cs │ │ │ ├── Messages.nl-nl.Designer.cs │ │ │ ├── Messages.pt-pt.Designer.cs │ │ │ ├── Messages.ru-ru.Designer.cs │ │ │ ├── Messages.zh-CN.Designer.cs │ │ │ ├── Messages.zh-tw.Designer.cs │ │ │ ├── Resources.ar-sa.Designer.cs │ │ │ ├── Resources.de-de.Designer.cs │ │ │ ├── Resources.es-es.Designer.cs │ │ │ ├── Resources.fr-fr.Designer.cs │ │ │ ├── Resources.it-It.Designer.cs │ │ │ ├── Resources.ja-jp.Designer.cs │ │ │ ├── Resources.nl-nl.Designer.cs │ │ │ ├── Resources.pt-pt.Designer.cs │ │ │ ├── Resources.ru-ru.Designer.cs │ │ │ ├── Resources.zh-CN.Designer.cs │ │ │ ├── Resources.zh-tw.Designer.cs │ │ │ ├── Settings.settings │ │ │ ├── Messages.en-us.Designer.cs │ │ │ ├── Resources.en-us.Designer.cs │ │ │ ├── Resources.hi-IN.Designer.cs │ │ │ ├── Settings.Designer.cs │ │ │ └── AssemblyInfo.cs │ │ ├── Fonts │ │ │ ├── segoeui.ttf │ │ │ ├── segoeuib.ttf │ │ │ ├── segoeuii.ttf │ │ │ └── segoeuiz.ttf │ │ ├── ImageResources │ │ │ ├── SymbolCheck.png │ │ │ ├── SymbolError.png │ │ │ ├── SecurityLock.png │ │ │ └── SymbolRefresh.png │ │ ├── Doc │ │ │ └── AppConfig_Settings_for_LoginControl.docx │ │ ├── Model │ │ │ └── HomeRealmsStore.xml │ │ ├── app.config │ │ ├── Styles │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ └── BrushResourcesHCMode.xaml │ │ ├── InternalExtensions │ │ │ └── SecureStringExtensions.cs │ │ ├── AdvancedOptions.xaml.cs │ │ ├── Utility │ │ │ ├── OrgNameFormater.cs │ │ │ ├── Enums_Events.cs │ │ │ └── AccessablityFormaters.cs │ │ └── ErrorWindow.xaml │ │ ├── Testers │ │ └── LoginControlTester │ │ │ ├── Image2.png │ │ │ ├── CRMLogo.png │ │ │ ├── Dataverse.ico │ │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ └── AssemblyInfo.cs │ │ │ ├── App.xaml │ │ │ └── App.xaml.cs │ │ ├── UnitTests │ │ ├── LiveTestsConsole │ │ │ ├── App.config │ │ │ ├── TestData │ │ │ │ └── TestSolution_1_0_0_1.zip │ │ │ ├── LiveTestsConsole.csproj │ │ │ ├── TokenRefresh.cs │ │ │ ├── Auth.cs │ │ │ └── BasicFlow.cs │ │ ├── LivePackageTestsConsole │ │ │ └── App.config │ │ ├── CdsClient_Core_Tests │ │ │ ├── TestMaterial │ │ │ │ ├── EnvVarsSample_1_0_0_2.zip │ │ │ │ ├── TestSolution_1_0_0_1.zip │ │ │ │ ├── PowerPlatformIPManagement_1_0_0_6_managed.zip │ │ │ │ └── PowerPlatformIPManagement_1_0_1_0_managed.zip │ │ │ ├── appsettings.json │ │ │ ├── NonParallelCollectionDefinition.cs │ │ │ ├── MoqHttpMessagehander.cs │ │ │ ├── SkippableConnectionTestAttribute.cs │ │ │ ├── TraceConsoleSupport.cs │ │ │ ├── UtilsTests.cs │ │ │ └── AzAuthExtentionTests.cs │ │ ├── AzDevOps_ServiceConnection_Test │ │ │ ├── appsettings.json │ │ │ ├── AzDevOps_ServiceConnection_Test.csproj │ │ │ └── Operations │ │ │ │ └── ConnectionTest.cs │ │ ├── ConnectonTests.playlist │ │ └── LivePackageRunUnitTests │ │ │ ├── LivePackageRunUnitTests.csproj │ │ │ └── RunTests.cs │ │ ├── UIStyles │ │ ├── Resources │ │ │ ├── Images │ │ │ │ └── ExpanderBackground.png │ │ │ ├── Grid │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ ├── BrushResourcesHCMode.xaml │ │ │ │ └── Styles.xaml │ │ │ ├── Label │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ ├── BrushResourcesHCMode.xaml │ │ │ │ └── Styles.xaml │ │ │ ├── Border │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ ├── BrushResourcesHCMode.xaml │ │ │ │ └── Styles.xaml │ │ │ ├── ListBox │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── RadioButton │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── TreeView │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── ToolBar │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ ├── BrushResourcesHCMode.xaml │ │ │ │ └── Styles.xaml │ │ │ ├── Expander │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── Textbox │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── Textblock │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── Checkbox │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── ScrollBar │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── Menu │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── Combobox │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── Window │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ ├── WindowResourceDictionary.cs │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── Button │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ └── BrushResourcesHCMode.xaml │ │ │ ├── PackageDeployerLayout │ │ │ │ └── Styles.xaml │ │ │ └── ListView │ │ │ │ ├── BrushResourcesNormalMode.xaml │ │ │ │ ├── BrushResourcesHCMode.xaml │ │ │ │ └── SortAdorner.cs │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ └── AssemblyInfo.cs │ │ └── Microsoft.PowerPlatform.Dataverse.Ui.Styles.csproj │ │ ├── Extensions │ │ ├── Microsoft.Dynamics.Sdk.Messages │ │ │ ├── Class1.cs │ │ │ └── Microsoft.Dynamics.Sdk.Messages.Shell.csproj │ │ ├── Microsoft.PowerPlatform.Dataverse.Client.AzAuth │ │ │ └── Microsoft.PowerPlatform.Dataverse.Client.AzAuth.csproj │ │ ├── Microsoft.PowerPlatform.Dataverse.ServiceClientConverter │ │ │ ├── Microsoft.PowerPlatform.Dataverse.ServiceClientConverter.csproj │ │ │ ├── Microsoft.PowerPlatform.Dataverse.ServiceClientConverter.sln │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ └── DynamicsExtension │ │ │ └── Microsoft.PowerPlatform.Dataverse.Client.Dynamics.csproj │ │ ├── Client │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ └── AssemblyInfo.cs │ │ ├── IConnectionService.cs │ │ ├── app.config │ │ ├── Extensions │ │ │ └── SupportClasses │ │ │ │ ├── LogicalSortOrder.cs │ │ │ │ ├── LogicalSearchOperator.cs │ │ │ │ ├── DataverseFilterConditionItem.cs │ │ │ │ ├── FormTypeId.cs │ │ │ │ ├── DataverseSearchFilter.cs │ │ │ │ ├── PickListItem.cs │ │ │ │ └── PickListMetaElement.cs │ │ ├── GlobalSuppressions.cs │ │ ├── Builder │ │ │ └── ServiceClientRequestBuilder.cs │ │ ├── Auth │ │ │ ├── MSALHttpClient.cs │ │ │ ├── TokenCache │ │ │ │ ├── MemoryTokenCacheOptions.cs │ │ │ │ ├── MemoryCacheSerializerHints.cs │ │ │ │ └── FileBackedTokenCache.cs │ │ │ ├── ExecuteAuthenticationResults.cs │ │ │ ├── MSALHttpHelper.cs │ │ │ └── PromptBehavior.cs │ │ ├── UnitTestBehaviors │ │ │ ├── BCrmWebSvc.cs │ │ │ └── AssemblyInfo.cs │ │ ├── UnitTests │ │ │ ├── AssemblyInfo.cs │ │ │ └── DeviceCredentialsTest.cs │ │ ├── InternalExtensions │ │ │ ├── SecureStringExtensions.cs │ │ │ └── RequestResponseExtenstions.cs │ │ ├── TraceSourceSetting.cs │ │ ├── Model │ │ │ ├── DiscoverOrganizationsResult.cs │ │ │ └── GlobalDiscoveryModel.cs │ │ ├── Exceptions │ │ │ └── HttpOperationException.cs │ │ ├── TraceSourceSettingStore.cs │ │ ├── TraceListenerBroker.cs │ │ ├── HttpUtils │ │ │ ├── HttpResponseMessageWrapper.cs │ │ │ ├── HttpMessageWrapper.cs │ │ │ ├── HttpRequestSanitizer.cs │ │ │ └── HttpRequestMessageWrapper.cs │ │ ├── Utils │ │ │ ├── ErrorCodes.cs │ │ │ ├── ImportSolutionProperties.cs │ │ │ └── PartyListHelper.cs │ │ ├── Connector │ │ │ └── OnPremises │ │ │ │ └── ServiceContextInit.cs │ │ ├── Environs.cs │ │ └── DataverseServiceClientBuilder.cs │ │ ├── PowerShell │ │ └── Microsoft.PowerPlatform.Dataverse.Client.PowerShell │ │ │ ├── appsettings.json │ │ │ ├── Microsoft.PowerPlatform.Dataverse.Client.PowerShell │ │ │ ├── Microsoft.PowerPlatform.Dataverse.Client.PowerShell.psm1 │ │ │ └── UtilityFunctions.psm1 │ │ │ ├── RegisterForSession.ps1 │ │ │ ├── RegisterServiceClient.ps1 │ │ │ ├── Start-Debug.ps1 │ │ │ └── GenerateCatlogFile.ps1 │ │ ├── WebResourceUtility │ │ ├── app.config │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── WebResourceTypes.cs │ │ └── Microsoft.PowerPlatform.Dataverse.WebResourceUtility.csproj │ │ └── DataverseClient_PackageTestSolution.sln ├── nuspecs │ ├── Microsoft.PowerPlatform.Dataverse.ConnectControl.ReleaseNotes.txt │ ├── Microsoft.PowerPlatform.Dataverse.Client.AzAuth.ReleaseNotes.txt │ ├── Microsoft.PowerPlatform.Dataverse.ServiceClientConverter.ReleaseNotes.txt │ ├── Microsoft.Dynamics.Sdk.Messages.ReleaseNotes.txt │ └── Microsoft.PowerPlatform.Dataverse.Client.Dynamics.ReleaseNotes.txt ├── Build.Common.props ├── Build.Common.StandardAndLegacy.props ├── Build.Common.core.props └── Directory.Build.props ├── global.json ├── Directory.Build.targets ├── LICENSE ├── .vscode ├── launch.json └── tasks.json ├── .gitignore └── Directory.Build.props /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.ar-sa.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.de-de.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.es-es.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.fr-fr.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.hi-IN.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.it-IT.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.ja-jp.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.nl-nl.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.pt-pt.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.ru-ru.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.zh-CN.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.zh-tw.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.ar-sa.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.de-de.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.es-es.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.fr-fr.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.it-It.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.ja-jp.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.nl-nl.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.pt-pt.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.ru-ru.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.zh-CN.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.zh-tw.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "6.0.406", 4 | "rollForward": "latestFeature", 5 | "allowPrerelease": false 6 | } 7 | } -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Fonts/segoeui.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/Fonts/segoeui.ttf -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Fonts/segoeuib.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/Fonts/segoeuib.ttf -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Fonts/segoeuii.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/Fonts/segoeuii.ttf -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Fonts/segoeuiz.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/Fonts/segoeuiz.ttf -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Testers/LoginControlTester/Image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/Testers/LoginControlTester/Image2.png -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Testers/LoginControlTester/CRMLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/Testers/LoginControlTester/CRMLogo.png -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Testers/LoginControlTester/Dataverse.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/Testers/LoginControlTester/Dataverse.ico -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/ImageResources/SymbolCheck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/ImageResources/SymbolCheck.png -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/ImageResources/SymbolError.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/ImageResources/SymbolError.png -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/LiveTestsConsole/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/ImageResources/SecurityLock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/ImageResources/SecurityLock.png -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/ImageResources/SymbolRefresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/ImageResources/SymbolRefresh.png -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/LivePackageTestsConsole/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Images/ExpanderBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/UIStyles/Resources/Images/ExpanderBackground.png -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Extensions/Microsoft.Dynamics.Sdk.Messages/Class1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Microsoft.Dynamics.Sdk.Messages 4 | { 5 | // EMPTY SHELL FOR THE MOMENT, USED TO CLONE INTERNAL MESSAGES FROM DYNAMICS 6 | } 7 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Doc/AppConfig_Settings_for_LoginControl.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/ConnectControl/Doc/AppConfig_Settings_for_LoginControl.docx -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/LiveTestsConsole/TestData/TestSolution_1_0_0_1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/UnitTests/LiveTestsConsole/TestData/TestSolution_1_0_0_1.zip -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TestMaterial/EnvVarsSample_1_0_0_2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TestMaterial/EnvVarsSample_1_0_0_2.zip -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TestMaterial/TestSolution_1_0_0_1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TestMaterial/TestSolution_1_0_0_1.zip -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Testers/LoginControlTester/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/nuspecs/Microsoft.PowerPlatform.Dataverse.ConnectControl.ReleaseNotes.txt: -------------------------------------------------------------------------------- 1 | Notice: 2 | This package is in a public preview release. 3 | This package is intended to work with .net full framework 4.6.2, 4.7.2 and 4.8 4 | 5 | ++CURRENTRELEASEID++ 6 | No Updates 7 | 8 | 1.0.1: 9 | Initial release 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TestMaterial/PowerPlatformIPManagement_1_0_0_6_managed.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TestMaterial/PowerPlatformIPManagement_1_0_0_6_managed.zip -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TestMaterial/PowerPlatformIPManagement_1_0_1_0_managed.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/PowerPlatform-DataverseServiceClient/HEAD/src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TestMaterial/PowerPlatformIPManagement_1_0_1_0_managed.zip -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.PowerPlatform.Dataverse.Client.ServiceClient": "Trace", 6 | "dvscClient.Program": "Trace" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/AzDevOps_ServiceConnection_Test/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "None", 5 | "AzDevOps_ServiceConnection_Test.Program": "None", 6 | "Microsoft.PowerPlatform.Dataverse.Client.ServiceClient": "Trace" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Grid/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Label/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Model/HomeRealmsStore.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Grid/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Label/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Testers/LoginControlTester/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Border/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell.psm1: -------------------------------------------------------------------------------- 1 | Push-Location $PSScriptRoot 2 | 3 | $PackageRoot = $PSScriptRoot 4 | 5 | $LoadingModule = $true 6 | 7 | dir *.ps1 | % Name | Resolve-Path | Import-Module 8 | 9 | $LoadingModule = $false 10 | 11 | Pop-Location 12 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Testers/LoginControlTester/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace LoginControlTester 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ListBox/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/RegisterForSession.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | This script will load in a PowerShell command shell and import the module developed in the project. To clean up, exit this shell. 3 | #> 4 | 5 | # Load the module. 6 | $env:PSModulePath = (Resolve-Path .).Path + ";" + $env:PSModulePath 7 | Import-Module 'Microsoft.PowerPlatform.Dataverse.Client.PowerShell' -Verbose 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Trace", 5 | "Microsoft.PowerPlatform.Dataverse.Client.ServiceClient": "Trace", 6 | "Client_Core_Tests.ClientTests": "Trace", 7 | "Client_Core_UnitTests.ClientDynamicsExtensionsTests": "Trace", 8 | "DataverseClient_Core_UnitTests.UtilsTests": "Trace" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/RegisterServiceClient.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | This script will load in a PowerShell command shell and import the module developed in the project. To clean up, exit this shell. 3 | #> 4 | 5 | # Load the module. 6 | $env:PSModulePath = (Resolve-Path .).Path + ";" + $env:PSModulePath 7 | Import-Module 'Microsoft.PowerPlatform.Dataverse.Client.PowerShell' -Verbose 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Border/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/RadioButton/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ListBox/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/RadioButton/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Messages.en-us.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1008 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.en-us.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1008 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Resources.hi-IN.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1008 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/IConnectionService.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Crm.Sdk.Messages; 2 | using Microsoft.Xrm.Sdk; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.PowerPlatform.Dataverse.Client 10 | { 11 | internal interface IConnectionService 12 | { 13 | // WhoAmIResponse GetWhoAmIDetails(IOrganizationService crmService, Guid trackingID = default(Guid)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/WebResourceUtility/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Extensions/SupportClasses/LogicalSortOrder.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.PowerPlatform.Dataverse.Client.Extensions 2 | { 3 | /// 4 | /// Logical Search Pram to apply to over all search. 5 | /// 6 | public enum LogicalSortOrder 7 | { 8 | /// 9 | /// Sort in Ascending 10 | /// 11 | Ascending = 0, 12 | /// 13 | /// Sort in Descending 14 | /// 15 | Descending = 1, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. 3 | // Project-level suppressions either have no target or are given 4 | // a specific target and scoped to a namespace, type, member, etc. 5 | // 6 | // To add a suppression to this file, right-click the message in the 7 | // Error List, point to "Suppress Message(s)", and click 8 | // "In Project Suppression File". 9 | // You do not need to add suppressions to this file manually. 10 | -------------------------------------------------------------------------------- /src/nuspecs/Microsoft.PowerPlatform.Dataverse.Client.AzAuth.ReleaseNotes.txt: -------------------------------------------------------------------------------- 1 | Notice: 2 | This package is an extension to the Microsoft.PowerPlatform.Dataverse.Client Nuget package. 3 | This package is intended to work with .net full framework 4.6.2, 4.7.2 and 4.8, and .net 6.0 4 | 5 | ++CURRENTRELEASEID++ 6 | Dependency changes: 7 | Azure.Identity updated to 1.31.1 8 | 9 | 1.1.10: 10 | Initial release 11 | Provides an extension to the Dataverse ServiceClient to support authenticating with the Azure.Core DefaultAzureCredential flow. 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/TreeView/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ToolBar/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Extensions/SupportClasses/LogicalSearchOperator.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Microsoft.PowerPlatform.Dataverse.Client.Extensions 3 | { 4 | /// 5 | /// Logical Search Pram to apply to over all search. 6 | /// 7 | public enum LogicalSearchOperator 8 | { 9 | /// 10 | /// Do not apply the Search Operator 11 | /// 12 | None = 0, 13 | /// 14 | /// Or Search 15 | /// 16 | Or = 1, 17 | /// 18 | /// And Search 19 | /// 20 | And = 2 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/NonParallelCollectionDefinition.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | 3 | namespace Client_Core_Tests 4 | { 5 | /// 6 | /// Associate tests with this collection to ensure they do not run in parallel with other test collections. 7 | /// e.g. if your test modifies Environment.CurrentDirectory, you MUST set your collection to not be run in parallel 8 | /// or you will cause other tests to potentially error out. 9 | /// 10 | [CollectionDefinition("NonParallelCollection", DisableParallelization = true)] 11 | public class NonParallelCollectionDefinition 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/nuspecs/Microsoft.PowerPlatform.Dataverse.ServiceClientConverter.ReleaseNotes.txt: -------------------------------------------------------------------------------- 1 | Notice: 2 | Provides Conversion utilities to convert between CrmServiceClient and Dataverse ServiceClient. 3 | General Documentation about DataverseServiceClient can be found here: 4 | https://github.com/microsoft/PowerPlatform-DataverseServiceClient 5 | General Documentation about CrmServiceClient can be found here: 6 | https://docs.microsoft.com/en-us/dotnet/api/microsoft.xrm.tooling.connector.crmserviceclient?view=dynamics-xrmtooling-ce-9 7 | 8 | ++CURRENTRELEASEID++ 9 | Provides Conversion utilities to convert between CrmServiceClient and Dataverse ServiceClient 10 | -------------------------------------------------------------------------------- /Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | $(DefineConstants);PROD_CUSTOMER_TELEMETRY 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Build.Common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | v4.6.2 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Builder/ServiceClientRequestBuilder.cs: -------------------------------------------------------------------------------- 1 | // Ignore Spelling: Dataverse 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.PowerPlatform.Dataverse.Client.Builder 10 | { 11 | /// 12 | /// Request builder class for submitting requests to Dataverse. 13 | /// 14 | public class ServiceClientRequestBuilder : AbstractClientRequestBuilder 15 | { 16 | internal ServiceClientRequestBuilder(IOrganizationServiceAsync2 client) 17 | : base(client) 18 | { } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/TreeView/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Build.Common.StandardAndLegacy.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 4 | 5 | 6 | 7 | net8.0;net48;net462 8 | netstandard2.0;net48;net462 9 | false 10 | 11 | 12 | 13 | IOperation 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Expander/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/Start-Debug.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | This script will run on debug. 3 | It will load in a PowerShell command shell and import the module developed in the project. To end debug, exit this shell. 4 | #> 5 | 6 | cd Drop 7 | 8 | # Write a reminder on how to end debugging. 9 | $message = "| Exit this shell to end the debug session! |" 10 | $line = "-" * $message.Length 11 | $color = "Cyan" 12 | Write-Host -ForegroundColor $color $line 13 | Write-Host -ForegroundColor $color $message 14 | Write-Host -ForegroundColor $color $line 15 | Write-Host 16 | 17 | invoke-expression -command ".\RegisterServiceClient.ps1" 18 | 19 | 20 | # Happy debugging :-) 21 | 22 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Extensions/Microsoft.Dynamics.Sdk.Messages/Microsoft.Dynamics.Sdk.Messages.Shell.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Microsoft.Dynamics.Sdk.Messages 4 | DataverseClient 5 | true 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Styles/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Textbox/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Textblock/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Auth/MSALHttpClient.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Identity.Client; 2 | using Microsoft.PowerPlatform.Dataverse.Client.Utils; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using System.Net.Http; 5 | 6 | namespace Microsoft.PowerPlatform.Dataverse.Client.Auth 7 | { 8 | internal class MSALHttpClientFactory : IMsalHttpClientFactory 9 | { 10 | /// 11 | /// Return the HTTP client for MSAL. 12 | /// 13 | /// 14 | public HttpClient GetHttpClient() 15 | { 16 | HttpClient msalClient = ClientServiceProviders.Instance.GetService().CreateClient("MSALClientFactory"); 17 | return msalClient; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ToolBar/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/ConnectonTests.playlist: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Textblock/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Build.Common.core.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | net462;net472;net48;netstandard2.0;net8.0 9 | false 10 | NU5104 11 | 12 | 13 | 14 | IOperation 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Checkbox/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Extensions/SupportClasses/DataverseFilterConditionItem.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Xrm.Sdk.Query; 2 | 3 | namespace Microsoft.PowerPlatform.Dataverse.Client.Extensions 4 | { 5 | 6 | /// 7 | /// Dataverse Filter item. 8 | /// 9 | public class DataverseFilterConditionItem 10 | { 11 | /// 12 | /// Dataverse Field name to Filter on 13 | /// 14 | public string FieldName { get; set; } 15 | /// 16 | /// Value to use for the Filter 17 | /// 18 | public object FieldValue { get; set; } 19 | /// 20 | /// Dataverse Operator to apply 21 | /// 22 | public ConditionOperator FieldOperator { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ScrollBar/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Grid/Styles.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Expander/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Styles/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/MoqHttpMessagehander.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Client_Core_UnitTests 9 | { 10 | public class MoqHttpMessagehander : HttpMessageHandler 11 | { 12 | public virtual HttpResponseMessage Send(HttpRequestMessage request) 13 | { 14 | throw new NotImplementedException("Now we can setup this method with our mocking framework"); 15 | } 16 | 17 | protected override Task SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) 18 | { 19 | lock (this) 20 | { 21 | return Task.FromResult(Send(request)); 22 | } 23 | 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Menu/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/WebResourceUtility/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyConfiguration("")] 9 | [assembly: AssemblyCompany("")] 10 | [assembly: AssemblyProduct("Microsoft.PowerPlatform.Dataverse.WebResourceUtility")] 11 | [assembly: AssemblyCopyright("© 2014 Microsoft. All rights reserved.")] 12 | [assembly: AssemblyTrademark("")] 13 | [assembly: AssemblyCulture("")] 14 | 15 | // The following GUID is for the ID of the typelib if this project is exposed to COM 16 | [assembly: Guid("48e0ecb1-2587-491f-b9ed-dbbac2139fc1")] 17 | [assembly: AssemblyVersion("4.0.0.0")] 18 | [assembly: AssemblyFileVersion("4.0.0.0")] 19 | 20 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/SkippableConnectionTestAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Crm.Sdk.Messages; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Xunit; 8 | 9 | namespace Client_Core_UnitTests 10 | { 11 | public class SkippableConnectionTestAttribute : FactAttribute 12 | { 13 | private static bool IsConnectionInfoAvailable() => Environment.GetEnvironmentVariable("XUNITCONNTESTURI") != null; 14 | 15 | public SkippableConnectionTestAttribute() 16 | { 17 | if (!IsConnectionInfoAvailable()) 18 | { 19 | Skip = "Ignored test as connection info is not present"; 20 | } 21 | } 22 | 23 | public SkippableConnectionTestAttribute(bool skip, string skipMessage) 24 | { 25 | Skip = skipMessage; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Extensions/SupportClasses/FormTypeId.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.PowerPlatform.Dataverse.Client.Extensions 2 | { 3 | /// 4 | /// Used with GetFormIdsForEntity Call 5 | /// 6 | public enum FormTypeId 7 | { 8 | /// 9 | /// Dashboard form 10 | /// 11 | Dashboard = 0, 12 | /// 13 | /// Appointment book, for service requests. 14 | /// 15 | AppointmentBook = 1, 16 | /// 17 | /// Main or default form 18 | /// 19 | Main = 2, 20 | //MiniCampaignBo = 3, // Not used in 2011 21 | //Preview = 4, // Not used in 2011 22 | /// 23 | /// Mobile default form 24 | /// 25 | Mobile = 5, 26 | /// 27 | /// User defined forms 28 | /// 29 | Other = 100 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Border/Styles.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Extensions/SupportClasses/DataverseSearchFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Xrm.Sdk.Query; 3 | using System.Collections.Generic; 4 | 5 | namespace Microsoft.PowerPlatform.Dataverse.Client.Extensions 6 | { 7 | /// 8 | /// Dataverse Filter class. 9 | /// 10 | public class DataverseSearchFilter 11 | { 12 | /// 13 | /// List of Dataverse Filter conditions 14 | /// 15 | public List SearchConditions { get; set; } 16 | /// 17 | /// Dataverse Filter Operator 18 | /// 19 | public LogicalOperator FilterOperator { get; set; } 20 | 21 | /// 22 | /// Creates an empty Dataverse Search Filter. 23 | /// 24 | public DataverseSearchFilter() 25 | { 26 | SearchConditions = new List(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Checkbox/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Textbox/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ScrollBar/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/UnitTestBehaviors/BCrmWebSvc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Microsoft.Xrm.Tooling.Connector.Moles; 6 | using Microsoft.Xrm.Sdk.Messages.Moles; 7 | using Microsoft.Crm.Sdk.Messages.Moles; 8 | using Microsoft.Xrm.Sdk; 9 | using Microsoft.Crm.Sdk.Messages; 10 | using Microsoft.Xrm.Sdk.Messages; 11 | using Microsoft.Xrm.Sdk.Moles; 12 | using Microsoft.Xrm.Sdk.Client; 13 | 14 | namespace Microsoft.Xrm.Tooling.Connector.Behaviors 15 | { 16 | public static class BCrmWebSvc 17 | { 18 | public static void MockCrmSvc(OrganizationServiceProxy proxy) 19 | { 20 | MCrmWebSvc.AllInstances.CrmSvcGet = (obj) => proxy; 21 | } 22 | public static void MockDoLogin() 23 | { 24 | MCrmWebSvc.AllInstances.DoLogin = (obj) => { return true; }; 25 | } 26 | public static void MockOrganizationVersion() 27 | { 28 | MCrmWebSvc.AllInstances.OrganizationVersionGet = (objWebsvc) => { return new Version("5.0.9690.3000"); }; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Extensions/SupportClasses/PickListItem.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.PowerPlatform.Dataverse.Client.Extensions 2 | { 3 | /// 4 | /// PickList Item 5 | /// 6 | public sealed class PickListItem 7 | { 8 | /// 9 | /// Display label for the PickList Item 10 | /// 11 | public string DisplayLabel { get; set; } 12 | /// 13 | /// ID of the picklist item 14 | /// 15 | public int PickListItemId { get; set; } 16 | 17 | /// 18 | /// Default Constructor 19 | /// 20 | public PickListItem() 21 | { 22 | } 23 | 24 | /// 25 | /// Constructor with data. 26 | /// 27 | /// 28 | /// 29 | public PickListItem(string label, int id) 30 | { 31 | DisplayLabel = label; 32 | PickListItemId = id; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/TraceConsoleSupport.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Xunit.Abstractions; 8 | 9 | namespace Client_Core_UnitTests 10 | { 11 | public class TraceConsoleSupport : TraceListener 12 | { 13 | private readonly ITestOutputHelper outWriter; 14 | public TraceConsoleSupport(ITestOutputHelper output) 15 | { 16 | outWriter = output; 17 | } 18 | 19 | public override void Write(string message) 20 | { 21 | } 22 | 23 | public override void WriteLine(string message) 24 | { 25 | try 26 | { 27 | outWriter.WriteLine(message); 28 | } 29 | catch (System.InvalidOperationException) 30 | { 31 | // Do nothing here.. this can happen if the test does not reset the appdomain and is restarted. 32 | } 33 | 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Extensions/Microsoft.PowerPlatform.Dataverse.Client.AzAuth/Microsoft.PowerPlatform.Dataverse.Client.AzAuth.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Microsoft.PowerPlatform.Dataverse.Client.AzAuth 5 | DataverseClient 6 | true 7 | true 8 | 8.0 9 | 10 | 11 | 12 | 13 | false 14 | $(OutDir)\Microsoft.PowerPlatform.Dataverse.Client.AzAuth.xml 15 | 6.0 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Extensions/Microsoft.PowerPlatform.Dataverse.ServiceClientConverter/Microsoft.PowerPlatform.Dataverse.ServiceClientConverter.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Microsoft.PowerPlatform.Dataverse.ServiceClientConverter 5 | DataverseClientConverter 6 | true 7 | 8 | 9 | 10 | 11 | net462;net472;net48 12 | false 13 | $(OutDir)\Microsoft.PowerPlatform.Dataverse.ServiceClientConverter.xml 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Auth/TokenCache/MemoryTokenCacheOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.Client.Auth.TokenCache 8 | { 9 | internal class MemoryTokenCacheOptions 10 | { 11 | /// By default, the sliding expiration is set for 14 days 12 | public MemoryTokenCacheOptions() 13 | { 14 | AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(14); 15 | } 16 | 17 | /// 18 | /// Gets or sets the value of the duration after which the cache entry will expire unless it's used 19 | /// This is the duration the tokens are kept in memory cache. 20 | /// In production, a higher value, up-to 90 days is recommended. 21 | /// 22 | /// 23 | /// The AbsoluteExpirationRelativeToNow value. 24 | /// 25 | public TimeSpan AbsoluteExpirationRelativeToNow 26 | { 27 | get; 28 | set; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/UnitTests/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Cake. 4 | // 5 | //------------------------------------------------------------------------------ 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | using System; 9 | 10 | [assembly: AssemblyTitle("Microsoft Dataverse Application API Wrapper")] 11 | [assembly: AssemblyDescription("Microsoft Dataverse API helper library. Provides authentication support, telemetry and helpers to work with Dataverse API's")] 12 | [assembly: AssemblyCompany("Microsoft")] 13 | [assembly: AssemblyProduct("Microsoft Dataverse")] 14 | [assembly: AssemblyVersion("0.0.4.0")] 15 | [assembly: AssemblyFileVersion("0.0.4.1")] 16 | [assembly: AssemblyInformationalVersion("0.0.4.1+gc05b057")] 17 | [assembly: AssemblyCopyright("© 2021 Microsoft Corporation. All rights reserved")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyConfiguration("")] 20 | [assembly: ComVisible(false)] 21 | [assembly: CLSCompliant(false)] 22 | 23 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/UnitTestBehaviors/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Cake. 4 | // 5 | //------------------------------------------------------------------------------ 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | using System; 9 | 10 | [assembly: AssemblyTitle("Microsoft Dataverse Application API Wrapper")] 11 | [assembly: AssemblyDescription("Microsoft Dataverse API helper library. Provides authentication support, telemetry and helpers to work with Dataverse API's")] 12 | [assembly: AssemblyCompany("Microsoft")] 13 | [assembly: AssemblyProduct("Microsoft Dataverse")] 14 | [assembly: AssemblyVersion("0.0.4.0")] 15 | [assembly: AssemblyFileVersion("0.0.4.1")] 16 | [assembly: AssemblyInformationalVersion("0.0.4.1+gc05b057")] 17 | [assembly: AssemblyCopyright("© 2021 Microsoft Corporation. All rights reserved")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyConfiguration("")] 20 | [assembly: ComVisible(false)] 21 | [assembly: CLSCompliant(false)] 22 | 23 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/LiveTestsConsole/LiveTestsConsole.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | Exe 6 | net462;net8.0 7 | true 8 | DataverseClient-Tests 9 | false 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | PreserveNewest 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 7 | 8 | 9 | 10 | 11 | 12 | <_parentAreaFolderName>$([System.IO.Path]::GetFileName( $([System.IO.Path]::GetFullPath( $([System.IO.Path]::Combine($(MSBuildProjectDirectory), "..")) )) )) 13 | 14 | $(RepoRoot)\obj\$(_parentAreaFolderName)\$(MSBuildProjectName)\ 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Extensions/DynamicsExtension/Microsoft.PowerPlatform.Dataverse.Client.Dynamics.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Microsoft.PowerPlatform.Dataverse.Client.Dynamics 5 | DataverseClient 6 | true 7 | 8 | 9 | 10 | 11 | false 12 | $(OutDir)\Microsoft.PowerPlatform.Dataverse.Client.Dynamics.xml 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Combobox/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.PowerPlatform.Dataverse.Client.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Menu/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Testers/LoginControlTester/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace LoginControlTester.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Window/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/InternalExtensions/SecureStringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Security; 4 | 5 | namespace Microsoft.PowerPlatform.Dataverse.Client.InternalExtensions 6 | { 7 | /// 8 | /// Adds a extension to Secure string 9 | /// 10 | internal static class SecureStringExtensions 11 | { 12 | /// 13 | /// DeCrypt a Secure password 14 | /// 15 | /// 16 | /// 17 | public static string ToUnsecureString(this SecureString value) 18 | { 19 | if (null == value) 20 | throw new ArgumentNullException("value"); 21 | 22 | // Get a pointer to the secure string memory data. 23 | IntPtr ptr = Marshal.SecureStringToGlobalAllocUnicode(value); 24 | try 25 | { 26 | // DeCrypt 27 | return Marshal.PtrToStringUni(ptr); 28 | } 29 | finally 30 | { 31 | // release the pointer. 32 | Marshal.ZeroFreeGlobalAllocUnicode(ptr); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.PowerPlatform.Dataverse.Ui.Styles.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Microsoft.PowerPlatform.Dataverse.ConnectControl.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/InternalExtensions/SecureStringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Security; 4 | 5 | namespace Microsoft.PowerPlatform.Dataverse.ConnectControl.InternalExtensions 6 | { 7 | /// 8 | /// Adds a extension to Secure string 9 | /// 10 | internal static class SecureStringExtensions 11 | { 12 | /// 13 | /// DeCrypt a Secure password 14 | /// 15 | /// 16 | /// 17 | public static string ToUnsecureString(this SecureString value) 18 | { 19 | if (null == value) 20 | throw new ArgumentNullException("value"); 21 | 22 | // Get a pointer to the secure string memory data. 23 | IntPtr ptr = Marshal.SecureStringToGlobalAllocUnicode(value); 24 | try 25 | { 26 | // DeCrypt 27 | return Marshal.PtrToStringUni(ptr); 28 | } 29 | finally 30 | { 31 | // release the pointer. 32 | Marshal.ZeroFreeGlobalAllocUnicode(ptr); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/LiveTestsConsole/TokenRefresh.cs: -------------------------------------------------------------------------------- 1 | using FluentAssertions; 2 | using Microsoft.Crm.Sdk.Messages; 3 | using Microsoft.PowerPlatform.Dataverse.Client; 4 | using Microsoft.PowerPlatform.Dataverse.Client.Auth; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading; 10 | using System.Threading.Tasks; 11 | 12 | namespace LiveTestsConsole 13 | { 14 | public class TokenRefresh 15 | { 16 | 17 | internal void Run() 18 | { 19 | Console.WriteLine("Starting TokenRefresh"); 20 | 21 | var client = Auth.CreateClient(); 22 | client.IsReady.Should().BeTrue(); 23 | 24 | Console.WriteLine("Calling WhoAmI"); 25 | var response1 = client.Execute(new WhoAmIRequest()) as WhoAmIResponse; 26 | response1.Should().NotBeNull(); 27 | 28 | Console.WriteLine("Going to sleep for 26 hours until token expires"); 29 | Thread.Sleep(1000 * 60 * 60 * 26); 30 | 31 | Console.WriteLine("Calling WhoAmI after long sleep"); 32 | var response2 = client.Execute(new WhoAmIRequest()) as WhoAmIResponse; 33 | response2.Should().NotBeNull(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/TraceSourceSetting.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | 4 | namespace Microsoft.PowerPlatform.Dataverse.Client 5 | { 6 | /// 7 | /// Parameter for delegate - RegisterdTraceListeners in TraceControlSettingsBase class 8 | /// 9 | public class TraceSourceSetting 10 | { 11 | /// 12 | /// Source name of trace listner 13 | /// 14 | public string SourceName { get; set; } 15 | 16 | /// 17 | /// Override Trace Level setting 18 | /// 19 | public SourceLevels TraceLevel { get; set; } 20 | 21 | /// 22 | /// List of trace listners 23 | /// 24 | public Dictionary TraceListeners { get; set; } 25 | 26 | /// 27 | /// Constructor 28 | /// 29 | private TraceSourceSetting() 30 | { 31 | TraceListeners = new Dictionary(); 32 | } 33 | 34 | /// 35 | /// Constructor 36 | /// 37 | public TraceSourceSetting(string sourceName, SourceLevels sourceLevels) 38 | { 39 | TraceListeners = new Dictionary(); 40 | this.SourceName = sourceName; 41 | this.TraceLevel = sourceLevels; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Microsoft.PowerPlatform.Dataverse.ConnectControl")] 13 | [assembly: AssemblyCopyright("© 2014 Microsoft. All rights reserved.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | [assembly: ThemeInfo( 18 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 19 | //(used if a resource is not found in the page, 20 | // or application resource dictionaries) 21 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 22 | //(used if a resource is not found in the page, 23 | // app, or any theme specific resource dictionaries) 24 | )] 25 | [assembly: AssemblyVersion("4.0.0.0")] 26 | [assembly: AssemblyFileVersion("4.0.0.0")] 27 | 28 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Auth/TokenCache/MemoryCacheSerializerHints.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | // Adapted from Microsoft.Identity.Web/TokenCacheProviders/CacheSerializerHints.cs for general use. 9 | // https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/TokenCacheProviders/CacheSerializerHints.cs 10 | 11 | namespace Microsoft.PowerPlatform.Dataverse.Client.Auth.TokenCache 12 | { 13 | /// 14 | /// Set of properties that the token cache serialization implementations might use to optimize the cache. 15 | /// 16 | internal class MemoryCacheSerializerHints 17 | { 18 | /// 19 | /// CancellationToken enabling cooperative cancellation between threads, thread pool, or Task objects. 20 | /// 21 | public CancellationToken CancellationToken { get; set; } 22 | 23 | /// 24 | /// Suggested cache expiry based on the in-coming token. Use to optimize cache eviction 25 | /// with the app token cache. 26 | /// 27 | public DateTimeOffset? SuggestedCacheExpiry { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | // Use IntelliSense to find out which attributes exist for C# debugging 6 | // Use hover for the description of the existing attributes 7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/src/GeneralTools/DataverseClient/UnitTests/LivePackageTestsConsole/bin/Debug/netcoreapp3.1/LivePackageTestsConsole.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}/src/GeneralTools/DataverseClient/UnitTests/LivePackageTestsConsole", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/UnitTests/DeviceCredentialsTest.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Xrm.Tooling.Connector.UnitTests 2 | { 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | using System.ServiceModel.Description; 5 | using System.Runtime.Serialization; 6 | 7 | [TestClass] 8 | public class DeviceIdManagerTest 9 | { 10 | [TestMethod] 11 | public void LoadOrRegisterDeviceTest() 12 | { 13 | ClientCredentials clientCredentials = DeviceIdManager.LoadOrRegisterDevice(); 14 | Assert.IsNotNull(clientCredentials); 15 | } 16 | 17 | [TestMethod] 18 | public void LoadOrRegisterDeviceWithNameAndPasswordTest() 19 | { 20 | ClientCredentials clientCredentials = DeviceIdManager.LoadOrRegisterDevice("deviceName", "devicePasssword"); 21 | Assert.IsNotNull(clientCredentials); 22 | } 23 | 24 | [TestMethod] 25 | public void LoadDeviceCredentialsTest() 26 | { 27 | ClientCredentials clientCredentials = DeviceIdManager.LoadDeviceCredentials(); 28 | Assert.IsNotNull(clientCredentials); 29 | } 30 | [TestMethod] 31 | public void ToClientCredentialsTest() 32 | { 33 | DeviceUserName deviceUserName = new DeviceUserName(); 34 | ClientCredentials clientCredentials=deviceUserName.ToClientCredentials(); 35 | Assert.IsNotNull(clientCredentials); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/AdvancedOptions.xaml.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Documents; 12 | using System.Windows.Input; 13 | using System.Windows.Media; 14 | using System.Windows.Media.Imaging; 15 | using System.Windows.Navigation; 16 | using System.Windows.Shapes; 17 | #endregion 18 | 19 | namespace Microsoft.PowerPlatform.Dataverse.ConnectControl 20 | { 21 | /// 22 | /// Interaction logic for AdvancedOptions.xaml 23 | /// 24 | public partial class AdvancedOptions : UserControl 25 | { 26 | /// 27 | /// Constructor 28 | /// 29 | public AdvancedOptions() 30 | { 31 | InitializeComponent(); 32 | if (!DesignerProperties.GetIsInDesignMode(new DependencyObject())) 33 | { 34 | } 35 | } 36 | 37 | /// 38 | /// If true domain name textbox is visible 39 | /// 40 | public bool DomainVisible { get; set; } = false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Label/Styles.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 13 | 16 | 19 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Button/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Extensions/Microsoft.PowerPlatform.Dataverse.ServiceClientConverter/Microsoft.PowerPlatform.Dataverse.ServiceClientConverter.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.11.35327.3 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerPlatform.Dataverse.ServiceClientConverter", "Microsoft.PowerPlatform.Dataverse.ServiceClientConverter.csproj", "{1222F666-B1B9-4219-9EA9-EDCCEFDB7687}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {1222F666-B1B9-4219-9EA9-EDCCEFDB7687}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {1222F666-B1B9-4219-9EA9-EDCCEFDB7687}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {1222F666-B1B9-4219-9EA9-EDCCEFDB7687}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {1222F666-B1B9-4219-9EA9-EDCCEFDB7687}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {6944BCB7-36A1-45BC-AA26-489DC42D4EDA} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Model/DiscoverOrganizationsResult.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using Microsoft.Identity.Client; 3 | using Microsoft.Xrm.Sdk.Discovery; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | #endregion 10 | 11 | namespace Microsoft.PowerPlatform.Dataverse.Client.Model 12 | { 13 | /// 14 | /// Result of call to DiscoverOrganizationsAsync 15 | /// 16 | public class DiscoverOrganizationsResult 17 | { 18 | /// 19 | /// Constructor 20 | /// 21 | /// OrganizationDetailCollection 22 | /// account 23 | public DiscoverOrganizationsResult(OrganizationDetailCollection organizationDetailCollection, IAccount account) 24 | { 25 | OrganizationDetailCollection = organizationDetailCollection; 26 | Account = account; 27 | } 28 | 29 | /// 30 | /// OrganizationDetailCollection 31 | /// 32 | public OrganizationDetailCollection OrganizationDetailCollection { get; private set; } 33 | 34 | /// 35 | /// MSAL account selected as part of dicovery authentication 36 | /// 37 | public IAccount Account { get; private set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/LivePackageRunUnitTests/LivePackageRunUnitTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | false 7 | net462;net472;net48;net8.0 8 | true 9 | DataverseClient-Tests-Package 10 | false 11 | NU1605 12 | 13 | 14 | $(MSBuildThisFileDirectory)..\.packages 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Combobox/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/WebResourceUtility/WebResourceTypes.cs: -------------------------------------------------------------------------------- 1 | //=================================================================================== 2 | // Microsoft – subject to the terms of the Microsoft EULA and other agreements 3 | // Microsoft.PowerPlatform.Dataverse.WebResourceUtility 4 | // copyright 2003-2012 Microsoft Corp. 5 | // 6 | // Defines the WebResource Types 7 | // 8 | //=================================================================================== 9 | 10 | namespace Microsoft.PowerPlatform.Dataverse.WebResourceUtility 11 | { 12 | using System; 13 | 14 | /// 15 | /// Format of the WebResource 16 | /// 17 | public enum WebResourceWebResourceType 18 | { 19 | /// 20 | /// Html type 21 | /// 22 | Webpage_HTML = 1, 23 | /// 24 | /// CSS 25 | /// 26 | StyleSheet_CSS = 2, 27 | /// 28 | /// JScript 29 | /// 30 | Script_JScript = 3, 31 | /// 32 | /// XML 33 | /// 34 | Data_XML = 4, 35 | /// 36 | /// PNG 37 | /// 38 | PNGformat = 5, 39 | /// 40 | /// JPG 41 | /// 42 | JPGformat = 6, 43 | /// 44 | /// GIF 45 | /// 46 | GIFformat = 7, 47 | /// 48 | /// XAP 49 | /// 50 | Silverlight_XAP = 8, 51 | /// 52 | /// XSL 53 | /// 54 | StyleSheet_XSL = 9, 55 | /// 56 | /// ICO 57 | /// 58 | ICOformat = 10, 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Window/WindowResourceDictionary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Windows; 4 | 5 | namespace Microsoft.PowerPlatform.Dataverse.Ui.Styles 6 | { 7 | /// 8 | /// WindowResourceDictionary 9 | /// 10 | public partial class WindowResourceDictionary : ResourceDictionary 11 | { 12 | /// 13 | /// Mouse down event handler for the window top bar 14 | /// 15 | /// 16 | /// 17 | private void WindowTopBar_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) 18 | { 19 | try 20 | { 21 | Window activeWindow = this.GetCurrentActiveWindow(); 22 | if (activeWindow != null) 23 | { 24 | if (activeWindow.ResizeMode == ResizeMode.CanResize && e.ClickCount == 2) 25 | { 26 | activeWindow.WindowState = activeWindow.WindowState == WindowState.Normal ? WindowState.Maximized : WindowState.Normal; 27 | } 28 | else 29 | { 30 | activeWindow.DragMove(); 31 | } 32 | } 33 | } 34 | catch(Exception){} 35 | } 36 | 37 | /// 38 | /// This method can be used to get the handle to the currently active window 39 | /// 40 | /// Currently active window. 41 | private Window GetCurrentActiveWindow() 42 | { 43 | var activeWindow = Application.Current.Windows.OfType().Where(win => win.IsActive); 44 | return activeWindow.FirstOrDefault(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/UtilityFunctions.psm1: -------------------------------------------------------------------------------- 1 | function Coalesce { 2 | foreach ($i in $args) { 3 | if ($i -ne $null) { 4 | return $i 5 | } 6 | } 7 | } 8 | 9 | function LastConnectorException { 10 | [CmdletBinding()] 11 | PARAM( 12 | [parameter(Mandatory = $true)] 13 | [Microsoft.PowerPlatform.Dataverse.Client.ServiceClient]$conn 14 | ) 15 | 16 | return (Coalesce $conn.LastError $conn.LastException) 17 | } 18 | 19 | function VerifyConnectionParam { 20 | [CmdletBinding()] 21 | PARAM( 22 | [parameter(Mandatory=$false)] 23 | [Microsoft.PowerPlatform.Dataverse.Client.ServiceClient]$conn, 24 | [parameter(Mandatory=$false)] 25 | [bool]$pipelineValue 26 | ) 27 | #we have a $conn value and we were not given a $conn value so we should try to find one 28 | if($conn -eq $null -and $pipelineValue -eq $false) 29 | { 30 | $connobj = Get-Variable conn -Scope global -ErrorAction SilentlyContinue 31 | if($connobj.Value -eq $null) 32 | { 33 | throw 'A connection to Dataverse is required, use Get-PowerPlatformConnection or one of the other connection functions to connect.' 34 | } 35 | else 36 | { 37 | $conn = $connobj.Value 38 | } 39 | }elseif($conn -eq $null -and $pipelineValue -eq $true){ 40 | throw "Connection object provided is null" 41 | } 42 | return $conn 43 | } -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Exceptions/HttpOperationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.Serialization; 4 | using Microsoft.PowerPlatform.Dataverse.Client.HttpUtils; 5 | 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.Client.Exceptions 8 | { 9 | /// 10 | /// Http Exception wrapper class 11 | /// 12 | public class HttpOperationException : Exception 13 | { 14 | /// 15 | /// 16 | /// 17 | public HttpOperationException() 18 | { 19 | } 20 | 21 | /// 22 | /// 23 | /// 24 | /// 25 | public HttpOperationException(string message) : this(message, null) 26 | { 27 | } 28 | 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// 34 | public HttpOperationException(string message, Exception innerException) : base(message, innerException) 35 | { 36 | } 37 | 38 | // Properties 39 | /// 40 | /// 41 | /// 42 | public object Body { get; set; } 43 | 44 | /// 45 | /// 46 | /// 47 | public HttpRequestMessageWrapper Request { get; set; } 48 | 49 | /// 50 | /// 51 | /// 52 | public HttpResponseMessageWrapper Response { get; set; } 53 | 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/src/GeneralTools/DataverseClient/UnitTests/LivePackageTestsConsole/LivePackageTestsConsole.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/src/GeneralTools/DataverseClient/UnitTests/LivePackageTestsConsole/LivePackageTestsConsole.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/src/GeneralTools/DataverseClient/UnitTests/LivePackageTestsConsole/LivePackageTestsConsole.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Window/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Auth/ExecuteAuthenticationResults.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Identity.Client; 2 | using Microsoft.PowerPlatform.Dataverse.Client.Auth.TokenCache; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.PowerPlatform.Dataverse.Client.Auth 10 | { 11 | /// 12 | /// Class used to describe the outcome of the execute authentication process. 13 | /// 14 | internal class ExecuteAuthenticationResults 15 | { 16 | public AuthenticationResult MsalAuthResult { get; set; } 17 | public Uri TargetServiceUrl { get; set; } 18 | public object MsalAuthClient { get; set; } 19 | public string Authority { get; set; } 20 | public string Resource { get; set; } 21 | public IAccount UserIdent { get; set; } 22 | public MemoryBackedTokenCache MemTokenCache { get; set; } 23 | 24 | 25 | internal string GetAuthTokenAndProperties(out AuthenticationResult msalAuthResult, out Uri targetServiceUrl, out object msalAuthClient, out string authority, out string resource, out IAccount userIdent, out MemoryBackedTokenCache memoryBackedTokenCache) 26 | { 27 | msalAuthResult = MsalAuthResult; 28 | targetServiceUrl = TargetServiceUrl; 29 | msalAuthClient = MsalAuthClient; 30 | authority = Authority; 31 | resource = Resource; 32 | userIdent = UserIdent; 33 | memoryBackedTokenCache = MemTokenCache; 34 | 35 | return MsalAuthResult.AccessToken; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/PackageDeployerLayout/Styles.xaml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 9 | 10 | 13 | 14 | 20 | 26 | 29 | 32 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/AzDevOps_ServiceConnection_Test/AzDevOps_ServiceConnection_Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | Exe 6 | net462;net8.0 7 | false 8 | DataverseClient-Tests 9 | false 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/LiveTestsConsole/Auth.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.PowerPlatform.Dataverse.Client; 2 | using Microsoft.PowerPlatform.Dataverse.Client.Auth; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace LiveTestsConsole 10 | { 11 | public class Auth 12 | { 13 | /// 14 | /// Sample / stand-in appID used when replacing O365 Auth 15 | /// 16 | internal static string SampleClientId = "51f81489-12ee-4a9e-aaae-a2591f45987d"; 17 | /// 18 | /// Sample / stand-in redirect URI used when replacing o365 Auth 19 | /// 20 | internal static string SampleRedirectUrl = "app://58145B91-0C36-4500-8554-080854F2AC97"; 21 | 22 | public static ServiceClient CreateClient() 23 | { 24 | var userName = Environment.GetEnvironmentVariable("XUNITCONNTESTUSERID"); 25 | var password = Environment.GetEnvironmentVariable("XUNITCONNTESTPW"); 26 | var connectionUrl = Environment.GetEnvironmentVariable("XUNITCONNTESTURI"); 27 | if (string.IsNullOrWhiteSpace(userName) || string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(connectionUrl)) 28 | { 29 | throw new ArgumentNullException("Make sure to set XUNITCONNTESTUSERID, XUNITCONNTESTPW, XUNITCONNTESTURI environment variables"); 30 | } 31 | 32 | return new ServiceClient(userName, ServiceClient.MakeSecureString(password), new Uri(connectionUrl), true, SampleClientId, new Uri(SampleRedirectUrl), PromptBehavior.Never); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/CdsClient_Core_Tests/UtilsTests.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using FluentAssertions; 3 | using Microsoft.Crm.Sdk.Messages; 4 | using Microsoft.PowerPlatform.Dataverse.Client; 5 | using Microsoft.PowerPlatform.Dataverse.Client.InternalExtensions; 6 | using Microsoft.PowerPlatform.Dataverse.Client.Utils; 7 | using Microsoft.Xrm.Sdk; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Text; 12 | using System.Text.Json; 13 | using System.Threading.Tasks; 14 | using Xunit; 15 | #endregion 16 | 17 | namespace DataverseClient_Core_UnitTests 18 | { 19 | public class UtilsTests 20 | { 21 | [Fact] 22 | public void SerializationTest() 23 | { 24 | var request = new ExportSolutionRequest() { SolutionName = "SerializationTest" }; 25 | var expandoObject = request.ToExpandoObject(); 26 | var json = System.Text.Json.JsonSerializer.Serialize(expandoObject); 27 | 28 | json.Should().Contain("\"SolutionName\":\"SerializationTest\""); 29 | json.Should().Contain("\"Managed\":false"); 30 | } 31 | 32 | [Fact] 33 | public void ParseAltKeyCollection_WithNulls_Test() 34 | { 35 | var keyValuePairs = new KeyAttributeCollection 36 | { 37 | { "NotNull", "TestValue" }, 38 | { "NullValue", null } 39 | }; 40 | 41 | var result = Utilities.ParseAltKeyCollection(keyValuePairs); 42 | 43 | result.Should().NotBeNullOrWhiteSpace(); 44 | result.Should().Contain("NotNull='TestValue'"); 45 | result.Should().Contain("NullValue=''"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Extensions/Microsoft.PowerPlatform.Dataverse.ServiceClientConverter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Microsoft.PowerPlatform.Dataverse.ServiceClientConverter")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Microsoft.PowerPlatform.Dataverse.ServiceClientConverter")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("752e5268-3d99-485d-a31e-fc40ae9c0867")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/Button/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/TraceSourceSettingStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | 6 | namespace Microsoft.PowerPlatform.Dataverse.Client 7 | { 8 | /// 9 | /// Trace setting store 10 | /// 11 | public class TraceSourceSettingStore 12 | { 13 | /// 14 | /// Source name of trace listner 15 | /// 16 | public static List TraceSourceSettingsCollection { get; private set; } 17 | 18 | static TraceSourceSettingStore() 19 | { 20 | TraceSourceSettingsCollection = new List(); 21 | } 22 | 23 | /// 24 | /// 25 | /// 26 | public static void AddTraceSettingsToStore(TraceSourceSetting listnerSettings) 27 | { 28 | Trace.AutoFlush = true; 29 | if (listnerSettings != null) 30 | { 31 | var settings = TraceSourceSettingsCollection.SingleOrDefault(x => String.Compare(x.SourceName, listnerSettings.SourceName, StringComparison.OrdinalIgnoreCase) == 0); 32 | if (settings != null) TraceSourceSettingsCollection.Remove(settings); 33 | TraceSourceSettingsCollection.Add(listnerSettings); 34 | } 35 | } 36 | 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | public static TraceSourceSetting GetTraceSourceSettings(string sourceName) 43 | { 44 | TraceSourceSetting settings = null; 45 | if (!string.IsNullOrEmpty(sourceName)) 46 | { 47 | settings = TraceSourceSettingsCollection 48 | .SingleOrDefault(x => String.Compare(x.SourceName, sourceName, StringComparison.OrdinalIgnoreCase) == 0); 49 | } 50 | return settings; 51 | } 52 | 53 | } 54 | } -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/WebResourceUtility/Microsoft.PowerPlatform.Dataverse.WebResourceUtility.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | DataverseClient 4 | Properties 5 | Microsoft.PowerPlatform.Dataverse.WebResourceUtility 6 | Microsoft.PowerPlatform.Dataverse.WebResourceUtility 7 | true 8 | win 9 | 10 | 11 | 12 | $(DotNetClassicTargetFrameworks) 13 | $(OutDir)\Microsoft.PowerPlatform.Dataverse.WebResourceUtility.xml 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ListView/BrushResourcesNormalMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Extensions/SupportClasses/PickListMetaElement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.Client.Extensions 8 | { 9 | /// 10 | /// PickList data 11 | /// 12 | public sealed class PickListMetaElement 13 | { 14 | /// 15 | /// Current value of the PickList Item 16 | /// 17 | public string ActualValue { get; set; } 18 | /// 19 | /// Displayed Label 20 | /// 21 | public string PickListLabel { get; set; } 22 | /// 23 | /// Displayed value for the PickList 24 | /// 25 | public string DisplayValue { get; set; } 26 | /// 27 | /// Array of Potential Pick List Items. 28 | /// 29 | public List Items { get; set; } 30 | 31 | /// 32 | /// Default Constructor 33 | /// 34 | public PickListMetaElement() 35 | { 36 | Items = new List(); 37 | } 38 | 39 | /// 40 | /// Constructs a PickList item with data. 41 | /// 42 | /// 43 | /// 44 | /// 45 | public PickListMetaElement(string actualValue, string displayValue, string pickListLabel) 46 | { 47 | Items = new List(); 48 | ActualValue = actualValue; 49 | PickListLabel = pickListLabel; 50 | DisplayValue = displayValue; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/DataverseClient_PackageTestSolution.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31729.503 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LivePackageTestsConsole", "UnitTests\LivePackageTestsConsole\LivePackageTestsConsole.csproj", "{AD21CFD4-EDA7-4F31-9A07-CC90C03B4C27}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LivePackageRunUnitTests", "UnitTests\LivePackageRunUnitTests\LivePackageRunUnitTests.csproj", "{F90838B9-F2D2-499B-8C37-4F8389380743}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {AD21CFD4-EDA7-4F31-9A07-CC90C03B4C27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {AD21CFD4-EDA7-4F31-9A07-CC90C03B4C27}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {AD21CFD4-EDA7-4F31-9A07-CC90C03B4C27}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {AD21CFD4-EDA7-4F31-9A07-CC90C03B4C27}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {F90838B9-F2D2-499B-8C37-4F8389380743}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {F90838B9-F2D2-499B-8C37-4F8389380743}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {F90838B9-F2D2-499B-8C37-4F8389380743}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {F90838B9-F2D2-499B-8C37-4F8389380743}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {BDA12603-BF5F-4103-81BE-24703407A609} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/TraceListenerBroker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Microsoft.PowerPlatform.Dataverse.Client 9 | { 10 | /// 11 | /// Refresh listener delegate 12 | /// 13 | /// 14 | public delegate void RefreshListenerDelegate(List listenerCollection); 15 | 16 | /// 17 | /// Trace listener broker class 18 | /// 19 | public sealed class TraceListenerBroker 20 | { 21 | private static event RefreshListenerDelegate refreshListenerObject = null ; 22 | private static object logLock = new object(); 23 | 24 | /// 25 | /// Method to register trace logger 26 | /// 27 | /// 28 | public static void RegisterTraceLogger(TraceLoggerBase traceLogger) 29 | { 30 | lock (logLock) 31 | { 32 | refreshListenerObject += new RefreshListenerDelegate(traceLogger.RefreshListeners); 33 | } 34 | } 35 | 36 | /// 37 | /// Method to un register trace logger 38 | /// 39 | /// 40 | public static void UnRegisterTraceLogger(TraceLoggerBase traceLogger) 41 | { 42 | lock (logLock) 43 | { 44 | if (refreshListenerObject != null) 45 | refreshListenerObject -= new RefreshListenerDelegate(traceLogger.RefreshListeners); 46 | } 47 | } 48 | 49 | /// 50 | /// Method to refresh listeners for all the registered trace loggers 51 | /// 52 | public static void PublishTraceListeners() 53 | { 54 | if (refreshListenerObject != null) 55 | { 56 | refreshListenerObject(TraceSourceSettingStore.TraceSourceSettingsCollection); 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/HttpUtils/HttpResponseMessageWrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Net; 4 | using Microsoft.PowerPlatform.Dataverse.Client.InternalExtensions; 5 | 6 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 7 | namespace Microsoft.PowerPlatform.Dataverse.Client.HttpUtils 8 | { 9 | /// 10 | /// Wrapper around HttpResponseMessage type that copies properties of HttpResponseMessage so that 11 | /// they are available after the HttpClient gets disposed. 12 | /// 13 | public class HttpResponseMessageWrapper : HttpMessageWrapper 14 | { 15 | /// 16 | /// Initializes a new instance of the HttpResponseMessageWrapper class from HttpResponseMessage 17 | /// and content. 18 | /// 19 | public HttpResponseMessageWrapper(HttpResponseMessage httpResponse, string content) 20 | { 21 | if (httpResponse == null) 22 | { 23 | throw new ArgumentNullException("httpResponse"); 24 | } 25 | 26 | CopyHeaders(httpResponse.Headers); 27 | CopyHeaders(httpResponse.GetContentHeaders()); 28 | 29 | Content = content; 30 | StatusCode = httpResponse.StatusCode; 31 | ReasonPhrase = httpResponse.ReasonPhrase; 32 | } 33 | 34 | /// 35 | /// Gets or sets the status code of the HTTP response. 36 | /// 37 | public HttpStatusCode StatusCode { get; protected set; } 38 | 39 | /// 40 | /// Exposes the reason phrase, typically sent along with the status code. 41 | /// 42 | public string ReasonPhrase { get; protected set; } 43 | } 44 | #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member 45 | } 46 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/InternalExtensions/RequestResponseExtenstions.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using Microsoft.Xrm.Sdk; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Dynamic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | #endregion 10 | 11 | namespace Microsoft.PowerPlatform.Dataverse.Client.InternalExtensions 12 | { 13 | /// 14 | /// Organization request/response extensions 15 | /// 16 | internal static class RequestResponseExtenstions 17 | { 18 | /// 19 | /// Converts OrganizationRequest object to ExpandoObject 20 | /// 21 | /// Organization request to convert 22 | /// 23 | internal static ExpandoObject ToExpandoObject(this OrganizationRequest request) 24 | { 25 | var result = new ExpandoObject() as IDictionary; 26 | object propertyValue; 27 | var requestType = request.GetType(); 28 | 29 | // If request is OrganizationRequest get properties from Parameters collection otherwise use public properties 30 | if (requestType == typeof(OrganizationRequest)) 31 | { 32 | foreach (var parameter in request.Parameters) 33 | { 34 | result.Add(parameter.Key, parameter.Value); 35 | } 36 | } 37 | else 38 | { 39 | foreach (var property in request.GetType().GetProperties()) 40 | { 41 | if (property.DeclaringType == typeof(OrganizationRequest)) 42 | continue; 43 | 44 | propertyValue = property.GetValue(request); 45 | result.Add(property.Name, propertyValue); 46 | } 47 | } 48 | 49 | return (ExpandoObject)result; 50 | } 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Utils/ErrorCodes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.Client 8 | { 9 | /// 10 | /// https://docs.microsoft.com/en-us/powerapps/developer/data-platform/org-service/web-service-error-codes 11 | /// 12 | internal static class ErrorCodes 13 | { 14 | /// 15 | /// Combined execution time of incoming requests exceeded limit of {0} milliseconds over time window of {1} seconds. Decrease number of concurrent requests or reduce the duration of requests and try again later. 16 | /// 17 | public const int ThrottlingTimeExceededError = unchecked((int)0x80072321); // -2147015903 18 | 19 | /// 20 | /// Number of requests exceeded the limit of {0} over time window of {1} seconds. 21 | /// 22 | public const int ThrottlingBurstRequestLimitExceededError = unchecked((int)0x80072322); // -2147015902 23 | 24 | /// 25 | /// Number of concurrent requests exceeded the limit of {0}. 26 | /// 27 | public const int ThrottlingConcurrencyLimitExceededError = unchecked((int)0x80072326); // -2147015898 28 | 29 | /// 30 | /// Dataverse ServiceClient is not Initialized 31 | /// 32 | public const int DataverseServiceClientNotIntialized = unchecked((int)0x8004426C); // -2147204500 33 | 34 | /// 35 | /// Solution Path and or File Stream is Null 36 | /// 37 | public const int SolutionFilePathNull = unchecked((int)0x800443FC); // - 2147204100; 38 | 39 | /// 40 | /// Operation is not valid onprem. 41 | /// 42 | public const int OperationInvalidOnPrem = unchecked((int)0x80044262); // -2147204510; 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Utility/OrgNameFormater.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.ConnectControl.Utility 8 | { 9 | /// 10 | /// Formats the org name for to append the Unique Name to the List View. 11 | /// 12 | public class OrgNameFormater : IMultiValueConverter 13 | { 14 | /// 15 | /// Convert an In value to a string 16 | /// 17 | /// 18 | /// 19 | /// 20 | /// 21 | /// 22 | public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) 23 | { 24 | if (values != null && values.Length == 2) 25 | { 26 | if (values[1] is string && !string.IsNullOrWhiteSpace((string)values[1])) 27 | { 28 | // if the Unique name and the Friendly name are identical, just return the friendly name. 29 | // this will happen for most premise installs. 30 | if (((string)values[0]).Equals((string)values[1] , StringComparison.OrdinalIgnoreCase)) 31 | return values[0]; 32 | else 33 | return string.Format("{0} - {1}", (string)values[0], (string)values[1]); 34 | } 35 | else 36 | return values[0]; 37 | } 38 | else 39 | if (values != null) 40 | return values[0]; 41 | return string.Empty; 42 | } 43 | 44 | /// 45 | /// Not used. 46 | /// 47 | /// 48 | /// 49 | /// 50 | /// 51 | /// 52 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) 53 | { 54 | return null; 55 | } 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/LiveTestsConsole/BasicFlow.cs: -------------------------------------------------------------------------------- 1 | using FluentAssertions; 2 | using Microsoft.Crm.Sdk.Messages; 3 | using Microsoft.PowerPlatform.Dataverse.Client; 4 | using Microsoft.PowerPlatform.Dataverse.Client.Auth; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading; 10 | using System.Threading.Tasks; 11 | 12 | namespace LiveTestsConsole 13 | { 14 | public class BasicFlow 15 | { 16 | 17 | internal void Run() 18 | { 19 | Console.WriteLine("Starting Basic Flow"); 20 | 21 | var client = Auth.CreateClient(); 22 | client.IsReady.Should().BeTrue(); 23 | 24 | Console.WriteLine("\nCalling WhoAmI"); 25 | var whoAmIResponse = client.Execute(new WhoAmIRequest()) as WhoAmIResponse; 26 | whoAmIResponse.Should().NotBeNull(); 27 | Console.WriteLine($"OrganizationId:{whoAmIResponse.OrganizationId} UserId:{whoAmIResponse.UserId}"); 28 | 29 | Console.WriteLine("\nCalling RetrieveCurrentOrganizationRequest"); 30 | var retrieveCurrentOrganizationRequest = new RetrieveCurrentOrganizationRequest(); 31 | var retrieveCurrentOrganizationResponse = client.Execute(retrieveCurrentOrganizationRequest) as RetrieveCurrentOrganizationResponse; 32 | retrieveCurrentOrganizationResponse.Should().NotBeNull(); 33 | Console.WriteLine($"FriendlyName:{retrieveCurrentOrganizationResponse.Detail.FriendlyName} GEO:{retrieveCurrentOrganizationResponse.Detail.Geo}"); 34 | 35 | Console.WriteLine("\nCalling RetrieveVersionRequest"); 36 | var retrieveVersionRequest = new RetrieveVersionRequest(); 37 | var retrieveVersionResponse = client.Execute(retrieveVersionRequest) as RetrieveVersionResponse; 38 | retrieveVersionResponse.Should().NotBeNull(); 39 | Console.WriteLine($"Version:{retrieveVersionResponse.Version}"); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Connector/OnPremises/ServiceContextInit.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Xrm.Sdk; 2 | using Microsoft.Xrm.Sdk.Client; 3 | using System; 4 | using System.ServiceModel; 5 | 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.Client.Connector.OnPremises 8 | { 9 | internal abstract class ServiceContextInitializer : IDisposable 10 | where TService : class 11 | { 12 | private OperationContextScope _operationScope; 13 | 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// Constructs a context initializer 17 | /// 18 | /// sdk proxy 19 | protected ServiceContextInitializer(ServiceProxy proxy) 20 | { 21 | ClientExceptionHelper.ThrowIfNull(proxy, "proxy"); 22 | 23 | ServiceProxy = proxy; 24 | 25 | Initialize(proxy); 26 | } 27 | 28 | public ServiceProxy ServiceProxy { get; private set; } 29 | 30 | protected void Initialize(ServiceProxy proxy) 31 | { 32 | // This call initializes operation context scope for the call using the channel 33 | _operationScope = new OperationContextScope((IContextChannel)proxy.ServiceChannel.Channel); 34 | } 35 | 36 | #region IDisposable implementation 37 | 38 | public void Dispose() 39 | { 40 | Dispose(true); 41 | GC.SuppressFinalize(this); 42 | } 43 | 44 | ~ServiceContextInitializer() 45 | { 46 | Dispose(false); 47 | } 48 | 49 | protected virtual void Dispose(bool disposing) 50 | { 51 | if (disposing) 52 | { 53 | if (_operationScope != null) 54 | { 55 | _operationScope.Dispose(); 56 | } 57 | } 58 | } 59 | 60 | #endregion 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/HttpUtils/HttpMessageWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Net.Http.Headers; 4 | 5 | namespace Microsoft.PowerPlatform.Dataverse.Client.HttpUtils 6 | { 7 | /// 8 | /// Base class used to wrap HTTP requests and responses to preserve data after disposal of 9 | /// HttpClient. 10 | /// 11 | public abstract class HttpMessageWrapper 12 | { 13 | /// 14 | /// Initializes a new instance of the HttpMessageWrapper class. 15 | /// 16 | protected HttpMessageWrapper() 17 | { 18 | Headers = new Dictionary>(); 19 | } 20 | 21 | /// 22 | /// Exposes the HTTP message contents. 23 | /// 24 | public string Content { get; set; } 25 | 26 | /// 27 | /// Gets the collection of HTTP headers. 28 | /// 29 | public IDictionary> Headers { get; private set; } 30 | 31 | /// 32 | /// Copies HTTP message headers to the error object. 33 | /// 34 | /// Collection of HTTP headers. 35 | protected void CopyHeaders(HttpHeaders headers) 36 | { 37 | if (headers != null) 38 | { 39 | foreach (KeyValuePair> header in headers) 40 | { 41 | IEnumerable values = null; 42 | if (Headers.TryGetValue(header.Key, out values)) 43 | { 44 | values = values.Concat(header.Value); 45 | } 46 | else 47 | { 48 | values = header.Value; 49 | } 50 | Headers[header.Key] = values; 51 | } 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/PowerShell/Microsoft.PowerPlatform.Dataverse.Client.PowerShell/GenerateCatlogFile.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | This script will create the catalog file from the signed assembly in a PowerShell command shell and drops the files in the drop folder for the signing. . 3 | #> 4 | 5 | [CmdletBinding(PositionalBinding=$true)] 6 | param( 7 | [string] $BuildSourcesDirectory , 8 | [string] $BuildConfiguration, 9 | [string] $StagingDirectory, 10 | [bool] $RunFromVSBuild = $false, 11 | [bool] $EnableDebug = $false 12 | ) 13 | 14 | $SolutionName = "Microsoft.PowerPlatform.Dataverse.Client.PowerShell" 15 | Write-Host ">>> ========================= Invoking GenerateCatalogFile.ps1 for $SolutionName =======================" 16 | Write-Host ">>> BuildSourcesDirectory = $BuildSourcesDirectory" 17 | Write-Host ">>> SolutionName = $SolutionName" 18 | Write-Host ">>> BuildConfiguration = $BuildConfiguration" 19 | Write-Host ">>> StagingDirectory = $StagingDirectory" 20 | Write-Host ">>> RunFromVSBuild = $RunFromVSBuild" 21 | Write-Host ">>> Write Debug Info = $EnableDebug" 22 | 23 | Write-Host ">>> VERSION INFO:" 24 | $PSVersionTable 25 | 26 | Write-Host ">>> LOADING Microsoft.Powershell.Security" 27 | Import-Module Microsoft.Powershell.Security -Verbose 28 | 29 | if ( [System.String]::IsNullOrEmpty($StagingDirectory) -eq $true) 30 | { 31 | #Running local build 32 | $StagingDirectory = $BuildSourcesDirectory 33 | } 34 | 35 | #Create path for drop directory 36 | $dropFolderName = "Drop" 37 | $dropPath = [System.IO.Path]::Combine($StagingDirectory , $dropFolderName, $SolutionName) 38 | Write-Host ">>> Output path is $dropPath" 39 | 40 | $catalogFilePath = "$dropPath\Microsoft.PowerPlatform.Dataverse.Client.PowerShell.cat" 41 | 42 | Write-Host ">>> CatalogFile path is $catalogFilePath" 43 | 44 | $isExists = Get-Item -LiteralPath "$catalogFilePath" -ErrorAction SilentlyContinue 45 | if ($null -ne $isExists) 46 | { 47 | Remove-Item $catalogFilePath -Force 48 | } 49 | 50 | New-FileCatalog -Path "$dropPath" -CatalogFilePath $catalogFilePath -CatalogVersion 1.0 -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Auth/TokenCache/FileBackedTokenCache.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Identity.Client; 2 | using Microsoft.Identity.Client.Extensions.Msal; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.PowerPlatform.Dataverse.Client.Auth.TokenCache 10 | { 11 | /// 12 | /// File backed storage of MSAL tokens for Public Client only. 13 | /// 14 | internal class FileBackedTokenCache 15 | { 16 | private StorageCreationProperties _storageProps = null; 17 | 18 | public FileBackedTokenCache(FileBackedTokenCacheHints cacheOptions) 19 | { 20 | StorageCreationPropertiesBuilder _builder = null; 21 | 22 | _builder = new StorageCreationPropertiesBuilder( 23 | cacheOptions.cacheFileName, cacheOptions.cacheFileDirectory) 24 | .WithLinuxKeyring(cacheOptions.linuxSchemaName, cacheOptions.linuxCollection, cacheOptions.linuxLabel, cacheOptions.linuxAttr1, cacheOptions.linuxAttr2) 25 | .WithMacKeyChain(cacheOptions.macKeyChainServiceName, cacheOptions.macKeyChainServiceAccount); 26 | 27 | _storageProps = _builder.Build(); 28 | } 29 | 30 | /// 31 | /// Initialize and configure the file token cache 32 | /// 33 | /// 34 | /// 35 | public async Task Initialize(ITokenCache tokenCache) 36 | { 37 | if (tokenCache == null) 38 | { 39 | throw new ArgumentNullException(nameof(tokenCache)); 40 | } 41 | 42 | if (tokenCache == null) 43 | { 44 | throw new ArgumentNullException(nameof(_storageProps)); 45 | } 46 | 47 | var cacheHelper = await MsalCacheHelper.CreateAsync(_storageProps).ConfigureAwait(false); 48 | cacheHelper.RegisterCache(tokenCache); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/nuspecs/Microsoft.Dynamics.Sdk.Messages.ReleaseNotes.txt: -------------------------------------------------------------------------------- 1 | Notice: 2 | This package is Contains SDK messaged intended be used in conjunction with the Microsoft.PowerPlatform.Dataverse.Client Nuget package. 3 | This package is intended to work with .net full framework 4.6.2, 4.7.2 and 4.8, .net core 3.0 and 3.1 4 | 5 | Documentation for Most of these messages can be found here: 6 | https://docs.microsoft.com/en-us/dotnet/api/microsoft.crm.sdk.messages?view=dynamics-general-ce-9 7 | 8 | ++CURRENTRELEASEID++ 9 | Updated Min dependency to DV ServiceClient 0.5.10 10 | 11 | 0.5.10: 12 | Updated Newtonsoft.Json to v11.0.2 to match server. 13 | 14 | 0.4.12: 15 | Updated Dataverse Messages 16 | 17 | 0.4.11: 18 | Updated Dataverse Messages 19 | 20 | 0.4.1: 21 | No updates here. 22 | 23 | 0.2.31-Alpha: 24 | Updated Core CDS Sdk assemblies 25 | 26 | 0.2.23-Alpha: 27 | No updates here. 28 | 29 | 0.2.17-Alpha: 30 | No Updates here. 31 | 32 | 0.2.16-Alpha: 33 | No Updates here. 34 | 35 | 0.2.14-Alpha: 36 | Update to internal support libraries - fixes casting issue with messages in this library 37 | 38 | 0.2.8-Alpha 39 | No Updates here. 40 | 41 | 0.2.2-Alpha: 42 | Updates from CDS Core libs. 43 | 44 | 0.2.1-Alpha: 45 | BREAKING CHANGE!!! 46 | Altering Nuget Version to 3 digit semantic version 47 | Namespace change from Microsoft.Powerplatform.xxxx to Microsoft.PowerPlatform.xxxx 48 | No other changes to this assembly 49 | 50 | 0.0.1.11-Alpha: 51 | Updated Dynamics messages to pick up current North America versions of application messages. 52 | 53 | 0.0.1.9-Alpha: 54 | No Updates here. 55 | 56 | 0.0.1.8-Alpha: 57 | No updates here. 58 | 59 | 0.0.1.7-Alpha 60 | Fixed a Nuget Package dependency issue in Microsoft.Dynamics.Sdk.Messages 61 | 62 | 0.0.1.6-Alpha 63 | Intial Alpha release of Microsoft.Dynamics.Messages Message Package 64 | WARNING: This is an ALPHA release. 65 | This library contains messages supporting Sales and Service and Marketing Applications. 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Auth/MSALHttpHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Microsoft.Extensions.Options; 3 | using Microsoft.PowerPlatform.Dataverse.Client.Model; 4 | using Microsoft.PowerPlatform.Dataverse.Client.Utils; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Net.Http; 9 | using System.Text; 10 | using System.Threading; 11 | using System.Threading.Tasks; 12 | 13 | namespace Microsoft.PowerPlatform.Dataverse.Client.Auth 14 | { 15 | internal class MSALHttpRetryHandlerHelper : DelegatingHandler 16 | { 17 | private readonly int MaxRetryCount = ClientServiceProviders.Instance.GetService>().Value.MSALRetryCount; 18 | 19 | /// 20 | /// Handel Failure and retry 21 | /// 22 | /// 23 | /// 24 | /// 25 | protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 26 | { 27 | HttpResponseMessage response = null; 28 | for (int i = 0; i < MaxRetryCount; i++) 29 | { 30 | response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false); 31 | if (response.IsSuccessStatusCode) 32 | { 33 | return response; 34 | } 35 | else 36 | { 37 | if (response.StatusCode != System.Net.HttpStatusCode.RequestTimeout) 38 | { 39 | break; 40 | } 41 | else 42 | { 43 | #if DEBUG 44 | System.Diagnostics.Trace.WriteLine($">>> MSAL RETRY ON TIMEOUT >>> {Thread.CurrentThread.ManagedThreadId} - {i}"); 45 | #endif 46 | } 47 | } 48 | } 49 | return response; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ToolBar/Styles.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 15 | 16 | 17 | 26 | 27 | 28 | 34 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Auth/PromptBehavior.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.PowerPlatform.Dataverse.Client.Auth 2 | { 3 | /// 4 | /// ORGINAL CODE FROM https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/blob/68d7dea3643e075be85abbca1ab88ba614465541/src/Microsoft.IdentityModel.Clients.ActiveDirectory/Features/NonWinCommon/PromptBehavior.cs 5 | /// PORTED TO THIS LIB TO ACT AS A BRIDGE BETWEEN ADAL.NET AND MSAL. 6 | /// Indicates whether AcquireToken should automatically prompt only if necessary or whether 7 | /// it should prompt regardless of whether there is a cached token. 8 | /// 9 | public enum PromptBehavior 10 | { 11 | /// 12 | /// Acquire token will prompt the user for credentials only when necessary. If a token 13 | /// that meets the requirements is already cached then the user will not be prompted. 14 | /// 15 | Auto = 0, 16 | 17 | /// 18 | /// The user will be prompted for credentials even if there is a token that meets the requirements 19 | /// already in the cache. 20 | /// 21 | Always = 1, 22 | 23 | /// 24 | /// Re-authorizes (through displaying webview) the resource usage, making sure that the resulting access 25 | /// token contains updated claims. If user logon cookies are available, the user will not be asked for 26 | /// credentials again and the logon dialog will dismiss automatically. 27 | /// 28 | RefreshSession = 2, 29 | 30 | /// 31 | /// Prompt the user to select a user account even if there is a token that meets the requirements 32 | /// already in the cache. This enables an user who has multiple accounts at the Authorization Server to select amongst 33 | /// the multiple accounts that they might have current sessions for. 34 | /// 35 | SelectAccount = 3, 36 | 37 | /// 38 | /// Never Prompt 39 | /// 40 | Never = 4 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Utility/Enums_Events.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.ConnectControl 8 | { 9 | /// 10 | /// Config Mode to run this control in. 11 | /// 12 | public enum ServerLoginConfigCtrlMode 13 | { 14 | /// 15 | /// Hide the Cancel button and Show the Org Select UI. 16 | /// 17 | ConfigPanel = 0, 18 | 19 | /// 20 | /// Show the Cancel button 21 | /// 22 | FullLoginPanel 23 | } 24 | 25 | /// 26 | /// Data Payload for the Connection status events 27 | /// 28 | public class ConnectStatusEventArgs : EventArgs 29 | { 30 | /// 31 | /// Flag indicating connection state. 32 | /// 33 | public bool ConnectSucceeded { get; private set; } 34 | /// 35 | /// Status of the connection process 36 | /// 37 | public string Status { get; set; } 38 | 39 | /// 40 | /// 41 | /// 42 | /// 43 | public ConnectStatusEventArgs(bool bConnected) 44 | { 45 | ConnectSucceeded = bConnected; 46 | } 47 | 48 | /// 49 | /// 50 | /// 51 | public ConnectStatusEventArgs() 52 | { 53 | ConnectSucceeded = false; 54 | } 55 | } 56 | 57 | /// 58 | /// Data Payload for the Connection Error Events 59 | /// 60 | public class ConnectErrorEventArgs : EventArgs 61 | { 62 | /// 63 | /// Error message 64 | /// 65 | public string ErrorMessage { get; set; } 66 | /// 67 | /// Exception describing the Error 68 | /// 69 | public Exception Ex { get; set; } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Utils/ImportSolutionProperties.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.Client 8 | { 9 | /// 10 | /// Properties valid for the extraParameters collection of ImportSolution. 11 | /// 12 | public static class ImportSolutionProperties 13 | { 14 | /// 15 | /// Parameter used to change the default layering behavior during solution import 16 | /// 17 | public static string DESIREDLAYERORDERPARAM = "DesiredLayerOrder"; 18 | /// 19 | /// Parameter used to specify whether Solution Import processed ribbon metadata asynchronously 20 | /// 21 | public static string ASYNCRIBBONPROCESSING = "AsyncRibbonProcessing"; 22 | /// 23 | /// Parameter used to pass the solution name - Telemetry only 24 | /// 25 | public static string SOLUTIONNAMEPARAM = "SolutionName"; 26 | /// 27 | /// Parameter used to pass a collection of component parameters to the import job. 28 | /// 29 | public static string COMPONENTPARAMETERSPARAM = "ComponentParameters"; 30 | /// 31 | /// Direct the system to convert any matching unmanaged customizations into your managed solution 32 | /// 33 | public static string CONVERTTOMANAGED = "ConvertToManaged"; 34 | /// 35 | /// Internal use only 36 | /// 37 | public static string TEMPLATESUFFIX = "TemplateSuffix"; 38 | /// 39 | /// Internal use only 40 | /// 41 | public static string ISTEMPLATEMODE = "IsTemplateMode"; 42 | /// 43 | /// When set to true, causes ImportSolution process to use the Stage and Upgrade Process. 44 | /// 45 | public static string USESTAGEANDUPGRADEMODE = "StageAndUpgradeSolution"; 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Environs.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Xrm.Sdk.Organization; 2 | using System.Diagnostics; 3 | using System.Reflection; 4 | 5 | namespace Microsoft.PowerPlatform.Dataverse.Client 6 | { 7 | internal static class Environs 8 | { 9 | private static object _initLock = new object(); 10 | 11 | /// 12 | /// Version number of the XrmSDK 13 | /// 14 | public static string XrmSdkFileVersion { get; private set; } 15 | 16 | public static string DvSvcClientFileVersion { get; private set; } 17 | 18 | static Environs() 19 | { 20 | 21 | if (string.IsNullOrEmpty(XrmSdkFileVersion)) 22 | { 23 | lock(_initLock) 24 | { 25 | if ( string.IsNullOrEmpty(XrmSdkFileVersion)) 26 | { 27 | XrmSdkFileVersion = "Unknown"; 28 | try 29 | { 30 | XrmSdkFileVersion = typeof(OrganizationDetail).Assembly.GetCustomAttribute().Version ?? FileVersionInfo.GetVersionInfo(typeof(OrganizationDetail).Assembly.Location).FileVersion; 31 | } 32 | catch { } 33 | } 34 | } 35 | } 36 | 37 | 38 | if (string.IsNullOrEmpty(DvSvcClientFileVersion)) 39 | { 40 | lock (_initLock) 41 | { 42 | if (string.IsNullOrEmpty(DvSvcClientFileVersion)) 43 | { 44 | DvSvcClientFileVersion = "Unknown"; 45 | try 46 | { 47 | DvSvcClientFileVersion = typeof(ServiceClient).Assembly.GetCustomAttribute().Version ?? FileVersionInfo.GetVersionInfo(typeof(ServiceClient).Assembly.Location).FileVersion; 48 | } 49 | catch 50 | { 51 | } 52 | } 53 | } 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Microsoft.PowerPlatform.Dataverse.Ui.Styles.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | DataverseClient 4 | true 5 | Properties 6 | Microsoft.PowerPlatform.Dataverse.Ui.Styles 7 | Microsoft.PowerPlatform.Dataverse.Ui.Styles 8 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | win 10 | true 11 | 12 | 13 | 14 | $(DotNetClassicTargetFrameworks) 15 | $(OutDir)\Microsoft.PowerPlatform.Dataverse.Ui.Styles.xml 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 4.0 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | True 36 | True 37 | Resources.resx 38 | 39 | 40 | 41 | 42 | PublicResXFileCodeGenerator 43 | Resources.Designer.cs 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UnitTests/AzDevOps_ServiceConnection_Test/Operations/ConnectionTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.PowerPlatform.Dataverse.Client; 2 | using Microsoft.PowerPlatform.Dataverse.Client.Model; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using Microsoft.Crm.Sdk.Messages; 12 | 13 | namespace AzDevOps_ServiceConnection_Test.Operations 14 | { 15 | internal class ConnectionTest 16 | { 17 | internal static async Task Run(Uri dvUrlToUse, Guid tenantId, Guid clientId, Guid serviceConnectionId, string systemAccessTokenEnvironmentId) 18 | { 19 | IConfiguration config = new ConfigurationBuilder() 20 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 21 | .Build(); 22 | 23 | ILoggerFactory loggerFactory = LoggerFactory.Create(builder => 24 | builder.AddConsole(options => 25 | { 26 | options.IncludeScopes = true; 27 | options.TimestampFormat = "hh:mm:ss "; 28 | }) 29 | .AddConfiguration(config.GetSection("Logging"))); 30 | 31 | var logger = loggerFactory.CreateLogger(); 32 | 33 | 34 | ServiceClient client = AzPipelineFederatedIdentityAuth.CreateServiceClient( 35 | tenantId.ToString(), 36 | clientId.ToString(), 37 | serviceConnectionId.ToString(), 38 | new ConnectionOptions() 39 | { 40 | ServiceUri = dvUrlToUse, 41 | Logger = logger 42 | } 43 | ); 44 | 45 | var response = (WhoAmIResponse)await client.ExecuteAsync(new WhoAmIRequest()).ConfigureAwait(false); 46 | logger.LogInformation($"Response: {response.UserId} - {response.BusinessUnitId} - {response.OrganizationId}"); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Model/GlobalDiscoveryModel.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Microsoft.PowerPlatform.Dataverse.Client.Model 9 | { 10 | internal class GlobalDiscoveryModel 11 | { 12 | [JsonProperty(PropertyName = "@odata.context")] 13 | public string context { get; set; } 14 | [JsonProperty(PropertyName = "value")] 15 | public IList Instances { get; set; } 16 | } 17 | 18 | internal class GlobalDiscoveryInstanceModel 19 | { 20 | [JsonProperty(PropertyName = "Id")] 21 | public Guid Id { get; set; } 22 | [JsonProperty(PropertyName = "UniqueName")] 23 | public string UniqueName { get; set; } 24 | [JsonProperty(PropertyName = "UrlName")] 25 | public string UrlName { get; set; } 26 | [JsonProperty(PropertyName = "FriendlyName")] 27 | public string FriendlyName { get; set; } 28 | [JsonProperty(PropertyName = "State")] 29 | public int State { get; set; } 30 | [JsonProperty(PropertyName = "Version")] 31 | public string Version { get; set; } 32 | [JsonProperty(PropertyName = "Url")] 33 | public string Url { get; set; } 34 | [JsonProperty(PropertyName = "ApiUrl")] 35 | public string ApiUrl { get; set; } 36 | [JsonProperty(PropertyName = "LastUpdated")] 37 | public string LastUpdated { get; set; } 38 | [JsonProperty(PropertyName = "Region")] 39 | public string Region { get; set; } 40 | [JsonProperty(PropertyName = "OrganizationType")] 41 | public string OrganizationType { get; set; } 42 | [JsonProperty(PropertyName = "TenantId")] 43 | public string TenantId { get; set; } 44 | [JsonProperty(PropertyName = "EnvironmentId")] 45 | public string EnvironmentId { get; set; } 46 | [JsonProperty(PropertyName = "StatusMessage")] 47 | public string StatusMessage { get; set; } 48 | [JsonProperty(PropertyName = "TrialExpirationDate")] 49 | public DateTime TrialExpirationDate { get; set; } 50 | [JsonProperty(PropertyName = "Purpose")] 51 | public string Purpose { get; set; } 52 | [JsonProperty(PropertyName = "SchemaType")] 53 | public string SchemaType { get; set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/DataverseServiceClientBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using Microsoft.PowerPlatform.Dataverse.Client.Model; 8 | 9 | namespace Microsoft.PowerPlatform.Dataverse.Client 10 | { 11 | /// 12 | /// TBD 13 | /// 14 | public class DataverseServiceClientBuilder 15 | { 16 | private ConnectionOptions _connectionOptions; 17 | 18 | /// 19 | /// 20 | /// 21 | /// 22 | internal DataverseServiceClientBuilder(ConnectionOptions connectionOptions) 23 | { 24 | _connectionOptions = connectionOptions; 25 | throw new NotImplementedException("In Development - Not for use."); 26 | 27 | } 28 | 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// 34 | public static DataverseServiceClientBuilder Create(ConnectionOptions connectionOptions) 35 | { 36 | return new DataverseServiceClientBuilder(connectionOptions); 37 | } 38 | 39 | } 40 | 41 | /// 42 | /// TBD 43 | /// 44 | public static class ServiceCollectionExtentions 45 | { 46 | /// 47 | /// TBD 48 | /// 49 | /// 50 | /// 51 | /// 52 | public static IServiceCollection AddDataverseServiceClient( 53 | this IServiceCollection services, 54 | Action connectionOptions) 55 | { 56 | throw new NotImplementedException("In Development - Not for use."); 57 | 58 | //services.Configure(connectionOptions); 59 | 60 | 61 | // Register lib services here... 62 | // services.AddScoped(); 63 | 64 | //return services; 65 | } 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/HttpUtils/HttpRequestSanitizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.Client.HttpUtils 8 | { 9 | /// 10 | /// Sanitizer used internal by . 11 | /// 12 | internal class HttpRequestSanitizer 13 | { 14 | private readonly static string _redactedPlaceholder = "REDACTED"; 15 | private readonly static HashSet _allowedHeaders = new HashSet(new string[] 16 | { 17 | "x-ms-request-id", 18 | "x-ms-client-request-id", 19 | "x-ms-return-client-request-id", 20 | "traceparent", 21 | "MS-CV", 22 | 23 | "Accept", 24 | "Cache-Control", 25 | "Connection", 26 | "Content-Length", 27 | "Content-Type", 28 | "Date", 29 | "ETag", 30 | "Expires", 31 | "If-Match", 32 | "If-Modified-Since", 33 | "If-None-Match", 34 | "If-Unmodified-Since", 35 | "Last-Modified", 36 | "Pragma", 37 | "Request-Id", 38 | "Retry-After", 39 | "Server", 40 | "Transfer-Encoding", 41 | "User-Agent", 42 | "WWW-Authenticate" // OAuth Challenge header. 43 | }, StringComparer.OrdinalIgnoreCase); 44 | 45 | /// 46 | /// Sanitize value of sensitive headers in the given . 47 | /// 48 | /// A collection of headers to sanitize. 49 | public static void SanitizerHeaders(IDictionary> headers) 50 | { 51 | if (headers == null) 52 | { 53 | return; 54 | } 55 | 56 | var namesOfHeaderToSanitize = headers.Keys.Except(_allowedHeaders, StringComparer.OrdinalIgnoreCase).ToList(); 57 | 58 | foreach (string name in namesOfHeaderToSanitize) 59 | { 60 | headers[name] = new string[] { _redactedPlaceholder }; 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/nuspecs/Microsoft.PowerPlatform.Dataverse.Client.Dynamics.ReleaseNotes.txt: -------------------------------------------------------------------------------- 1 | Notice: 2 | This package is an extension to the Microsoft.PowerPlatform.Dataverse.Client Nuget package. 3 | This package is intended to work with .net full framework 4.6.2, 4.7.2 and 4.8, and .net 6.0 4 | 5 | ++CURRENTRELEASEID++ 6 | 7 | 8 | removed support for .net 3.1 and .net 5.0. 9 | 10 | 1.0.39: 11 | No updates 12 | 13 | 1.0.1: 14 | updated min dependency to DV ServiceClient 1.0.0 15 | 16 | 0.5.10: 17 | Updated Newtonsoft.Json to v11.0.2 to match server. 18 | 19 | 0.4.12: 20 | Updated Dataverse Messages 21 | 22 | 0.4.11: 23 | Updated Dataverse Messages 24 | 25 | 0.4.1: 26 | Supersedes Microsoft.PowerPlatform.Cds.Client.Dynamics, Previous nuget has been retired. 27 | ***** MAJOR Breaking Changes ***** 28 | Renamed namespace to Dataverse instance. 29 | 30 | 0.3.10-Alpha: 31 | No updates here. 32 | 33 | 0.2.31-Alpha: 34 | Updated Core CDS Sdk assemblies 35 | 36 | 0.2.23-Alpha: 37 | No updates here. 38 | 39 | 0.2.17-Alpha: 40 | Added IntelliSense Doc Support 41 | Added support for bypassing custom Plug-in Execution during SDK Operation. 42 | This is a special use capability that requires a specialized permission in the CDS infrastructure to use. 43 | Currently this is only permitted for use by users that have the System Administrator Security Role. 44 | 45 | 0.2.16-Alpha: 46 | No Updates here. 47 | 48 | 0.2.14-Alpha: 49 | Update to internal support libraries. 50 | 51 | 0.2.8-Alpha 52 | No Updates here. 53 | 54 | 0.2.2-Alpha: 55 | Updates from CDS Core libs. 56 | 57 | 0.2.1-Alpha: 58 | BREAKING CHANGE!!! 59 | Altering Nuget Version to 3 digit semantic version 60 | Namespace change from Microsoft.Powerplatform.xxxx to Microsoft.PowerPlatform.xxxx 61 | No other changes to this assembly 62 | 63 | 0.0.1.11-Alpha: 64 | No Updates here. 65 | 66 | 0.0.1.9-Alpha: 67 | No Updates here. 68 | 69 | 0.0.1.8-Alpha: 70 | No Updates here. 71 | 72 | 0.0.1.7-Alpha 73 | Fixed a Nuget Package dependency issue in Microsoft.Dynamics.Sdk.Messages 74 | 75 | 0.0.1.6-Alpha 76 | Intial Alpha release of Microsoft.Cds.Client.CdsServiceClient Dynamics extensions 77 | WARNING: This is an ALPHA release. 78 | This library contains helper extensions supporting Sales and Service actions. 79 | 80 | 81 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ListView/BrushResourcesHCMode.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/Utility/AccessablityFormaters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Data; 8 | 9 | namespace Microsoft.PowerPlatform.Dataverse.ConnectControl.Utility 10 | { 11 | /// 12 | /// Converter to convert Accessible names for radio buttons 13 | /// 14 | public class RadioButtonAccessibleNameFormater : IMultiValueConverter 15 | { 16 | /// 17 | /// Converter to convert radio button names for Accessibility 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 25 | { 26 | if (values != null && values.Count() > 1) 27 | { 28 | StringBuilder messageToBeRead = new StringBuilder(); 29 | try 30 | { 31 | foreach (var itm in values) 32 | { 33 | if (itm is string) 34 | { 35 | messageToBeRead.AppendFormat("{0} ", (string)itm); 36 | } 37 | } 38 | if (messageToBeRead.Length > 0) 39 | return messageToBeRead.ToString(); 40 | else 41 | return string.Empty; 42 | } 43 | finally 44 | { 45 | messageToBeRead.Clear(); 46 | } 47 | 48 | } 49 | return string.Empty; 50 | } 51 | 52 | /// 53 | /// Not used. 54 | /// 55 | /// 56 | /// 57 | /// 58 | /// 59 | /// 60 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 61 | { 62 | return null; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # CoreXT generated files 2 | 3 | .corext/gen/ 4 | build/environment/ 5 | 6 | # Cake 7 | /.cake 8 | /version.txt 9 | /PSRunCmds*.ps1 10 | # Build output 11 | 12 | /bin/ 13 | /binSigned/ 14 | /obj/ 15 | Drop/ 16 | target/ 17 | Symbols/ 18 | build/version/bldver.cpp 19 | build/version/bldver.cs 20 | build/version/bldver.h 21 | build/version/bldver.vb 22 | build/version/sources.ver 23 | build_logs/ 24 | buildd.err 25 | buildd.log 26 | buildd.prf 27 | buildd.wrn 28 | *.binlog 29 | data/ 30 | objd/ 31 | public/lock 32 | src/Ext/SdkBuildVersion.cmd 33 | src/Ext/amd64/ 34 | src/Installer/Setup/AutogeneratedFiles/ 35 | src/Installer/Setup_RTL/AutogeneratedFiles/ 36 | src/Installer/USDInstaller/USDInstaller/AutogeneratedFiles/ 37 | versionsmk.inc 38 | src/GeneralTools/PluginRegistrationV3/SupportLibs/ 39 | Distro/ 40 | src/GeneralTools/PowerShell/Microsoft.Crm.SDKBuilder/Microsoft.Crm.SDKBuilder/Distro 41 | src/GeneralTools/PowerShell/Microsoft.Crm.SDKBuilder/Microsoft.Crm.SDKBuilder/v9.0.PackageDeployer 42 | TestResults 43 | 44 | 45 | #Visual Studio Files user files 46 | /.vs/* 47 | /src/**/.vs/* 48 | /src/**/*.suo 49 | /src/**/*.vssscc 50 | /src/**/*.user 51 | /src/**/*.vspscc 52 | **/Properties/launchSettings.json 53 | 54 | #Skip Nuget Packages 55 | /src/**/packages/* 56 | /src/**/.packages/* 57 | 58 | # Build generated files in src 59 | /src/**/objd/**/* 60 | /src/**/obj/**/* 61 | /src/**/bin/**/* 62 | /src/**/gen/**/* 63 | 64 | # KDiff3 generated files 65 | *.orig 66 | 67 | # Localization related files 68 | src/Localize/Temp 69 | *.edb 70 | *.lsp 71 | *.suo 72 | *.err 73 | *.log 74 | *.prf 75 | *.wrn 76 | /obj/amd64 77 | 78 | #test result files 79 | /src/**/TestResults 80 | /src/**/FakesAssemblies 81 | 82 | /src/GeneralTools/PluginRegistrationV3/SupportLibs/* 83 | /src/GeneralTools/PowerShell/Microsoft.Crm.SDKBuilder/Microsoft.Crm.SDKBuilder/Distro 84 | /src/GeneralTools/PowerShell/Microsoft.Crm.SDKBuilder/Microsoft.Crm.SDKBuilder/v9.0.PackageDeployer/v9 85 | /src/GeneralTools/PowerShell/Microsoft.Crm.SDKBuilder/Microsoft.Crm.SDKBuilder/Nuget 86 | /src/GeneralTools/PowerShell/Microsoft.Crm.SDKBuilder/Microsoft.Crm.SDKBuilder/tools 87 | /src/InternalTools/ARTe/* 88 | /src/GeneralTools/SolutionPackager/TestResults 89 | *.nupkg 90 | /src/GeneralTools/XrmSDK/TestXrmSDKConnection_Core 91 | /src/GeneralTools/XrmSDK/TestXrmSDKConnection 92 | /src/GeneralTools/XrmSDK/StandardConsoleApp 93 | /src/GeneralTools/XrmSDK/CdsSdkShim 94 | /build/cake/test/* 95 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Cake. 4 | // 5 | //------------------------------------------------------------------------------ 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | using System; 9 | using System.Runtime.CompilerServices; 10 | 11 | [assembly: AssemblyTitle("Microsoft Dataverse Application API Wrapper")] 12 | [assembly: AssemblyDescription("Microsoft Dataverse API helper library. Provides authentication support, telemetry and helpers to work with Dataverse API's")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("Microsoft Dataverse")] 15 | [assembly: AssemblyVersion("0.0.4.0")] 16 | [assembly: AssemblyFileVersion("0.0.4.1")] 17 | [assembly: AssemblyInformationalVersion("0.0.4.1+gc05b057")] 18 | [assembly: AssemblyCopyright("© 2021 Microsoft Corporation. All rights reserved")] 19 | [assembly: AssemblyTrademark("")] 20 | [assembly: AssemblyConfiguration("")] 21 | [assembly: Guid("9752791b-41e4-4c38-9d1d-7576bf355523")] 22 | [assembly: ComVisible(false)] 23 | [assembly: CLSCompliant(false)] 24 | 25 | [assembly: InternalsVisibleTo("DataverseClient_Core_UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] 26 | [assembly: InternalsVisibleTo("Microsoft.PowerPlatform.Dataverse.Client.Dynamics, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] 27 | [assembly: InternalsVisibleTo("Microsoft.PowerPlatform.Dataverse.ConnectControl, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] 28 | 29 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/Testers/LoginControlTester/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | //[assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("Microsoft")] 13 | [assembly: AssemblyProduct("LoginControlTester")] 14 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | 22 | 23 | //In order to begin building localizable applications, set 24 | //CultureYouAreCodingWith in your .csproj file 25 | //inside a . For example, if you are using US english 26 | //in your source files, set the to en-US. Then uncomment 27 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 28 | //the line below to match the UICulture setting in the project file. 29 | 30 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 31 | 32 | 33 | [assembly: ThemeInfo( 34 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 35 | //(used if a resource is not found in the page, 36 | // or application resource dictionaries) 37 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 38 | //(used if a resource is not found in the page, 39 | // app, or any theme specific resource dictionaries) 40 | )] 41 | [assembly: AssemblyVersion("3.0.0.0")] 42 | [assembly: AssemblyFileVersion("3.0.0.0")] 43 | 44 | 45 | // Version information for an assembly consists of the following four values: 46 | // 47 | // Major Version 48 | // Minor Version 49 | // Build Number 50 | // Revision 51 | // 52 | // You can specify all the values or you can default the Build and Revision Numbers 53 | // by using the '*' as shown below: 54 | // [assembly: AssemblyVersion("1.0.*")] 55 | 56 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/UIStyles/Resources/ListView/SortAdorner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Windows; 4 | using System.Windows.Documents; 5 | using System.Windows.Media; 6 | 7 | namespace Microsoft.PowerPlatform.Dataverse.Ui.Styles 8 | { 9 | /// 10 | /// Creates a Adorner to indicate sort direction. 11 | /// 12 | public class SortAdorner : Adorner 13 | { 14 | private readonly static Geometry _AscGeometry = Geometry.Parse("M 0,0 L 10,0 L 5,5 Z"); 15 | private readonly static Geometry _DescGeometry = Geometry.Parse("M 0,5 L 10,5 L 5,0 Z"); 16 | private string sortAdornerBrushKey; 17 | /// 18 | /// 19 | /// 20 | private Brush SortAdornerFillBrush 21 | { 22 | get 23 | { 24 | return (Brush)this.TryFindResource(sortAdornerBrushKey) ?? Brushes.Black; 25 | } 26 | } 27 | /// 28 | /// Gets or Sets Sort Direction. 29 | /// 30 | public ListSortDirection Direction { get; private set; } 31 | /// 32 | /// Constructor. 33 | /// 34 | /// UI Element type. 35 | /// Sorting Direction. 36 | public SortAdorner(UIElement element, ListSortDirection dir) 37 | : base(element) 38 | { 39 | Direction = dir; 40 | } 41 | /// 42 | /// Constructor. 43 | /// 44 | /// UI Element type. 45 | /// Sorting Direction. 46 | /// Sort Brush Key 47 | public SortAdorner(UIElement element, ListSortDirection dir, string sortOrderBrushKey) 48 | : this(element, dir) 49 | { 50 | this.sortAdornerBrushKey = sortOrderBrushKey; 51 | } 52 | /// 53 | /// // Override the OnRender call to change the Drawing visual type. 54 | /// 55 | /// visual content drawing type. 56 | protected override void OnRender(DrawingContext drawingContext) 57 | { 58 | base.OnRender(drawingContext); 59 | 60 | if (AdornedElement.RenderSize.Width < 20) 61 | return; 62 | 63 | drawingContext.PushTransform(new TranslateTransform(AdornedElement.RenderSize.Width - 15, (AdornedElement.RenderSize.Height - 5) / 2)); 64 | 65 | drawingContext.DrawGeometry(SortAdornerFillBrush, null, Direction == ListSortDirection.Ascending ? _AscGeometry : _DescGeometry); 66 | 67 | drawingContext.Pop(); 68 | } 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | false 6 | 7 | 8 | Debug 9 | 10 | 11 | 12 | $(MSBuildThisFileDirectory) 13 | $(RepoRoot)src\ 14 | 15 | 16 | 17 | true 18 | 19 | 20 | 21 | 22 | $(RepoRoot)nuget.dev.config 23 | 24 | 25 | $(RepoRoot)obj\.nuget-cache 26 | 27 | 28 | 29 | 31 | 33 | 34 | 36 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/GeneralTools/DataverseClient/ConnectControl/ErrorWindow.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 33 | 35 | 36 | 37 | 38 |