Exemplo n.º 1
0
        private static bool ShowInfoDialog(ref IPHostEntry Host, ref byte Version, ref bool Expansion)
        {
            ServerInfoDlg dlg = new ServerInfoDlg();

            if (Host != null)
            {
                dlg.Host      = Host;
                dlg.Expansion = Expansion;
                dlg.Version   = Version;
            }
            if (dlg.ShowDialog() == DialogResult.Cancel)
            {
                return(false);
            }

            Host      = dlg.Host;
            Version   = dlg.Version;
            Expansion = dlg.Expansion;
            dlg.Dispose();

            // TODO: Should this store the ip address or the hostname?
            Registry.SetValue(mRegPath, "ServerName", Host.HostName, RegistryValueKind.String);
            Registry.SetValue(mRegPath, "Expansion", Expansion ? 1 : 0, RegistryValueKind.DWord);
            Registry.SetValue(mRegPath, "WC3Version", Version, RegistryValueKind.DWord);
            return(true);
        }
Exemplo n.º 2
0
        public static bool ShowInfoDialog(ServerInfo serverInfo)
        {
            using (var dlg = new ServerInfoDlg(serverInfo))
            {
                if (dlg.ShowDialog() == DialogResult.Cancel)
                {
                    return(false);
                }
            }

            SaveServerInfo(serverInfo);

            return(true);
        }
Exemplo n.º 3
0
        private static bool ShowInfoDialog(ServerConfiguration serverConfiguration)
        {
            ServerInfoDlg dlg = new ServerInfoDlg();

            if (serverConfiguration != null)
            {
                dlg.Host      = serverConfiguration.Host;
                dlg.Expansion = serverConfiguration.Expansion;
                dlg.Version   = serverConfiguration.Version;
            }
            if (dlg.ShowDialog() == DialogResult.Cancel)
            {
                return(false);
            }

            serverConfiguration.Host      = dlg.Host;
            serverConfiguration.Version   = dlg.Version;
            serverConfiguration.Expansion = dlg.Expansion;
            dlg.Dispose();

            return(true);
        }
Exemplo n.º 4
0
        private static bool ShowInfoDialog(ref IPHostEntry Host, ref byte Version, ref bool Expansion)
        {
            ServerInfoDlg dlg = new ServerInfoDlg();
            if (Host != null)
            {
                dlg.Host = Host;
                dlg.Expansion = Expansion;
                dlg.Version = Version;
            }
            if (dlg.ShowDialog() == DialogResult.Cancel)
                return false;

            Host = dlg.Host;
            Version = dlg.Version;
            Expansion = dlg.Expansion;
            dlg.Dispose();

            // TODO: Should this store the ip address or the hostname?
            Registry.SetValue(mRegPath, "ServerName", Host.HostName, RegistryValueKind.String);
            Registry.SetValue(mRegPath, "Expansion", Expansion ? 1 : 0, RegistryValueKind.DWord);
            Registry.SetValue(mRegPath, "WC3Version", Version, RegistryValueKind.DWord);
            return true;
        }