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


C# BaseEvent.OnSave方法代码示例

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


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

示例1: CreateWrapper

            public static BaseEvent CreateWrapper(BaseEvent original, Action<BaseEvent, bool> passthrough, bool ignore_delay)
            {
                ConfigNode cn = new ConfigNode();
                original.OnSave(cn);
                Wrapper wrapper = new Wrapper(original, passthrough, ignore_delay);
                BaseEvent new_event = new BaseEvent(original.listParent, original.name, wrapper.Invoke);
                new_event.OnLoad(cn);

                return new_event;
            }
开发者ID:Eurousalas,项目名称:RemoteTech2,代码行数:10,代码来源:UIPartActionMenuPatcher.cs

示例2: Wrap

            public static BaseEvent Wrap(BaseEvent original, Action<BaseEvent> passthrough)
            {
                ConfigNode cn = new ConfigNode();
                original.OnSave(cn);
                Wrapper wrapper = new Wrapper(original, passthrough);
                BaseEvent new_event = new BaseEvent(original.listParent, original.name,
                                                                         wrapper.Invoke);
                new_event.OnLoad(cn);

                return new_event;
            }
开发者ID:Guardian259,项目名称:RemoteTechExtended,代码行数:11,代码来源:UIPartActionMenuPatcher.cs

示例3: CreateWrapper

            public static BaseEvent CreateWrapper(BaseEvent original, Action<BaseEvent, bool> passthrough, bool ignoreDelay, KSPEvent kspEvent)
            {
                // Create a new configuration node and fill this node with the original base event with the values
                ConfigNode cn = new ConfigNode();
                original.OnSave(cn);

                // create the wrapper (used solely for its Invoke() method)
                // this class keeps the:
                // * pass through event (leading to the ModuleSPU.InvokeEvent() method)
                // * the original event (button click event)
                // * the ignore delay boolean value (true if the event ignore delay, false otherwise)
                EventWrapper wrapper = new EventWrapper(original, passthrough, ignoreDelay);
                // Create a new event, its main features are:
                // 1. It retains its original base event invokable method: invokable directly through its InvokeOriginalEvent() method [useful for other mods, e.g. kOS]
                // 2. Its new invoke() method which is in this wrapper class and decorated with and new KSPEvent category, namely "skip_control" (meaning we have already seen this event).
                BaseEvent newEvent = new WrappedEvent(original, original.listParent, original.name, wrapper.Invoke, kspEvent);

                // load the original base event values into the new base event
                newEvent.OnLoad(cn);

                return newEvent;
            }
开发者ID:RemoteTechnologiesGroup,项目名称:RemoteTech,代码行数:22,代码来源:UIPartActionMenuPatcher.cs


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