Ejemplo n.º 1
0
        /// <summary>
        /// Resets all the properties and populates the <see cref="AvailableDataSourceKinds"/> List
        /// and sets the <see cref="SelectedDataSourceKind"/> to the first in the <see cref="AvailableDataSourceKinds"/>
        /// </summary>
        private void ResetProperties()
        {
            this.AvailableDataSourceKinds = new ReactiveList <IDalMetaData>();
            this.ShowBrowseButton         = false;
            this.ErrorMessage             = string.Empty;

            var dalAvailable = ServiceLocator.Current.GetInstance <AvailableDals>();

            this.dals = dalAvailable.DataAccessLayerKinds;

            foreach (var dal in this.dals)
            {
                this.AvailableDataSourceKinds.Add(dal.Metadata);
            }

            this.RefreshSavedSources();

#if DEBUG
            this.UserName = "******";
            this.Password = "******";
            var debugUri = new UriRowViewModel {
                Uri = "http://localhost:1234", DalType = DalType.Web
            };
            this.AllDefinedUris.Add(debugUri);
#else
            this.UserName = string.Empty;
            this.Password = string.Empty;
            this.Uri      = string.Empty;
#endif
            this.IsProxyEnabled = false;
            this.ProxyUri       = string.Empty;
            this.ProxyPort      = string.Empty;

            this.SelectedDataSourceKind = this.AvailableDataSourceKinds.FirstOrDefault(v => v.DalType == DalType.Web);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Reloads all saved sources from the uri config file.
        /// </summary>
        private void RefreshSavedSources()
        {
            this.AllDefinedUris = new ReactiveList <UriRowViewModel>();

            var configHandler = new UriConfigFileHandler();
            var uriList       = configHandler.Read();

            foreach (var uri in uriList)
            {
                var row = new UriRowViewModel {
                    UriConfig = uri
                };
                this.AllDefinedUris.Add(row);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Clears and populates the <see cref="UriRowList"/>
        /// </summary>
        private void RePopulateUriRows()
        {
            this.UriRowList.Clear();

            var configHandler = new UriConfigFileHandler();
            var uriList       = configHandler.Read();

            foreach (var uri in uriList)
            {
                var row = new UriRowViewModel {
                    UriConfig = uri
                };
                this.UriRowList.Add(row);
            }
        }