private XElement _WriteControllerLink(ControllerLink controllerLink) { XElement element = new XElement(ELEMENT_CONTROLLER_LINK, new XAttribute(ATTR_ID, controllerLink.ControllerId), new XAttribute(ATTR_PRIOR_ID, controllerLink.PriorId ?? Guid.Empty), new XAttribute(ATTR_NEXT_ID, controllerLink.NextId ?? Guid.Empty)); return(element); }
/// <summary> /// Constructs an object of type Controller. /// </summary> /// <param name="_canvas">canvas where the oscillator is on it</param> /// <param name="x">Coordonne x</param> /// <param name="y">Coordonne y</param> /// <param name="_width">The size of each object's side</param> protected Controller(Canvas _canvas, int _x, int _y, double _width) { Canvas = _canvas; x = _x; y = _y; height = _width; width = _width; #region Create the main form. // The shape is created depending of the input. Rect rect = new Rect(new Size(width, height)); EllipseGeometry rectangleGeometry = new EllipseGeometry(rect); geometricShape = new Path(); geometricShape.Data = rectangleGeometry; geometricShape.Width = width; geometricShape.Height = height; Canvas.SetTop(geometricShape, y - height / 2); Canvas.SetLeft(geometricShape, x - width / 2); // set Z index for the geometric shape for hidding connection line Canvas.SetZIndex(geometricShape, 1); #endregion Create the main form. // RenderTransform part initializationInputStuff(); // Add the object on the canvas. Canvas.Children.Add(geometricShape); drawRightArc(); drawLeftArc(); drawPointerArcLeft(); drawPointerArcRight(); drawingCollisionSurface(300); drawSubtypeMenubButton(); // Initialization of his output. outputLink = new ControllerLink(); // Initialization of the list. checkRadius(ReactableObject.ReactableObjectList); // Set the opacity of the collision surface, it will be appear when the user click on the object collisionSurface.Opacity = 0; // The dispatcher check the connection. connectionChecker = new DispatcherTimer(new TimeSpan(1000 * 100), //time interval, timespam( 10^-7/init) DispatcherPriority.Normal, //priority delegate { outputLink.checkingConnection(this); }, geometricShape.Dispatcher); }