Added StringCollectionToStringTypeConverter, description changes in IRCInfo

This commit is contained in:
Jaex 2015-08-24 20:41:31 +03:00
parent a2b5a03246
commit f49de052d1
3 changed files with 59 additions and 8 deletions

View file

@ -284,6 +284,7 @@
<Compile Include="Cryptographic\Translator.cs" />
<Compile Include="Cryptographic\TranslatorHelper.cs" />
<Compile Include="UITypeEditors\NameParserEditor.cs" />
<Compile Include="UITypeEditors\StringCollectionToStringTypeConverter.cs" />
<Compile Include="UITypeEditors\WavFileNameEditor.cs" />
<Compile Include="UnsafeBitmap.cs" />
<Compile Include="UpdateChecker\GitHubUpdateChecker.cs" />

View file

@ -0,0 +1,49 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2015 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
namespace ShareX.HelpersLib
{
public class StringCollectionToStringTypeConverter : TypeConverter
{
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
List<string> list = (List<string>)value;
return string.Join(", ", list);
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
}

View file

@ -38,16 +38,16 @@ public class IRCInfo : SettingsBase<IRCInfo>
[Description("IRC server port."), DefaultValue(6667)]
public int Port { get; set; } = 6667;
[Description("IRC server password."), PasswordPropertyText(true)]
[Description("IRC server password. In some servers can be used to identify."), PasswordPropertyText(true)]
public string Password { get; set; }
[Description("Nickname.")]
public string Nickname { get; set; }
[Description("Username."), DefaultValue("username")]
[Description("Username. This show up in WHOIS result."), DefaultValue("username")]
public string Username { get; set; } = "username";
[Description("Realname."), DefaultValue("realname")]
[Description("Realname. This show up in WHOUS result."), DefaultValue("realname")]
public string Realname { get; set; } = "realname";
[Description("IRC invisible mode."), DefaultValue(true)]
@ -59,10 +59,10 @@ public class IRCInfo : SettingsBase<IRCInfo>
[Description("Wait specific milliseconds before reconnecting."), DefaultValue(5000)]
public int AutoReconnectDelay { get; set; } = 5000;
[Description("When got kicked auto rejoin channel."), DefaultValue(false)]
[Description("When got kicked from channel auto rejoin."), DefaultValue(false)]
public bool AutoRejoinOnKick { get; set; }
[Description("Don't show 'Message of the day' text."), DefaultValue(true)]
[Description("Don't show 'Message of the day' texts in output."), DefaultValue(true)]
public bool SuppressMOTD { get; set; } = true;
[Description("When you disconnect what message gonna show to other people."), DefaultValue("Leaving")]
@ -72,7 +72,8 @@ public class IRCInfo : SettingsBase<IRCInfo>
Editor("System.Windows.Forms.Design.StringCollectionEditor,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public List<string> ConnectCommands { get; set; } = new List<string>();
[Description("When connected automatically will join these channels."),
[Description("When connected automatically join these channels."),
TypeConverter(typeof(StringCollectionToStringTypeConverter)),
Editor("System.Windows.Forms.Design.StringCollectionEditor,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public List<string> AutoJoinChannels { get; set; } = new List<string>() { "#ShareX" };
@ -82,10 +83,10 @@ public class IRCInfo : SettingsBase<IRCInfo>
[Description("Enable/Disable auto response system which using AutoResponseList."), DefaultValue(false)]
public bool AutoResponse { get; set; }
[Description("After successful auto response match how much milliseconds wait for next auto response. Delay independant per message."), DefaultValue(10000)]
[Description("After successful auto response match how much milliseconds wait for next auto response. Delay independant per response."), DefaultValue(10000)]
public int AutoResponseDelay { get; set; } = 10000;
[Description("When specific message written in channel automatically will response with your message.")]
[Description("When specific message written in channel automatically response with your message.")]
public List<AutoResponseInfo> AutoResponseList { get; set; } = new List<AutoResponseInfo>();
public string GetAutoResponses()