Exemplo n.º 1
0
        public static bool TryCreateCoalition(out Coalition coalition)
        {
            var dialog = new EditCoalitionDialog
            {
                Title = "Add Coalition"
            };

            return(TryGetResult(out coalition, dialog));
        }
Exemplo n.º 2
0
        public static bool TryEditCoalition(Coalition editInput, out Coalition result)
        {
            var dialog = new EditCoalitionDialog
            {
                TxtName            = { Text = editInput.Name },
                TxtMemberAlliances = { Text = string.Join(",\n", editInput.MemberAlliances) },
                Title = "Edit Coalition"
            };

            return(TryGetResult(out result, dialog));
        }
Exemplo n.º 3
0
        private static bool TryGetResult(out Coalition coalition, EditCoalitionDialog dialog)
        {
            if (dialog.ShowDialog().GetValueOrDefault())
            {
                coalition = new Coalition
                {
                    Name            = dialog.TxtName.Text,
                    MemberAlliances = dialog.TxtMemberAlliances.Text.Split(',', ':', ';').Select(x => x.Trim()).OrderBy(x => x).ToList()
                };

                return(true);
            }

            coalition = null;
            return(false);
        }
Exemplo n.º 4
0
 protected bool Equals(Coalition other)
 {
     return(string.Equals(Name, other.Name));
 }