Example #1
0
        public async void Save()
        {
            HistoryClient entry = BlendFarmSettings.Instance.PastClients?.FirstOrDefault(x => x.Key == Node.Name).Value;

            if (entry == null)
            {
                if (!await YesNoWindow.Show(this, "Node not saved yet", "The node was not yet saved, would you like to save it?"))
                {
                    return;
                }
                else
                {
                    entry = new HistoryClient()
                    {
                        Name       = Node.Name,
                        Address    = Node.Address,
                        RenderType = Node.RenderType
                    };
                    BlendFarmSettings.Instance.PastClients.Add(Node.Name, entry);
                }
            }
            Node.RenderType  = ((RenderType)selectRenderType.SelectedItem);
            entry.RenderType = Node.RenderType;
            BlendFarmSettings.Instance.Save();
        }
        public static async Task <bool> Show(Window owner, string title, string desc)
        {
            var window = new YesNoWindow(title, desc);

            window.Position = new PixelPoint((int)(owner.Position.X + ((owner.Width / 2) - window.Width / 2)), (int)(owner.Position.Y + ((owner.Height / 2) - window.Height / 2)));

            await window.ShowDialog(owner);

            return(window.Response);
        }