コード例 #1
0
        public void ApplyToggleSettings(IGSToggleSettings settings)
        {
            ToggleSettings = settings;

            if (Connected)
            {
                WriteLine("toggle open " + Convert.ToInt32(ToggleSettings.Open));
                WriteLine("toggle looking " + Convert.ToInt32(ToggleSettings.Looking));
                WriteLine("toggle kibitz " + Convert.ToInt32(ToggleSettings.Kibitz));
            }
        }
コード例 #2
0
        public ToggleDialog(IGSToggleSettings settings) : base()
        {
            toggleBoxes = Collection.ToArray(Collection.Map(
                                                 toggleLabels, s => new CheckBox()
            {
                Text = s
            }));
            foreach (var item in toggleBoxes)
            {
                Layout.Resize(item);
            }

            toggleBoxes[0].Checked = settings.Open;
            toggleBoxes[1].Checked = settings.Looking;
            toggleBoxes[2].Checked = settings.Kibitz;

            Layout.Bind(Layout.Stack(toggleBoxes), this);
        }
コード例 #3
0
ファイル: IGSServerInfo.cs プロジェクト: momoewang/igoenchi
        private void ReadInfo(List <string> lines)
        {
            info = new IgsPlayerInfo();
            if (lines[0].StartsWith("Player:"))
            {
                var firstLine = lines[0];
                var name      = firstLine.Substring(
                    firstLine.IndexOf(' '),
                    firstLine.Length - firstLine.IndexOf(' ')).TrimStart(' ');
                if (name == client.CurrentAccount.Name)
                {
                    //9 Verbose  Bell  Quiet  Shout  Automail  Open  Looking  Client  Kibitz  Chatter
                    //9     Off   Off     On     On       Off    On       On      On      On   On
                    var toggles =
                        lines[lines.Count - 1].Replace(" ", "").Split('O');
                    ToggleSettings =
                        new IGSToggleSettings(toggles[6] == "n",
                                              toggles[7] == "n",
                                              toggles[9] == "n");
                    OnToggleSettingsUpdated(EventArgs.Empty);
                }
                else
                {
                    foreach (var line in lines)
                    {
                        var type = line.Substring(0, line.IndexOf(' '));
                        var data = line.Substring(
                            line.IndexOf(' '),
                            line.Length - line.IndexOf(' ')).TrimStart(' ');
                        switch (type)
                        {
                        case "Player:":
                            info.Name = data;
                            break;

                        case "Language:":
                            info.Language = data;
                            break;

                        case "Rating:":
                            info.Rank = new IGSRank(data.Split(' ')[0]);
                            break;

                        case "Wins:":
                            info.GamesWon = Convert.ToInt32(data);
                            break;

                        case "Losses:":
                            info.GamesLost = Convert.ToInt32(data);
                            break;

                        case "Country:":
                            info.Country = data;
                            break;

                        case "Info:":
                            info.Info = data;
                            break;
                        }
                    }
                    OnPlayerStatsUpdated(EventArgs.Empty);
                }
            }
        }