public override Task Rebuild()
        {
            this.DebugDepth("Rebuild");

            using (RebuildLock())
            {
                ResetPositions();

                this.Children.Modify(list =>
                {
                    if (list.Count == 0)
                    {
                        return;
                    }

                    var anchorBounds = AnchorBounds;
                    var children     = list.Where(c => c.GetType() != typeof(OperationSourceObject3D) &&
                                                  c.ID != SelectedChild.FirstOrDefault());

                    // align all the objects to the anchor
                    foreach (var child in children)
                    {
                        AlignAxis(0, XAlign, GetAlignToOffset(anchorBounds, 0, (!Advanced || XAlignTo == Align.None) ? XAlign : XAlignTo), XOffset.Value(this), child);
                        AlignAxis(1, YAlign, GetAlignToOffset(anchorBounds, 1, (!Advanced || YAlignTo == Align.None) ? YAlign : YAlignTo), YOffset.Value(this), child);
                        AlignAxis(2, ZAlign, GetAlignToOffset(anchorBounds, 2, (!Advanced || ZAlignTo == Align.None) ? ZAlign : ZAlignTo), ZOffset.Value(this), child);
                    }
                });
            }

            Parent?.Invalidate(new InvalidateArgs(this, InvalidateType.Matrix));
            return(Task.CompletedTask);
        }
Beispiel #2
0
        private void GoToSettings()
        {
            if (SelectedChild.GetType() == typeof(SettingsHostViewModel))
            {
                return;
            }

            if (toSettings != SelectedChild.GetType())
            {
                toSettings = SelectedChild.GetType();
            }
            SelectedChild = GetChild <SettingsHostViewModel>();
        }
        public static void Attach(string alias)
        {
            Tuple <string, Process> child;

            Attached = Childs.TryGetValue(alias, out child);

            if (Attached && child != null)
            {
                // Clear the console.
                Log.Clear();

                // Show current console int title.
                Console.Title = $"Current console: {child.Item1} ({alias})";

                SelectedChild = child.Item2;
                SelectedChild.BeginOutputReadLine();
            }
        }
        public static void Attach(string alias)
        {
            Attached = Childs.TryGetValue(alias, out var child);

            if (Attached && child != null)
            {
                // Clear the console.
                Log.Clear();

                ConsoleCommandManager.CommandPrefix = $"{alias}@{servers.Single(s => s.Value == child.Item1).Key}:$ ";

                System.Console.Title = $"Current console: {child.Item1} ({alias})";

                SelectedChild = child.Item2;
                SelectedChild.BeginOutputReadLine();
            }
            else
            {
                Log.Message(LogTypes.Warning, $"Cannot attach: Server '{alias}' doesn't exists.");
            }
        }