/// <summary>
 /// Create a DataContext instance.
 /// </summary>
 /// <param name='dataSource'>Data source.</param>
 /// <param name='locale'>Locale.</param>
 public DataContext(IDataSourceInformation dataSource, ILocale locale)
 {
     // Set data
     DataSource = dataSource;
     IsChanged  = false;
     Locale     = locale;
 }
示例#2
0
 public IDataSourceInformation GetDataSourceInformation()
 {
     _dataSourceInformation = new DataSourceInformation(serviceName,
                                                        serviceEndPoint,
                                                        DataSourceType.WebService);
     return(_dataSourceInformation);
 }
示例#3
0
 /// <summary>
 /// Get information about data source.
 /// </summary>
 /// <returns>Information about data source.</returns>
 public override IDataSourceInformation GetDataSourceInformation()
 {
     if (_dataSourceInformation.IsNull())
     {
         _dataSourceInformation = new DataSourceInformation(WebServiceProxy.AnalysisService.GetWebServiceName(),
                                                            WebServiceProxy.AnalysisService.GetEndpointAddress().ToString(),
                                                            DataSourceType.WebService);
     }
     return(_dataSourceInformation);
 }
示例#4
0
        public IDataSourceInformation GetDataSourceInformation()
        {
            _dataSourceInformation = new DataSourceInformation(serviceName,
                                                               serviceEndPoint,
                                                               DataSourceType.WebService);

            //_dataSourceInformation.Address = Assembly.GetExecutingAssembly().GetApplicationName() + " " +
            //          Assembly.GetExecutingAssembly().GetApplicationVersion();
            //_dataSourceInformation.Name = Settings.Default.OnionDataSourceName;
            //_dataSourceInformation.Type = DataSourceType.Onion;
            return(_dataSourceInformation);
        }
示例#5
0
 /// <summary>
 /// Get information about data source.
 /// </summary>
 /// <returns>Information about data source.</returns>
 public override IDataSourceInformation GetDataSourceInformation()
 {
     if (_dataSourceInformation.IsNull())
     {
         _dataSourceInformation = new DataSourceInformation(
             WebServiceProxy.TaxonService.GetWebServiceName(),
             WebServiceProxy.TaxonService.GetEndpointAddress().ToString(),
             DataSourceType.WebService);
         //_dataSourceInformation = new DataSourceInformation(WebServiceProxy.DyntaxaInternalService.GetWebServiceName(),
         //                                                   WebServiceProxy.DyntaxaInternalService.GetEndpointAddress().ToString(),
         //                                                   DataSourceType.WebService);
     }
     return(_dataSourceInformation);
 }
示例#6
0
        /// <summary>
        /// Get/set ITransaction by list index.
        /// </summary>
        public Boolean IsDataSourceInTransaction(IDataSourceInformation dataSourceInformation)
        {
            Boolean isDataSourceInTransaction;

            isDataSourceInTransaction = false;
            if (this.IsNotEmpty())
            {
                foreach (ITransaction transaction in this)
                {
                    if ((transaction.DataSourceInformation.Address == dataSourceInformation.Address) &&
                        (transaction.DataSourceInformation.Name == dataSourceInformation.Name) &&
                        (transaction.DataSourceInformation.Type == dataSourceInformation.Type))
                    {
                        isDataSourceInTransaction = true;
                        break;
                    }
                }
            }

            return(isDataSourceInTransaction);
        }