상속: IContainer, IHasDesiredSize
예제 #1
0
 /// <summary>
 /// The draw single container.
 /// </summary>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <param name="layout">
 /// The layout.
 /// </param>
 /// <param name="singleContainer">
 /// The single container.
 /// </param>
 public void DrawSingleContainer(IRenderContext context, Rectangle layout, SingleContainer singleContainer)
 {
     this.DrawSunken(context, layout);
 }
예제 #2
0
 /// <summary>
 /// The draw single container.
 /// </summary>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <param name="layout">
 /// The layout.
 /// </param>
 /// <param name="singleContainer">
 /// The single container.
 /// </param>
 public void DrawSingleContainer(IRenderContext context, Rectangle layout, SingleContainer singleContainer)
 {
     this.DrawSunken(context, layout);
 }
예제 #3
0
 /// <summary>
 /// The finish layout.
 /// </summary>
 /// <param name="editorContainer">
 /// The editor container.
 /// </param>
 /// <param name="assetManager">
 /// The asset manager.
 /// </param>
 public virtual void FinishLayout(SingleContainer editorContainer, IAssetManager assetManager)
 {
 }
예제 #4
0
 /// <summary>
 /// The build layout.
 /// </summary>
 /// <param name="editorContainer">
 /// The editor container.
 /// </param>
 /// <param name="assetManager">
 /// The asset manager.
 /// </param>
 public abstract void BuildLayout(SingleContainer editorContainer, IAssetManager assetManager);
예제 #5
0
 public void DrawSingleContainer(IRenderContext context, Rectangle layout, SingleContainer singleContainer)
 {
 }
예제 #6
0
        public IContainer Process(XmlNode node, Action <UserInterfaceBehaviourEvent, object> eventCallback, out Action <XmlNode, IContainer> processChild)
        {
            IContainer container;

            switch (node?.Attributes?["type"]?.Value)
            {
            case "horizontal":
                var horizontalContainer = new HorizontalContainer();
                processChild = (childNode, childContainer) =>
                {
                    horizontalContainer.AddChild(childContainer, childNode?.Attributes?["width"]?.Value ?? "*");
                };
                container = horizontalContainer;
                break;

            case "vertical":
                var verticalContainer = new VerticalContainer();
                processChild = (childNode, childContainer) =>
                {
                    verticalContainer.AddChild(childContainer, childNode?.Attributes?["height"]?.Value ?? "*");
                };
                container = verticalContainer;
                break;

            case "single":
                var singleContainer = new SingleContainer();
                processChild = (childNode, childContainer) =>
                {
                    singleContainer.SetChild(childContainer);
                };
                container = singleContainer;
                break;

            case "scrollable":
                var scrollableContainer = new ScrollableContainer();
                processChild = (childNode, childContainer) =>
                {
                    scrollableContainer.SetChild(childContainer);
                };
                container = scrollableContainer;
                break;

            case "relative":
                var relativeContainer = new RelativeContainer();
                processChild = (childNode, childContainer) =>
                {
                    relativeContainer.AddChild(childContainer, new Rectangle(
                                                   GetAttribute(childNode, "x"),
                                                   GetAttribute(childNode, "y"),
                                                   GetAttribute(childNode, "width"),
                                                   GetAttribute(childNode, "height")));
                };
                container = relativeContainer;
                break;

            case "adjusted":
                var adjustedContainer = new AdjustedContainer(new Point(
                                                                  GetAttribute(node, "anchorX"),
                                                                  GetAttribute(node, "anchorY")));
                processChild = (childNode, childContainer) =>
                {
                    adjustedContainer.AddChild(childContainer, new Rectangle(
                                                   GetAttribute(childNode, "x"),
                                                   GetAttribute(childNode, "y"),
                                                   GetAttribute(childNode, "width"),
                                                   GetAttribute(childNode, "height")));
                };
                container = adjustedContainer;
                break;

            case "empty":
                container    = new EmptyContainer();
                processChild = (childNode, childContainer) => { };
                break;

            default:
                processChild = (childNode, childContainer) => { };
                return(null);
            }

            return(container);
        }