• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Feature类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Feature的典型用法代码示例。如果您正苦于以下问题:C# Feature类的具体用法?C# Feature怎么用?C# Feature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Feature类属于命名空间,在下文中一共展示了Feature类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Features_IsEnabled_ReturnsTrue_WhenPathIsMoreComplexThanFeatureInRegistry

 public void Features_IsEnabled_ReturnsTrue_WhenPathIsMoreComplexThanFeatureInRegistry()
 {
     // test feature a/b/c where value in registry is just a (signifying all features registered)
     var feature = new Feature("a");
     var attribute = new FeatureAttribute("a", "b", "c");
     Assert.True(Features.IsEnabled(SetupRegistry(feature), new[] { "a", "b", "c" }));
 }
开发者ID:shibbard,项目名称:Multi-tenancy-Sample,代码行数:7,代码来源:FeatureTests.cs


示例2: Scenario

 public Scenario(Feature feature)
 {
     Steps = new List<Step>();
     Components = new List<Component>();
     Container = feature.Container.Scope();
     Props = new Dictionary<string, object>();
 }
开发者ID:kolbasik,项目名称:NBDD,代码行数:7,代码来源:Scenario.cs


示例3: GenericHandler

 public GenericHandler(string contentType, EndpointAttributes handlerAttributes, Feature usesFeature)
 {
     this.HandlerContentType = contentType;
     this.ContentTypeAttribute = ContentType.GetEndpointAttributes(contentType);
     this.HandlerAttributes = handlerAttributes;
     this.usesFeature = usesFeature;
 }
开发者ID:rajeshpillai,项目名称:ServiceStack,代码行数:7,代码来源:GenericHandler.cs


示例4: SetPropertyValue

        public void SetPropertyValue()
        {
            var ft = new Feature(Exp.SomeFeature);
            ft = ft.Set(Exp.SomeProperty, 10);

            Assert.Equal(10, ft.Get(Exp.SomeProperty));
        }
开发者ID:kei10in,项目名称:KipSharp,代码行数:7,代码来源:FeatureTests.cs


示例5: ExceptionsScreen_OnLoaded

        private void ExceptionsScreen_OnLoaded(object sender, RoutedEventArgs e)
        {
            var core = AppContextObsolete.AppContext;
            var feature = new Feature(@"Exceptions", @"Load");
            try
            {
                var s = Stopwatch.StartNew();

                try
                {
                    FeatureManager.CreateSchema(core.DbContextCreator);
                }
                catch { }

                core.FeatureManager.Load(core.DbContextCreator);

                core.FeatureManager.Write(feature, string.Empty);
                this.ViewModel.Load(
                    ExceptionsDataProvider.GetTimePeriods,
                    ExceptionsDataProvider.GetVersions,
                    ExceptionsDataProvider.GetExceptions,
                    ExceptionsDataProvider.GetExceptionsCounts);
                s.Stop();
                Debug.WriteLine(s.ElapsedMilliseconds);
            }
            catch (Exception ex)
            {
                core.Log(ex.ToString(), LogLevel.Error);
                core.FeatureManager.Write(feature, ex);
            }
        }
开发者ID:ppetrov,项目名称:Cchbc,代码行数:31,代码来源:ExceptionsScreen.xaml.cs


示例6: ShouldRecordInstrumentationForIsEnabled

        public void ShouldRecordInstrumentationForIsEnabled([Values(true,false)] Boolean enabled)
        {
            var instrumenter = new MockInstrumenter();
            var feature = new Feature("Name", new MemoryAdapter(), instrumenter);

            if (enabled)
            {
                feature.Enable();
            } else
            {
                feature.Disable();
            }
            instrumenter.Events.Clear();

            feature.IsEnabled();

            var expectedPayload = new InstrumentationPayload {
                FeatureName = "Name",
                Operation = "enabled?",
                Thing = null,
                Result = enabled
            };
            var expectedEvent = new MockInstrumenter.Event {
                Type = InstrumentationType.FeatureOperation,
                Payload = expectedPayload,
            };

            Assert.That(instrumenter.Events, Has.Member(expectedEvent));
        }
开发者ID:paybyphone,项目名称:flipperdotnet,代码行数:29,代码来源:FeatureInstrumentationTests.cs


示例7: CheckFeatureSupport

        /// <summary>
        /// Check if this device is supporting a feature.
        /// </summary>
        /// <param name="feature">The feature to check.</param>
        /// <returns>
        /// Returns true if this device supports this feature, otherwise false.
        /// </returns>
        public bool CheckFeatureSupport(Feature feature)
        {
            unsafe
            {
                switch (feature)
                {
                    case Feature.Doubles:
                        {
                            FeatureDataDoubles support;

                            if (CheckFeatureSupport(Feature.Doubles, new IntPtr(&support), Utilities.SizeOf<FeatureDataDoubles>()).Failure)
                                return false;
                            return support.DoublePrecisionFloatShaderOps;
                        }
                    case Feature.D3D10XHardwareOptions:
                        {
                            FeatureDataD3D10XHardwareOptions support;
                            if (CheckFeatureSupport(Feature.D3D10XHardwareOptions, new IntPtr(&support), Utilities.SizeOf<FeatureDataD3D10XHardwareOptions>()).Failure)
                                return false;
                            return support.ComputeShadersPlusRawAndStructuredBuffersViaShader4X;
                        }
                    default:
                        throw new SharpDXException("Unsupported Feature. Use specialized CheckXXX methods");
                }
            }
        }
开发者ID:nkast,项目名称:SharpDX,代码行数:33,代码来源:EffectContext.cs


示例8: PopupUserControl

        public PopupUserControl(Feature feature)
        {
            InitializeComponent();

            string speed = feature.ColumnValues["Speed"];
            string name = feature.ColumnValues["VehicleName"];
            string latitude = feature.ColumnValues["Latitude"];
            string dateTime = feature.ColumnValues["DateTime"];
            string longitude = feature.ColumnValues["Longitude"];

            txtName.Text = name;
            double x, y;
            if (double.TryParse(longitude, out x) && double.TryParse(latitude, out y))
            {
                ManagedProj4Projection proj4 = new ManagedProj4Projection();
                proj4.InternalProjectionParametersString = Proj4Projection.GetDecimalDegreesParametersString();
                proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
                proj4.Open();

                Vertex vertex = proj4.ConvertToInternalProjection(x, y);
                txtLongitude.Text = vertex.X.ToString("N6", CultureInfo.InvariantCulture);
                txtLatitude.Text = vertex.Y.ToString("N6", CultureInfo.InvariantCulture);

                proj4.Close();
            }
            else
            {
                txtLongitude.Text = longitude;
                txtLatitude.Text = latitude;
            }

            txtSpeed.Text = speed + " mph";
            txtTime.Text = dateTime;
        }
开发者ID:MapSuiteSamples,项目名称:MapSuiteSamples,代码行数:34,代码来源:PopupUserControl.xaml.cs


示例9: Should_set_tags_for_feature_event

 public void Should_set_tags_for_feature_event()
 {
     var feature = new Feature("featureTitle");
     feature.AddTags(new[] { "tag1", "tag2" });
     sut.OnFeatureStartedEvent(feature);
     CollectionAssert.AreEqual(new[] { "tag1", "tag2" }, featureContext.Tags);
 }
开发者ID:smhabdoli,项目名称:NBehave,代码行数:7,代码来源:ContextHandlerSpec.cs


示例10: convertFeatureToWkb_Click

        private void convertFeatureToWkb_Click(object sender, RoutedEventArgs e)
        {
            Feature feature = new Feature(wktTextBox.Text);
            byte[] wellKnownBinary = feature.GetWellKnownBinary();

            wkbResultTextBox.Text = Convert.ToBase64String(wellKnownBinary);
        }
开发者ID:MapSuiteSamples,项目名称:MapSuiteSamples,代码行数:7,代码来源:ConvertAFeatureToAndFromWkb.xaml.cs


示例11: convertWkbToFeature_Click

        private void convertWkbToFeature_Click(object sender, RoutedEventArgs e)
        {
            byte[] wellKnownBinary = Convert.FromBase64String(wkbTextBox.Text);
            Feature feature = new Feature(wellKnownBinary);

            wktResultTextBox.Text = feature.GetWellKnownText();
        }
开发者ID:MapSuiteSamples,项目名称:MapSuiteSamples,代码行数:7,代码来源:ConvertAFeatureToAndFromWkb.xaml.cs


示例12: Should_add_table_steps_to_scenario

        public void Should_add_table_steps_to_scenario()
        {
            var gherkinEvents = MockRepository.GenerateStub<IGherkinParserEvents>();
            var stepBuilder = new StepBuilder(gherkinEvents);
            var feature = new Feature("title");
            var scenario = new Scenario("title", "source", feature);
            gherkinEvents.Raise(_ => _.FeatureEvent += null, this, new EventArgs<Feature>(feature));
            gherkinEvents.Raise(_ => _.ScenarioEvent += null, this, new EventArgs<Scenario>(scenario));
            gherkinEvents.Raise(_ => _.StepEvent += null, this, new EventArgs<StringStep>(new StringStep("step 1", "source")));
            gherkinEvents.Raise(_ => _.StepEvent += null, this, new EventArgs<StringStep>(new StringStep("step 2", "source")));
            gherkinEvents.Raise(_ => _.TableEvent += null, this,
                                new EventArgs<IList<IList<Token>>>(new List<IList<Token>>
                                                                       {
                                                                           new List<Token>
                                                                               {
                                                                                   new Token("A", new LineInFile(1)),
                                                                                   new Token("B", new LineInFile(1))
                                                                               },
                                                                           new List<Token>
                                                                               {
                                                                                   new Token("1", new LineInFile(2)),
                                                                                   new Token("2", new LineInFile(2))
                                                                               },

                                                                       }));
            gherkinEvents.Raise(_ => _.EofEvent += null, this, new EventArgs());

            Assert.That(scenario.Steps.Count(), Is.EqualTo(2));
            Assert.That(scenario.Steps.ToList()[0], Is.TypeOf<StringStep>());
            Assert.That(scenario.Steps.ToList()[1], Is.TypeOf<StringTableStep>());
        }
开发者ID:smhabdoli,项目名称:NBehave,代码行数:31,代码来源:StepBuilderSpec.cs


示例13: FeaturesAreNotSame

        public void FeaturesAreNotSame()
        {
            var feature1 = new Feature<Point>
            {
                Geometry = new Point { X = 50.342, Y = -2, SpatialReference = SpatialReference.WGS84 }
            };

            var feature2 = new Feature<Point>
            {
                Geometry = new Point { X = 50.342, Y = -30.331, SpatialReference = SpatialReference.WGS84 }
            };

            var feature3 = new Feature<Point>
            {
                Geometry = new Point { X = 50.342, Y = -30.331, SpatialReference = SpatialReference.WGS84 }
            };
            feature3.Attributes.Add("random", "rtcxbvbx");
            feature3.Attributes.Add("something", 45445);

            var feature4 = new Feature<Point>
            {
                Geometry = new Point { X = 50.342, Y = -30.331, SpatialReference = SpatialReference.WGS84 }
            };
            feature4.Attributes.Add("random", "rtcxbvbx");
            feature4.Attributes.Add("something", 4);

            Assert.NotEqual(feature1, feature2);
            Assert.NotEqual(feature3, feature4);
            Assert.NotEqual(feature1, feature3);
            Assert.NotEqual(feature1, feature4);
            Assert.NotEqual(feature2, feature3);
            Assert.NotEqual(feature2, feature4);
        }
开发者ID:pheede,项目名称:ArcGIS.PCL,代码行数:33,代码来源:GeometryTests.cs


示例14: Main

    public static void Main(string[] args)
    {
        var binaries = new Feature("MyApp Binaries", "Application binaries");
        var docs = new Feature("MyApp Documentation");
        var tuts = new Feature("MyApp Tutorial");

        docs.Add(tuts);
        binaries.Add(docs);

        var project =
            new Project("MyProduct",
                new Dir(@"%ProgramFiles%\My Company\My Product",
                    new File(binaries, @"Files\Bin\MyApp.exe"),
                    new Dir(@"Docs\Manual",
                        new File(docs, @"Files\Docs\Manual.txt"),
                        new File(tuts, @"Files\Docs\Tutorial.txt"))));

        project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
        project.UI = WUI.WixUI_FeatureTree;

        project.DefaultFeature = binaries; //this line is optional

        project.PreserveTempFiles = true;

        project.BuildMsi();
    }
开发者ID:Eun,项目名称:WixSharp,代码行数:26,代码来源:setup.cs


示例15: SetUp

 public void SetUp()
 {
     FlipperActor = MockActor("User:5");
     StatsdClient = MockRepository.GenerateStub<IStatsd>();
     Instrumenter = new StatsdInstrumenter(StatsdClient);
     Feature = new Feature("Name", new MemoryAdapter(), Instrumenter);
 }
开发者ID:paybyphone,项目名称:flipperdotnet,代码行数:7,代码来源:StatsdFeatureInstrumenterIntegrationTests.cs


示例16: Should_update_featureContext_with_feature_title

 public void Should_update_featureContext_with_feature_title()
 {
     const string featureTitle = "feature title";
     var f = new Feature(featureTitle);
     sut.OnFeatureStartedEvent(f);
     Assert.That(featureContext.FeatureTitle, Is.EqualTo(featureTitle));
 }
开发者ID:smhabdoli,项目名称:NBehave,代码行数:7,代码来源:ContextHandlerSpec.cs


示例17: FeatureNode

 public FeatureNode(FileSystemInfoBase location, string relativePathFromRoot, Feature feature)
 {
     this.OriginalLocation = location;
     this.OriginalLocationUrl = location.ToUri();
     this.RelativePathFromRoot = relativePathFromRoot;
     this.Feature = feature;
 }
开发者ID:Jaykul,项目名称:pickles,代码行数:7,代码来源:FeatureNode.cs


示例18: btnBegin_Click

        private void btnBegin_Click(object sender, RoutedEventArgs e)
        {
            int pointsCount = Convert.ToInt32(((ComboBoxItem)cbxPointCount.SelectedItem).Content);
            LayerOverlay pointsOverlay = (LayerOverlay)wpfMap1.Overlays["PointsOverlay"];
            InMemoryFeatureLayer pointsLayer = (InMemoryFeatureLayer)pointsOverlay.Layers["PointsLayer"];

            pointsLayer.InternalFeatures.Clear();
            for (int i = 0; i < pointsCount; i++)
            {
                PointShape pointShape = GetRandomPoint(pointsBoundary);
                string id = GetRandomDirection().ToString();
                Feature feature = new Feature(pointShape.X, pointShape.Y, id);
                pointsLayer.InternalFeatures.Add(feature);
            }

            pointsOverlay.Refresh();

            // Starts the move points timer
            movePointsTimer.Change(0, Convert.ToInt32(((ComboBoxItem)cbxRedrawInterval.SelectedItem).Content));

            // Starts the color changing timer
            changeColorTimer.Change(0, Convert.ToInt32(((ComboBoxItem)cbxChangeColorInterval.SelectedItem).Content));

            btnBegin.IsEnabled = false;
            btnStop.IsEnabled = true;
        }
开发者ID:MapSuiteSamples,项目名称:MapSuiteSamples,代码行数:26,代码来源:RefreshPointsRandomly.xaml.cs


示例19: DynamicEnabledFeatureIsEnabled

 public void DynamicEnabledFeatureIsEnabled()
 {
     var method = typeof(FeatureFacts)
         .GetMethod("Enabled");
     var feature = new Feature("DynamicDisabled", method);
     Assert.True(feature.IsEnabled);
 }
开发者ID:jleight,项目名称:feature-flags,代码行数:7,代码来源:FeatureFacts.cs


示例20: LogFeature

    public static void LogFeature(Feature feature)
    {
        System.Console.WriteLine("-----------------");
        System.Console.WriteLine("Feature : "+feature.Reference);
        System.Console.WriteLine("Feature is lifetime : "+feature.IsLifetime());

        if( !feature.IsLifetime() )
        {
            System.Console.WriteLine("Feature TTL : "+feature.Ttl);
        }

        System.Console.WriteLine("Feature has value : "+feature.HasValue());

        if( feature.HasValue() )
        {
            System.Console.WriteLine("Feature value : "+feature.Value);
        }

        System.Console.WriteLine("Feature is in bundle : "+feature.IsInBundle());

        if( feature.IsInBundle() )
        {
            System.Console.WriteLine("Feature bundle : "+feature.BundleReference);
        }

        System.Console.WriteLine("-----------------");
    }
开发者ID:BatchLabs,项目名称:unity-plugin,代码行数:27,代码来源:LoggerHelper.cs



注:本文中的Feature类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FeatureBaseEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# FeaEntidades类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap