当前位置: 首页>>代码示例>>C#>>正文


C# Feature类代码示例

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


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


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