//private LuaInterface luaInterface; public EventEditorUserControl(FrameType frame, string eventName, FrameXmlDesignerLoader designerLoader, IWindowsFormsEditorService edSvc) : this() { Frame = frame; EventName = eventName; DesignerLoader = designerLoader; this.edSvc = edSvc; //luaInterface = new LuaInterface(this.DesignerLoader); }
/// <summary> /// Retrieves the serialization object hierarchy from the controls /// </summary> /// <returns></returns> private static SerializationObject GetSerializationObject(Controls.ISerializableControl serializableControl) { SerializationObject serializableObject = serializableControl.SerializationObject; serializableObject.Controls.Clear(); Controls.IFrameControl parentFrame = serializableControl as Controls.IFrameControl; if (parentFrame != null) { if (parentFrame.Frames.Count <Controls.IFrameControl>() > 0) { FrameTypeFrames frames = new FrameTypeFrames(); serializableObject.Controls.Add(frames); foreach (var childFrame in parentFrame.Frames) { SerializationObject childObject = GetSerializationObject(childFrame); frames.Controls.Add(childObject); } } Serialization.FrameType frameType = serializableObject as Serialization.FrameType; if (frameType != null) { Dictionary <DRAWLAYER, FrameTypeLayersLayer> layerDictionary = new Dictionary <DRAWLAYER, FrameTypeLayersLayer>(); foreach (Controls.ILayerable layerable in parentFrame.Layerables) { if (!layerDictionary.ContainsKey(layerable.LayerLevel)) { layerDictionary.Add(layerable.LayerLevel, new FrameTypeLayersLayer()); } FrameTypeLayersLayer layer = layerDictionary[layerable.LayerLevel]; layer.level = layerable.LayerLevel; layer.Layerables.Add(layerable.SerializationObject); } frameType.LayersList.Clear(); if (layerDictionary.Count > 0) { FrameTypeLayers layers = new FrameTypeLayers(); layers.Layer.AddRange(layerDictionary.Values); frameType.LayersList.Add(layers); } } } return(serializableObject); }
private static ScriptsType GetScripts(FrameType frame, bool createOnNull) { ScriptsType result = null; if (frame.Scripts.Count == 0) { if (createOnNull) { result = new ScriptsType(); frame.Scripts.Add(result); } } else { for (int index = frame.Scripts.Count - 1; index >= 0; index--) { ScriptsType scripts = frame.Scripts[index]; if (MergeScripts(scripts, result, EventChoice.OnMouseDown) || MergeScripts(scripts, result, EventChoice.OnMouseUp)) { frame.Scripts.Remove(scripts); } } if (result == null) result = frame.Scripts[0]; } return result; }