示例#1
0
 /// <summary>
 /// Установить параметры канала связи в соответствии с настройками
 /// </summary>
 public void SetCommCnlParams(SortedList <string, string> commCnlParams)
 {
     commCnlParams["IpAddress"] = ConnMode == ConnectionModes.Shared ? IpAddress : "";
     commCnlParams["TcpPort"]   = TcpPort.ToString();
     commCnlParams["Behavior"]  = Behavior.ToString();
     commCnlParams["ConnMode"]  = ConnMode.ToString();
 }
示例#2
0
 /// <summary>
 /// Установить параметры канала связи в соответствии с настройками
 /// </summary>
 public void SetCommCnlParams(SortedList <string, string> commCnlParams)
 {
     commCnlParams["TcpPort"]      = TcpPort.ToString();
     commCnlParams["InactiveTime"] = InactiveTime.ToString();
     commCnlParams["Behavior"]     = Behavior.ToString();
     commCnlParams["ConnMode"]     = ConnMode.ToString();
     commCnlParams["DevSelMode"]   = DevSelMode.ToString();
 }
示例#3
0
 /// <summary>
 /// Adds the options to the list.
 /// </summary>
 public void AddToOptionList(OptionList options)
 {
     options.Clear();
     options["TcpPort"]        = TcpPort.ToString();
     options["ClientLifetime"] = ClientLifetime.ToString();
     options["Behavior"]       = Behavior.ToString();
     options["ConnectionMode"] = ConnectionMode.ToString();
     options["DeviceMapping"]  = DeviceMapping.ToString();
 }
示例#4
0
 /// <summary>
 /// Установить параметры канала связи в соответствии с настройками
 /// </summary>
 public void SetCommCnlParams(SortedList <string, string> commCnlParams)
 {
     commCnlParams["Host"]           = ConnMode == ConnectionModes.Shared ? Host : "";
     commCnlParams["TcpPort"]        = TcpPort.ToString();
     commCnlParams["ReconnectAfter"] = ReconnectAfter.ToString();
     commCnlParams["StayConnected"]  = StayConnected.ToString();
     commCnlParams["Behavior"]       = Behavior.ToString();
     commCnlParams["ConnMode"]       = ConnMode.ToString();
 }
示例#5
0
 /// <summary>
 /// Adds the options to the list.
 /// </summary>
 public void AddToOptionList(OptionList options)
 {
     options.Clear();
     options["Host"]           = Host;
     options["TcpPort"]        = TcpPort.ToString();
     options["ReconnectAfter"] = ReconnectAfter.ToString();
     options["StayConnected"]  = StayConnected.ToLowerString();
     options["Behavior"]       = Behavior.ToString();
     options["ConnectionMode"] = ConnectionMode.ToString();
 }
        public override IEnumerable <KeyValuePair <string, string> > GetLoadedOptionsPairs()
        {
            foreach (var pair in base.GetLoadedOptionsPairs())
            {
                yield return(pair);
            }
            yield return(new KeyValuePair <string, string>("TCP PORT", TcpPort.ToString()));

            yield return(new KeyValuePair <string, string>("DB PATH", string.IsNullOrEmpty(DbPath) ? "<DEFAULT>" : DbPath));
        }
示例#7
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["topPort"]   = TcpPort.ToString();
            json["wsPort"]    = WsPort.ToString();
            json["nonce"]     = Nonce.ToString();
            json["useragent"] = UserAgent;
            return(json);
        }
示例#8
0
 public void applyConfiguration()
 {
     config.AppSettings.Settings["nomeServer"].Value      = ServerName;
     config.AppSettings.Settings["password"].Value        = Password;
     config.AppSettings.Settings["indirizzo"].Value       = Address;
     config.AppSettings.Settings["portTCP"].Value         = TcpPort.ToString();
     config.AppSettings.Settings["portUDP"].Value         = UdpPort.ToString();
     config.AppSettings.Settings["enableUDP"].Value       = UdpEnabled.ToString();
     config.AppSettings.Settings["passwordEnabled"].Value = PasswordEnabled.ToString();
 }
示例#9
0
 public static void SaveSetting()
 {
     reader.SetNodeText("PingTimeout", PingTimeout.ToString());
     reader.SetNodeText("RequestTimeout", RequestTimeout.ToString());
     reader.SetNodeText("TcpPort", TcpPort.ToString());
     reader.SetNodeText("UdpPort", UdpPort.ToString());
     reader.SetNodeText("ClientPort", ClientPort.ToString());
     reader.SetNodeText("Adapter", Adapter);
     reader.SetNodeText("PlayerID", PlayerID);
     reader.SetNodeText("DataMode", dataMode);
     reader.SetNodeText("SyncMode", syncMode);
     reader.Save("setting.xml");
 }
示例#10
0
        public override IEnumerable <KeyValuePair <string, string> > GetLoadedOptionsPairs()
        {
            yield return(new KeyValuePair <string, string>("IP", Ip));

            yield return(new KeyValuePair <string, string>("TCP PORT", TcpPort.ToString()));

            yield return(new KeyValuePair <string, string>("HTTP PORT", HttpPort.ToString()));

            yield return(new KeyValuePair <string, string>("TIMEOUT", Timeout.ToString()));

            yield return(new KeyValuePair <string, string>("READ WINDOW", ReadWindow.ToString()));

            yield return(new KeyValuePair <string, string>("WRITE WINDOW", WriteWindow.ToString()));

            yield return(new KeyValuePair <string, string>("PING WINDOW", PingWindow.ToString()));
        }
示例#11
0
        public override IEnumerable <KeyValuePair <string, string> > GetLoadedOptionsPairs()
        {
            foreach (var pair in base.GetLoadedOptionsPairs())
            {
                yield return(pair);
            }
            yield return(new KeyValuePair <string, string>("IP", Ip.ToString()));

            yield return(new KeyValuePair <string, string>("TCP PORT", TcpPort.ToString()));

            yield return(new KeyValuePair <string, string>("HTTP PORT", HttpPort.ToString()));

            yield return(new KeyValuePair <string, string>("STATS PERIOD SEC", StatsPeriodSec.ToString()));

            yield return(new KeyValuePair <string, string>("CHUNK CACHE", ChunksToCache.ToString()));

            yield return(new KeyValuePair <string, string>("DB PATH", string.IsNullOrEmpty(DbPath) ? "<DEFAULT>" : DbPath));

            yield return(new KeyValuePair <string, string>("NO PROJECTIONS", NoProjections.ToString()));

            yield return(new KeyValuePair <string, string>("PROJECTION THREADS", ProjectionThreads.ToString()));
        }
示例#12
0
文件: Settings.cs 项目: zBart/Ares
 private void WriteSettings(XmlWriter writer)
 {
     writer.WriteStartElement("Settings");
     writer.WriteAttributeString("Version", 1.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteElementString("MusicDirectory", MusicDirectory);
     writer.WriteElementString("SoundsDirectory", SoundDirectory);
     writer.WriteElementString("LastDownloadLocation", LastDownloadLocation);
     writer.WriteStartElement("WindowLayout");
     writer.WriteRaw(WindowLayout);
     writer.WriteEndElement();
     writer.WriteStartElement("Volumes");
     writer.WriteAttributeString("Overall", GlobalVolume.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("Music", MusicVolume.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("Sound", SoundVolume.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteEndElement();
     writer.WriteStartElement("Network");
     writer.WriteAttributeString("TcpPort", TcpPort.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("UdpPort", UdpPort.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("IPAddress", IPAddress);
     writer.WriteAttributeString("CheckForUpdate", CheckForUpdate ? "true" : "false");
     writer.WriteAttributeString("Enabled", UseLegacyNetwork ? "true" : "false");
     writer.WriteAttributeString("WebTcpPort", WebTcpPort.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("UseWebNetwork", UseWebNetwork ? "true" : "false");
     writer.WriteEndElement();
     RecentFiles.WriteFiles(writer);
     writer.WriteStartElement("Tools");
     writer.WriteElementString("SoundFileEditor", SoundFileEditor);
     writer.WriteElementString("ExternalMusicPlayer", ExternalMusicPlayer);
     writer.WriteEndElement();
     writer.WriteStartElement("Options");
     writer.WriteAttributeString("MessageFilterLevel", MessageFilterLevel.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("ShowKeys", ShowKeysInButtons ? "true" : "false");
     writer.WriteAttributeString("GlobalKeyHook", GlobalKeyHook ? "true" : "false");
     writer.WriteAttributeString("OutputDevice", OutputDeviceIndex.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteEndElement();
     writer.WriteStartElement("Streaming");
     writer.WriteAttributeString("Active", UseStreaming ? "true" : "false");
     writer.WriteAttributeString("Address", StreamingServerAddress);
     writer.WriteAttributeString("Port", StreamingServerPort.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("Password", StreamingPassword);
     writer.WriteAttributeString("Encoding", StreamingEncoder.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("StreamName", StreamingStreamName);
     writer.WriteAttributeString("Bitrate", StreamingBitrate.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("UserName", StreamingUserName);
     writer.WriteEndElement();
     writer.WriteStartElement("OnlineDB");
     writer.WriteAttributeString("UserId", OnlineDBUserId);
     writer.WriteAttributeString("DialogAfterDownload", ShowDialogAfterDownload ? "true" : "false");
     writer.WriteAttributeString("DialogAfterUpload", ShowDialogAfterUpload ? "true" : "false");
     writer.WriteEndElement();
     writer.WriteStartElement("TagMusicFading");
     writer.WriteAttributeString("FadeTime", TagMusicFadeTime.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("FadeOnlyOnChange", TagMusicFadeOnlyOnChange ? "true" : "false");
     writer.WriteEndElement();
     writer.WriteStartElement("Music");
     writer.WriteAttributeString("PlayOnAllSpeakers", PlayMusicOnAllSpeakers ? "true" : "false");
     writer.WriteAttributeString("ButtonFadeMode", ButtonMusicFadeMode.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteAttributeString("ButtonFadeTime", ButtonMusicFadeTime.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteEndElement();
     writer.WriteStartElement("Controllers");
     writer.WriteAttributeString("LocalPlayerPath", LocalPlayerPath);
     writer.WriteEndElement();
     writer.WriteStartElement("TipOfTheDay");
     writer.WriteAttributeString("ShowTip", ShowTipOfTheDay ? "true" : "false");
     writer.WriteAttributeString("LastTip", LastTipOfTheDay.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteEndElement();
     writer.WriteStartElement("Tpm2NetTarget");
     writer.WriteAttributeString("Host", Tpm2NetTargetHost);
     writer.WriteAttributeString("Port", Tpm2NetTargetPort.ToString(System.Globalization.CultureInfo.InvariantCulture));
     writer.WriteEndElement();
     writer.WriteEndElement();
 }
示例#13
0
 public override string ToString()
 {
     return(RemoteIP.ToString() + ":" + TcpPort.ToString());
 }