diff options
| -rw-r--r-- | Software/DB/PPC/Tango.mdf | bin | 75497472 -> 75497472 bytes | |||
| -rw-r--r-- | Software/DB/PPC/Tango_log.ldf | bin | 20578304 -> 20578304 bytes | |||
| -rw-r--r-- | Software/DB/Tango.mdf | bin | 75497472 -> 75497472 bytes | |||
| -rw-r--r-- | Software/DB/Tango_log.ldf | bin | 20578304 -> 20578304 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk | bin | 1581 -> 1516 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs | 3 | ||||
| -rw-r--r-- | Software/Visual_Studio/Project Templates/Tango PPC Module.zip | bin | 0 -> 69272 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs | 15 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/DataSource.cs | 39 |
9 files changed, 29 insertions, 28 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf Binary files differindex cfe01aec8..e13855e90 100644 --- a/Software/DB/PPC/Tango.mdf +++ b/Software/DB/PPC/Tango.mdf diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf Binary files differindex 696dc0a75..0349ff6b6 100644 --- a/Software/DB/PPC/Tango_log.ldf +++ b/Software/DB/PPC/Tango_log.ldf diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 977d163d4..50b0e84fa 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 2f3904f86..bdd6b2503 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk Binary files differindex 96a6550d7..8f85b4556 100644 --- a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk +++ b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs index 4032c946c..cafd0328a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs @@ -69,6 +69,9 @@ namespace Tango.MachineStudio.UI.ViewModels _notificationProvider = notificationProvider; } + /// <summary> + /// Called when the application has been started + /// </summary> public override void OnApplicationStarted() { base.OnApplicationStarted(); diff --git a/Software/Visual_Studio/Project Templates/Tango PPC Module.zip b/Software/Visual_Studio/Project Templates/Tango PPC Module.zip Binary files differnew file mode 100644 index 000000000..6d4f6dfdf --- /dev/null +++ b/Software/Visual_Studio/Project Templates/Tango PPC Module.zip diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs index 3ee8ecc9f..3fb827ce8 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs @@ -20,7 +20,11 @@ namespace Tango.BL { private List<ObservableModifiedEventArgs> _pending_notifications = new List<ObservableModifiedEventArgs>(); private ObservablesContextAdapter _adapter; + private static DataSource _override_datasource; + /// <summary> + /// Initializes a new instance of the <see cref="ObservablesContext"/> class. + /// </summary> public ObservablesContext() { @@ -44,7 +48,7 @@ namespace Tango.BL /// <returns></returns> public static ObservablesContext CreateDefault() { - return new ObservablesContext(SettingsManager.Default.GetOrCreate<CoreSettings>().DataSource); + return new ObservablesContext(_override_datasource != null ? _override_datasource : SettingsManager.Default.GetOrCreate<CoreSettings>().DataSource); } /// <summary> @@ -174,5 +178,14 @@ namespace Tango.BL { get { return _adapter; } } + + /// <summary> + /// Overrides the default data source that is read from the core settings. + /// </summary> + /// <param name="dataSource">The data source.</param> + public static void OverrideSettingsDataSource(DataSource dataSource) + { + _override_datasource = dataSource; + } } } diff --git a/Software/Visual_Studio/Tango.Core/DataSource.cs b/Software/Visual_Studio/Tango.Core/DataSource.cs index 511a82267..3803eea5d 100644 --- a/Software/Visual_Studio/Tango.Core/DataSource.cs +++ b/Software/Visual_Studio/Tango.Core/DataSource.cs @@ -100,35 +100,20 @@ namespace Tango.Core case DataSourceType.Azure: - if (IntegratedSecurity) - { - throw new NotSupportedException("Azure integrated security is not supported."); - //if (!_has_provider) - //{ - // var provider = new ActiveDirectoryAuthProvider(); - // SqlAuthenticationProvider.SetProvider(SqlAuthenticationMethod.ActiveDirectoryInteractive, provider); - // _has_provider = true; - //} - - //SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(); - - //builder.DataSource = Address; - //builder.InitialCatalog = Catalog; - //builder.UserID = UserName; - //builder.TrustServerCertificate = true; - //builder.ConnectTimeout = 15; - //builder.Pooling = false; - - //builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryInteractive; + SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(); + builder.DataSource = Address; + builder.InitialCatalog = Catalog; + builder.UserID = UserName; + builder.Password = Password; + builder.IntegratedSecurity = false; + builder.TrustServerCertificate = true; + builder.ConnectTimeout = 15; + builder.Pooling = false; + builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryPassword; - //SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString); + SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString); - //return sqlConnection; - } - else - { - return new SqlConnection(String.Format("Server=tcp:{0},1433;Initial Catalog={1};Persist Security Info=False;User ID={2};Password={3};MultipleActiveResultSets=True;App=EntityFramework;Encrypt=True;TrustServerCertificate=False;Authentication=\"Active Directory Password\";", Address, Catalog, UserName, Password)); - } + return sqlConnection; default: |
