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


C# MathIdentifier.DerivePostfix方法代码示例

本文整理汇总了C#中MathIdentifier.DerivePostfix方法的典型用法代码示例。如果您正苦于以下问题:C# MathIdentifier.DerivePostfix方法的具体用法?C# MathIdentifier.DerivePostfix怎么用?C# MathIdentifier.DerivePostfix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MathIdentifier的用法示例。


在下文中一共展示了MathIdentifier.DerivePostfix方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DerivativeTransformation

 public DerivativeTransformation(MathIdentifier supportedEntityId, EstimateDerivePlan plan, Derive derive)
     : this(supportedEntityId.DerivePostfix("Derivative"), supportedEntityId, plan, derive)
 {
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:4,代码来源:DerivativeTransformation.cs

示例2: RemoteEventTriggersTest

        public void RemoteEventTriggersTest()
        {
            MathIdentifier flagId = new MathIdentifier("TX_F", "FundamentTest");

            NodeFlag flag = NodeFlag.Register(flagId, typeof(FundamentTest));

            NodeFlag flagEnableRemote = NodeFlag.Register(flagId.DerivePostfix("EnableRemote"), typeof(FundamentTest), FlagKind.Default,
                new NodeEventTrigger(EventTriggerAction.Enable, flag, flag.FlagEnabledEvent));
            NodeFlag flagEnableLocal = NodeFlag.Register(flagId.DerivePostfix("EnableLocal"), typeof(FundamentTest), FlagKind.Default,
                new NodeEventTrigger(EventTriggerAction.Enable, flag.FlagEnabledEvent));

            NodeFlag flagDisableRemote = NodeFlag.Register(flagId.DerivePostfix("DisableRemote"), typeof(FundamentTest), FlagKind.Default,
                new NodeEventTrigger(EventTriggerAction.Disable, flag, flag.FlagChangedEvent));
            NodeFlag flagDisableLocal = NodeFlag.Register(flagId.DerivePostfix("DisableLocal"), typeof(FundamentTest), FlagKind.Default,
                new NodeEventTrigger(EventTriggerAction.Disable, flag.FlagChangedEvent));

            NodeObject n = new NodeObject();
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flag), "A01");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagEnableRemote), "A02");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagEnableLocal), "A03");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagDisableRemote), "A04");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagDisableLocal), "A05");

            n.EnableFlag(flag);
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flag), "B01");
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flagEnableRemote), "B02");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagEnableLocal), "B03");
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flagDisableRemote), "B04");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagDisableLocal), "B05");

            n.ClearFlag(flag);
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flag), "C01");
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flagEnableRemote), "C02");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagEnableLocal), "C03");
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flagDisableRemote), "C04");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagDisableLocal), "C05");

            n.EnableFlag(flagDisableLocal);
            n.DisableFlag(flagEnableLocal);
            n.ClearFlag(flagDisableRemote);
            n.ClearFlag(flagEnableRemote);
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flag), "D01");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagEnableRemote), "D02");
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flagEnableLocal), "D03");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagDisableRemote), "D04");
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flagDisableLocal), "D05");

            n.DisableFlag(flag);
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flag), "E01");
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flagEnableRemote), "E02");
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flagEnableLocal), "E03");
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flagDisableRemote), "E04");
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flagDisableLocal), "E05");

            n.EnableFlag(flag);
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flag), "F01");
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flagEnableRemote), "F02");
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flagEnableLocal), "F03");
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flagDisableRemote), "F04");
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flagDisableLocal), "F05");
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:61,代码来源:FundamentTest.cs

示例3: PropertyTriggerTest

        public void PropertyTriggerTest()
        {
            MathIdentifier propertyId = new MathIdentifier("T2_PT", "FundamentTest");

            NodeEvent clearEvent = NodeEvent.Register(propertyId.DerivePostfix("ClearTrigger"), typeof(EventHandler), typeof(FundamentTest));
            NodeEvent clear2Event = NodeEvent.Register(propertyId.DerivePostfix("Clear2Trigger"), typeof(EventHandler), typeof(FundamentTest));
            NodeEvent clear3Event = NodeEvent.Register(propertyId.DerivePostfix("Clear3Trigger"), typeof(EventHandler), typeof(FundamentTest));
            NodeEvent reevaluateEvent = NodeEvent.Register(propertyId.DerivePostfix("ReevaluateTrigger"), typeof(EventHandler), typeof(FundamentTest));

            NodeProperty property = NodeProperty.Register(propertyId, typeof(string), typeof(FundamentTest),
                new NodeEventTrigger(EventTriggerAction.Clear, clearEvent, clear2Event),
                new NodeEventTrigger(EventTriggerAction.Clear, clear3Event),
                new NodeEventTrigger(EventTriggerAction.Reevaluate, reevaluateEvent));

            NodeObject n = new NodeObject();
            Assert.IsFalse(n.IsPropertySet(property), "A01");

            n.SetProperty(property, "test");
            Assert.IsTrue(n.IsPropertySet(property), "B01");

            n.RaiseEvent(clearEvent, EventArgs.Empty);
            Assert.IsFalse(n.IsPropertySet(property), "C01");

            n.SetProperty(property, "test2");
            Assert.IsTrue(n.IsPropertySet(property), "D01");
            Assert.AreEqual("test2", n.GetProperty(property), "D02");

            n.RaiseEvent(reevaluateEvent, EventArgs.Empty);
            Assert.IsTrue(n.IsPropertySet(property), "E01");
            Assert.AreEqual("test2", n.GetProperty(property), "E02");

            n.RaiseEvent(clear2Event, EventArgs.Empty);
            Assert.IsFalse(n.IsPropertySet(property), "F01");

            n.SetProperty(property, "test3");
            Assert.IsTrue(n.IsPropertySet(property), "G01");

            n.RaiseEvent(clear3Event, EventArgs.Empty);
            Assert.IsFalse(n.IsPropertySet(property), "H01");
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:40,代码来源:FundamentTest.cs

示例4: FlagTriggerTest

        public void FlagTriggerTest()
        {
            MathIdentifier flagId = new MathIdentifier("T3_FT", "FundamentTest");

            NodeEvent clearEvent = NodeEvent.Register(flagId.DerivePostfix("ClearTrigger"), typeof(EventHandler), typeof(FundamentTest));
            NodeEvent enableEvent = NodeEvent.Register(flagId.DerivePostfix("EnableTrigger"), typeof(EventHandler), typeof(FundamentTest));
            NodeEvent disableEvent = NodeEvent.Register(flagId.DerivePostfix("DisableTrigger"), typeof(EventHandler), typeof(FundamentTest));
            NodeEvent disable2Event = NodeEvent.Register(flagId.DerivePostfix("Disable2Trigger"), typeof(EventHandler), typeof(FundamentTest));
            NodeEvent reevaluateEvent = NodeEvent.Register(flagId.DerivePostfix("ReevaluateTrigger"), typeof(EventHandler), typeof(FundamentTest));

            NodeFlag flag = NodeFlag.Register(flagId, typeof(FundamentTest), FlagKind.Default,
                new NodeEventTrigger(EventTriggerAction.Clear, clearEvent),
                new NodeEventTrigger(EventTriggerAction.Enable, enableEvent),
                new NodeEventTrigger(EventTriggerAction.Disable, disableEvent, disable2Event),
                new NodeEventTrigger(EventTriggerAction.Reevaluate, reevaluateEvent));

            NodeObject n = new NodeObject();
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flag), "A01");

            n.EnableFlag(flag);
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flag), "B01");

            n.RaiseEvent(disableEvent, EventArgs.Empty);
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flag), "C01");

            n.RaiseEvent(enableEvent, EventArgs.Empty);
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flag), "D01");

            n.RaiseEvent(reevaluateEvent, EventArgs.Empty);
            Assert.AreEqual(FlagState.Enabled, n.GetFlagState(flag), "E01");

            n.RaiseEvent(disable2Event, EventArgs.Empty);
            Assert.AreEqual(FlagState.Disabled, n.GetFlagState(flag), "F01");

            n.RaiseEvent(clearEvent, EventArgs.Empty);
            Assert.AreEqual(FlagState.Unknown, n.GetFlagState(flag), "G01");
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:37,代码来源:FundamentTest.cs

示例5: AutoSimplifyTransformation

 public AutoSimplifyTransformation(MathIdentifier supportedEntityId, EstimatePlan plan, ManipulatePort simplify)
     : this(supportedEntityId.DerivePostfix("AutoSimplify"), delegate() { return new Pattern(new EntityCondition(supportedEntityId)); }, plan, simplify)
 {
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:4,代码来源:AutoSimplifyTransformation.cs


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