public static bool AreCompatible(IFeatures one, IFeatures two) { // how do I want this to work? // do I pass in a list and then loop over each item? switch (one.GetType().Name.ToLower()) { case "bog": break; case "caves": break; case "craters": break; case "dunes": break; case "faults": break; case "forest": break; case "fumaroles": break; case "karst": break; case "ridges": break; case "rivers": break; case "shrubland": break; case "talus": default: break; } return true; }
/// <summary> /// Gets pattern feature info. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='azureRegion'> /// Supported Azure regions for Cognitive Services endpoints. Possible values /// include: 'westus', 'westeurope' /// </param> /// <param name='appId'> /// Format - guid. The application ID. /// </param> /// <param name='versionId'> /// The version ID of the task. /// </param> /// <param name='patternId'> /// The pattern feature ID. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PatternFeatureInfo> GetPatternFeatureInfoAsync(this IFeatures operations, AzureRegions azureRegion, string appId, string versionId, int patternId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetPatternFeatureInfoWithHttpMessagesAsync(azureRegion, appId, versionId, patternId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Updates the phrases, the state and the name of the phraselist feature in a /// version of the application. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='azureRegion'> /// Supported Azure regions for Cognitive Services endpoints. Possible values /// include: 'westus', 'westeurope', 'southeastasia', 'eastus2', /// 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope', /// 'eastasia', 'australiaeast', 'brazilsouth', 'virginia' /// </param> /// <param name='azureCloud'> /// Supported Azure Clouds for Cognitive Services endpoints. Possible values /// include: 'com', 'us' /// </param> /// <param name='appId'> /// The application ID. /// </param> /// <param name='versionId'> /// The version ID. /// </param> /// <param name='phraselistId'> /// The ID of the feature to be updated. /// </param> /// <param name='phraselistUpdateObject'> /// The new values for: - Just a boolean called IsActive, in which case the /// status of the feature will be changed. - Name, Pattern, Mode, and a boolean /// called IsActive to update the feature. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <OperationStatus> UpdatePhraseListAsync(this IFeatures operations, AzureRegions azureRegion, AzureClouds azureCloud, System.Guid appId, string versionId, int phraselistId, PhraselistUpdateObject phraselistUpdateObject = default(PhraselistUpdateObject), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdatePhraseListWithHttpMessagesAsync(azureRegion, azureCloud, appId, versionId, phraselistId, phraselistUpdateObject, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public void ReplaceFeatures(IEnumerable <IFeature> features) { lock (_syncRoot) { _features = new Features(features); } }
public void ReplaceFeatures(Features features) { lock (_syncRoot) { _features = features; } }
/// <summary> /// Deletes a phraselist feature from a version of the application. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='appId'> /// The application ID. /// </param> /// <param name='versionId'> /// The version ID. /// </param> /// <param name='phraselistId'> /// The ID of the feature to be deleted. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <OperationStatus> DeletePhraseListAsync(this IFeatures operations, System.Guid appId, string versionId, int phraselistId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeletePhraseListWithHttpMessagesAsync(appId, versionId, phraselistId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets all the extraction phraselist and pattern features in a version of the /// application. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='appId'> /// The application ID. /// </param> /// <param name='versionId'> /// The version ID. /// </param> /// <param name='skip'> /// The number of entries to skip. Default value is 0. /// </param> /// <param name='take'> /// The number of entries to return. Maximum page size is 500. Default is 100. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <FeaturesResponseObject> ListAsync(this IFeatures operations, System.Guid appId, string versionId, int?skip = 0, int?take = 100, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(appId, versionId, skip, take, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates a new phraselist feature in a version of the application. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='appId'> /// The application ID. /// </param> /// <param name='versionId'> /// The version ID. /// </param> /// <param name='phraselistCreateObject'> /// A Phraselist object containing Name, comma-separated Phrases and the /// isExchangeable boolean. Default value for isExchangeable is true. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <int?> AddPhraseListAsync(this IFeatures operations, System.Guid appId, string versionId, PhraselistCreateObject phraselistCreateObject, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddPhraseListWithHttpMessagesAsync(appId, versionId, phraselistCreateObject, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Adds a new feature relation to be used by the entity in a version of the /// application. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='appId'> /// The application ID. /// </param> /// <param name='versionId'> /// The version ID. /// </param> /// <param name='entityId'> /// The entity extractor ID. /// </param> /// <param name='featureRelationCreateObject'> /// A Feature relation information object. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <OperationStatus> AddEntityFeatureAsync(this IFeatures operations, System.Guid appId, string versionId, System.Guid entityId, ModelFeatureInformation featureRelationCreateObject, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddEntityFeatureWithHttpMessagesAsync(appId, versionId, entityId, featureRelationCreateObject, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates a new pattern feature. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='azureRegion'> /// Supported Azure regions for Cognitive Services endpoints. Possible values /// include: 'westus', 'westeurope' /// </param> /// <param name='appId'> /// Format - guid. The application ID. /// </param> /// <param name='versionId'> /// The version ID of the task. /// </param> /// <param name='patternCreateObject'> /// A JSON object containing Name and Pattern of the feature. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <double?> CreatePatternFeatureAsync(this IFeatures operations, AzureRegions azureRegion, string appId, string versionId, PatternCreateObject patternCreateObject = default(PatternCreateObject), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreatePatternFeatureWithHttpMessagesAsync(azureRegion, appId, versionId, patternCreateObject, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the feature at the specified Object ID /// </summary> /// <param name="oid"></param> /// <param name="table"></param> /// <returns></returns> internal IFeature GetFeature(uint oid, IFeatures table) { if (!_isOpen) { throw (new ApplicationException("An attempt was made to read from a closed DBF file")); } if (oid >= _NumberOfRecords) { throw (new ArgumentException("Invalid DataRow requested at index " + oid.ToString())); } fs.Seek(_HeaderLength + oid * _RecordLength, 0); IFeature dr = table.New(); if (br.ReadChar() == '*') //is record marked deleted? { return(null); } for (int i = 0; i < DbaseColumns.Length; i++) { DbaseField dbf = DbaseColumns[i]; dr[dbf.ColumnName] = ReadDbfValue(dbf); } return(dr); }
/// <summary> /// Initializes a new instance of the <see cref="MemoryProvider"/> /// </summary> /// <param name="feature">Feature to be in this datasource</param> public MemoryProvider(IFeature feature) { CRS = ""; _features = new Features { feature }; }
public static T BuildAndInstanciate <T>(IFeatures features) where T : class { var concreteType = Cache.GetOrAdd(typeof(T), BuildType); var r = (T)Activator.CreateInstance(concreteType, features); return(r); }
public CompressionCtrl(IPump pump, ITimer timer, IFeatures LED_Green, IFeatures LED_Red, IFeatures VibratingDevice) { timer_ = timer; pump_ = pump; LED_Green_ = LED_Green; LED_Red_ = LED_Red; VibratingDevice_ = VibratingDevice; }
private void RenderToRaster(IViewport viewport, ILayer layer, out IFeatures features) { var canvas = new Canvas(); MapRenderer.RenderLayer(canvas, viewport, layer); canvas.UpdateLayout(); var bitmap = BitmapRendering.BitmapConverter.ToBitmapStream(canvas, viewport.Width, viewport.Height); features = new Features { new Feature { Geometry = new Raster(bitmap, viewport.Extent) } }; }
/// <summary> /// Gets a list of previewed features for all the providers in the /// current subscription. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Management.Resources.IFeatures. /// </param> /// <returns> /// List of previewed features. /// </returns> public static FeatureOperationsListResult ListAll(this IFeatures operations) { return(Task.Factory.StartNew((object s) => { return ((IFeatures)s).ListAllAsync(); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets a list of previewed features of a resource provider. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Management.Resources.IFeatures. /// </param> /// <param name='resourceProviderNamespace'> /// Required. The namespace of the resource provider. /// </param> /// <returns> /// List of previewed features. /// </returns> public static FeatureOperationsListResult List(this IFeatures operations, string resourceProviderNamespace) { return(Task.Factory.StartNew((object s) => { return ((IFeatures)s).ListAsync(resourceProviderNamespace); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the FeatureClient class. /// </summary> public FeatureClient() : base() { this._features = new Features(this); this._apiVersion = "2014-08-01-preview"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes a new instance of the FeatureClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public FeatureClient(HttpClient httpClient) : base(httpClient) { this._features = new Features(this); this._apiVersion = "2015-12-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
public void Setup() { client = new Mock <IProxy>(); request = new Mock <BaseRequest>(new Mock <IProxy>().Object); request.CallBase = true; // Create proxy instance featuresProxy = new AxosoftAPI.NET.Features(client.Object); featuresProxy = new AxosoftAPI.NET.Features(request.Object); }
/// <summary> /// Initializes a new instance of the <see cref="MemoryProvider"/> /// </summary> /// <param name="features">Features to be included in this datasource</param> public MemoryProvider(IEnumerable <IFeature> features) { CRS = ""; var localFeatures = new Features(); foreach (var feature in features) { localFeatures.Add(feature); } _features = localFeatures; }
/// <summary> /// Initializes a new instance of the <see cref="MemoryProvider"/> /// </summary> /// <param name="geometry">Geometry to be in this datasource</param> public MemoryProvider(Geometry geometry) { CRS = ""; var features = new Features(); IFeature feature = features.New(); feature.Geometry = geometry; features.Add(feature); _features = features; SymbolSize = 64; }
/// <summary> /// Initializes a new instance of the <see cref="MemoryProvider"/> /// </summary> /// <param name="geometries">Set of geometries that this datasource should contain</param> public MemoryProvider(IEnumerable <IGeometry> geometries) { CRS = ""; var features = new Features(); foreach (IGeometry geometry in geometries) { IFeature feature = features.New(); feature.Geometry = geometry; features.Add(feature); } _features = features; }
private IFeature GetFeaturePrivate(uint rowId, IFeatures dt) { if (_dbaseFile != null) { var dr = _dbaseFile.GetFeature(rowId, dt ?? new Features()); dr.Geometry = ReadGeometry(rowId); if (FilterDelegate == null || FilterDelegate(dr)) { return(dr); } return(null); } throw (new ApplicationException("An attempt was made to read DBase data from a shapefile without a valid .DBF file")); }
/// <summary> /// Gets a datarow from the datasource at the specified index belonging to the specified datatable /// </summary> /// <param name="rowId"></param> /// <param name="dt">Datatable to feature should belong to.</param> /// <returns></returns> public IFeature GetFeature(uint rowId, IFeatures dt) { lock (_syncRoot) { Open(); try { return(GetFeaturePrivate(rowId, dt)); } finally { Close(); } } }
public IEnumerable <IFeature> GetFeaturesInView(BoundingBox extent, double resolution) { lock (_syncLock) { foreach (var feature in _layer.GetFeaturesInView(extent, resolution)) { // hack: clear cache to prevent cross thread exception. // todo: remove this caching mechanism. feature.RenderedGeometry.Clear(); } IFeatures features = null; var viewport = CreateViewport(extent, resolution); RunMethodOnStaThread(() => RenderToRaster(viewport, _layer, out features)); return(features); } }
/// <summary> /// Gets a datarow from the datasource at the specified index belonging to the specified datatable /// </summary> /// <param name="RowID"></param> /// <param name="dt">Datatable to feature should belong to.</param> /// <returns></returns> public IFeature GetFeature(uint RowID, IFeatures dt) { if (dbaseFile != null) { IFeature dr = (IFeature)dbaseFile.GetFeature(RowID, (dt == null) ? new Features() : dt); dr.Geometry = ReadGeometry(RowID); if (FilterDelegate == null || FilterDelegate(dr)) { return(dr); } else { return(null); } } else { throw (new ApplicationException("An attempt was made to read DBase data from a shapefile without a valid .DBF file")); } }
/// <summary> /// Gets the feature at the specified Object ID /// </summary> /// <param name="oid"></param> /// <param name="table"></param> /// <returns></returns> internal IFeature GetFeature(uint oid, IFeatures table) { if (oid >= _numberOfRecords) { throw (new ArgumentException("Invalid DataRow requested at index " + oid.ToString(CultureInfo.InvariantCulture))); } _fs.Seek(_headerLength + oid * _recordLength, 0); var dr = table.New(); if (_br.ReadChar() == '*') { return(null); // is record marked deleted? } foreach (var dbf in _dbaseColumns) { dr[dbf.ColumnName] = ReadDbfValue(dbf); } return(dr); }
public IModelResult Eval(IFeatures feature) { var inputValuesTensors = feature.GetFeaturesTensors(); TFOutput output = new TFOutput(); TFOutput input = new TFOutput(); lock (_graph) { using (var session = new TFSession(Graph)) { var result = session.Run( inputs: new[] { input }, inputValues: inputValuesTensors.ToArray(), outputs: new[] { output }); return(ResultConvertor.Convert(result)); } } }
public ShowProductsWindow(Caretaker caretaker = null, FeaturesOperator features = null) { InitializeComponent(); _caretaker = caretaker; _features = features; if (features != null) { TvCategory.ItemsSource = Request(); } else { TvCategory.ItemsSource = CategoryCreator.GetCreatorList(); } if (_caretaker.Memento.State != null && _caretaker.Memento.State != "") { BtnSignIn.Content = _caretaker.Memento.State; } }
private IFeature GetFeaturePrivate(uint rowId, IFeatures dt) { if (_dbaseFile != null) { var dr = _dbaseFile.GetFeature(rowId, dt ?? new Features()); dr.Geometry = ReadGeometry(rowId); if (FilterDelegate == null || FilterDelegate(dr)) return dr; return null; } throw (new ApplicationException("An attempt was made to read DBase data from a shapefile without a valid .DBF file")); }
/// <summary> /// Initializes a new instance of the <see cref="MemoryProvider"/> /// </summary> /// <param name="features">Features to be included in this datasource</param> public MemoryProvider(IFeatures features) { CRS = ""; Features = features; }
/// <summary> /// Gets a datarow from the datasource at the specified index belonging to the specified datatable /// </summary> /// <param name="RowID"></param> /// <param name="dt">Datatable to feature should belong to.</param> /// <returns></returns> public IFeature GetFeature(uint RowID, IFeatures dt) { if (dbaseFile != null) { IFeature dr = (IFeature)dbaseFile.GetFeature(RowID, (dt == null) ? new Features() : dt); dr.Geometry = ReadGeometry(RowID); if (FilterDelegate == null || FilterDelegate(dr)) return dr; else return null; } else throw (new ApplicationException("An attempt was made to read DBase data from a shapefile without a valid .DBF file")); }
/// <summary> /// Get all features under the subscription. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Management.Resources.IFeatures. /// </param> /// <param name='resourceProviderNamespace'> /// Required. Namespace of the resource provider. /// </param> /// <param name='featureName'> /// Required. Previewed feature name in the resource provider. /// </param> /// <returns> /// Previewed feature information. /// </returns> public static Task <FeatureResponse> GetAsync(this IFeatures operations, string resourceProviderNamespace, string featureName) { return(operations.GetAsync(resourceProviderNamespace, featureName, CancellationToken.None)); }
/// <summary> /// Gets a datarow from the datasource at the specified index belonging to the specified datatable /// </summary> /// <param name="rowId"></param> /// <param name="feature">Datatable to feature should belong to.</param> /// <returns></returns> public IFeature GetFeature(uint rowId, IFeatures feature = null) { lock (_syncRoot) { Open(); try { return GetFeaturePrivate(rowId, feature); } finally { Close(); } } }
/// <summary> /// Initializes a new instance of the <see cref="MemoryProvider"/> /// </summary> /// <param name="features">Features to be included in this datasource</param> public MemoryProvider(IFeatures features) { SRID = -1; Features = features; }
public void ExecuteIntersectionQuery(BoundingBox box, IFeatures table) { throw new NotImplementedException(); }
public void ExecuteIntersectionQuery(Geometry geom, IFeatures table) { throw new NotImplementedException(); }