protected void UnlinkSelf() { prevSibling.nextSibling = nextSibling; nextSibling.prevSibling = prevSibling; prevSibling = null; nextSibling = null; parent = null; }
public void AddChildAuto(DebugUiControl control) { control.LocalX = nextX; control.LocalY = nextY; AddChild(control); nextX += control.Width; currentLineHeight = Math.Max(currentLineHeight, control.Height); }
public void RemoveAllChildren() { var node = firstChild; while (node != null) { var next = node.nextSibling; node.Dispose(); node = next; } firstChild = null; lastChild = null; }
public virtual void Dispose() { if (manager != null) { manager.OnDispose(this); manager = null; } RemoveAllChildren(); parent = null; prevSibling = null; nextSibling = null; firstChild = null; lastChild = null; }
void LinkToTail(DebugUiControl control) { control.nextSibling = null; if (firstChild == null) { firstChild = control; lastChild = control; control.prevSibling = null; } else { lastChild.nextSibling = control; control.prevSibling = lastChild; lastChild = control; } }
public void AddChild(DebugUiControl control) { control.parent = this; LinkToTail(control); }
private ElementCompileTreeNode HandleProducerElement(ElementCompileTreeNode element, List <PropertyCompileTreeNode> newProperties, string defaultOverloadPropertyName) { PropertyAssigner.AssignPropertiesToProducer(element, _compileContext); string replacingPropertyName = CompilerGlobals.DefaultPropertyName; if (defaultOverloadPropertyName != null) { replacingPropertyName = defaultOverloadPropertyName; } var replacingProperty = new PropertyCompileTreeNode(replacingPropertyName, element.XmlSourceNodeInformation); object result = ProducerMediatorPluginFacade.EvaluateProducer(element.XmlSourceNodeInformation.NamespaceURI, element.Producer); if (result is BindingProducer) { var bindingProducer = (BindingProducer)result; if (string.IsNullOrEmpty(bindingProducer.name)) { throw new FormCompileException("A binding declaraions is missing its name attribute", element.XmlSourceNodeInformation); } if (!_compileContext.RegistarBindingName(bindingProducer.name)) { throw new FormCompileException(string.Format("Name binding name {0} is used twice which is not allowed", bindingProducer.name), element.XmlSourceNodeInformation); } //if (_compileContext.GetBindingObject(bindingProducer.name) == null && !bindingProducer.optional) //{ // throw new FormCompileException(string.Format("The non optional binding {0} is missing its binding value", bindingProducer.name), element.XmlSourceNodeInformation); //} Type type = TypeManager.GetType(bindingProducer.type); _compileContext.SetBindingType(bindingProducer.name, type); } else if (_withDebug && result is IUiControl) { IUiControl uiControl = result as IUiControl; string debugControlNamespace; string debugControlName; UiControlFactoryPluginFacade.GetDebugControlName(_compileContext.CurrentChannel, out debugControlNamespace, out debugControlName); DebugUiControl debug = ProducerMediatorPluginFacade.CreateProducer(_compileContext.CurrentChannel, debugControlNamespace, debugControlName) as DebugUiControl; debug.UiControlID = _compileContext.GetNextDebugControlId; debug.UiControl = uiControl; result = debug; debug.UiControlID = uiControl.UiControlID; debug.TagName = element.XmlSourceNodeInformation.TagName; debug.SourceElementXPath = element.XmlSourceNodeInformation.XPath; foreach (CompileContext.IRebinding rd in _compileContext.Rebindings) { if (ReferenceEquals(uiControl, rd.SourceProducer)) { debug.Bindings.Add(new DebugUiControl.BindingInformation( rd.BindingObjectName, rd.DestinationObjectType, rd.PropertyName)); } } } replacingProperty.Value = result; newProperties.Add(replacingProperty); return(null); }
public void OnDispose(DebugUiControl control) { instances.Remove(control); }
public void OnCreate(DebugUiControl control) { // IDは連番なので、生成された順にaddしていくと自動的にIDでソートされる instances.Add(control); }
public void Add(DebugUiControl control) { root.AddChild(control); }