當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。