本文整理汇总了C#中System.Collections.Specialized.ListDictionary类的典型用法代码示例。如果您正苦于以下问题:C# ListDictionary类的具体用法?C# ListDictionary怎么用?C# ListDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListDictionary类属于System.Collections.Specialized命名空间,在下文中一共展示了ListDictionary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Map
public override void Map(Channel q, object map_arg) {
IList retval = new ArrayList();
IDictionary my_entry = new ListDictionary();
my_entry["node"] = _node.Address.ToString();
retval.Add(my_entry);
q.Enqueue(retval);
}
示例2: GetUserByUserNameAndPassword
public virtual bool GetUserByUserNameAndPassword(string UserName, string Password)
{
ListDictionary parameters = new ListDictionary();
parameters.Add(new SqlParameter("@UserName", SqlDbType.NVarChar, 200), UserName);
parameters.Add(new SqlParameter("@Password", SqlDbType.NVarChar, 200), Password);
return LoadFromSql("GetUserByUserNameAndPassword", parameters);
}
示例3: GetDeliveryOrdersDetailsTotals
public virtual IDataReader GetDeliveryOrdersDetailsTotals(string DeliveryOrderNoFrom, string DeliveryOrderNoTo)
{
ListDictionary parameters = new ListDictionary();
parameters.Add(new SqlParameter("@DeliveryOrderNoFrom", SqlDbType.NVarChar, 10), DeliveryOrderNoFrom);
parameters.Add(new SqlParameter("@DeliveryOrderNoTo", SqlDbType.NVarChar, 10), DeliveryOrderNoTo);
return LoadFromSqlReader("GetDeliveryOrdersDetailsTotals", parameters);
}
示例4: CreateTcpChannel
/// <summary>
/// Create a TcpChannel with a given name, on a given port.
/// </summary>
/// <param name="port"></param>
/// <param name="name"></param>
/// <returns></returns>
private static TcpChannel CreateTcpChannel( string name, int port, int limit )
{
ListDictionary props = new ListDictionary();
props.Add( "port", port );
props.Add( "name", name );
props.Add( "bindTo", "127.0.0.1" );
BinaryServerFormatterSinkProvider serverProvider =
new BinaryServerFormatterSinkProvider();
// NOTE: TypeFilterLevel and "clientConnectionLimit" property don't exist in .NET 1.0.
Type typeFilterLevelType = typeof(object).Assembly.GetType("System.Runtime.Serialization.Formatters.TypeFilterLevel");
if (typeFilterLevelType != null)
{
PropertyInfo typeFilterLevelProperty = serverProvider.GetType().GetProperty("TypeFilterLevel");
object typeFilterLevel = Enum.Parse(typeFilterLevelType, "Full");
typeFilterLevelProperty.SetValue(serverProvider, typeFilterLevel, null);
// props.Add("clientConnectionLimit", limit);
}
BinaryClientFormatterSinkProvider clientProvider =
new BinaryClientFormatterSinkProvider();
return new TcpChannel( props, clientProvider, serverProvider );
}
示例5: Add
public void Add (string key, string value)
{
if (data == null)
data = new ListDictionary ();
data.Add (key, value);
}
示例6: SendWelcomeEmail
public static void SendWelcomeEmail(string mailTo ,Guid orgId, string tournamentId, string orgLogo, string tournamentName, DateTime startDate)
{
ListDictionary replacements = new ListDictionary();
replacements.Add("<% OrgId %>", orgId);
replacements.Add("<% TournamentName %>", tournamentName);
replacements.Add("<% StartDate %>", startDate);
replacements.Add("<% TournamentId %>", tournamentId);
string templatePath = Path.Combine(ConfigurationManager.AppSettings["EmailTemplatePath"].ToString(), "WelcomeEmail.htm");
string matchUpReadyTemplate = File.ReadAllText(templatePath);
SmtpClient client = new SmtpClient(); //host and port picked from web.config
client.EnableSsl = true;
foreach (DictionaryEntry item in replacements)
{
matchUpReadyTemplate = matchUpReadyTemplate.Replace(item.Key.ToString(), item.Value.ToString());
}
MailMessage message = new MailMessage();
message.Subject = "Welcome Email";
message.From = new MailAddress("[email protected]");
message.To.Add(mailTo);
message.IsBodyHtml = true;
message.Body = matchUpReadyTemplate;
try
{
client.Send(message);
}
catch (Exception)
{
}
}
示例7: AreNamesUnique
/// <summary>
/// Returns true if all items in <paramref name="names0"/> and <paramref name="names1"/> are
/// unique strings. Case sensitivity consideration depends on <paramref name="ignoreCase"/>.
/// </summary>
/// <param name="names0">An array of strings.</param>
/// <param name="names1">An array of strings.</param>
/// <param name="ignoreCase">If true then case is not considered when comparing strings.</param>
/// <returns>bool</returns>
public static bool AreNamesUnique(string[] names0, string[] names1, bool ignoreCase)
{
bool result = true;
if (names0 == null && names1 == null)
return result;
ListDictionary dic = new ListDictionary(StringComparer.Create(new CultureInfo("en"), ignoreCase));
for (int i = 0; i < names0.Length; i++)
{
if (dic.Contains(names0[i]))
{
result = false;
break;
}
dic.Add(names0[i], null);
}
for (int i = 0; i < names1.Length; i++)
{
if (dic.Contains(names1[i]))
{
result = false;
break;
}
dic.Add(names1[i], null);
}
if (dic.Count == 0)
result = false; // when both arrays are empty
return result;
}
示例8: SearchTickets
public virtual bool SearchTickets(string txt, int statusID)
{
ListDictionary parameters = new ListDictionary();
parameters.Add(new SqlParameter("@StatusID", SqlDbType.Int, 0), statusID);
parameters.Add(new SqlParameter("@SearchTxt", SqlDbType.NVarChar, 300), txt);
return LoadFromSql("SearchAllTickets", parameters);
}
示例9: deSerialize
public static void deSerialize()
{
string sPath = HttpContext.Current.Server.MapPath("~/config/config.txt");
if (!File.Exists(sPath))
{
m_lListDictionary = new ListDictionary();
return;
}
m_lListDictionary = new ListDictionary();
TextReader oTr = File.OpenText(sPath);
char cN1 = '\n';
string sTemp = oTr.ReadToEnd();
string[] asTemp = sTemp.Split(cN1);
foreach (string sLine in asTemp)
{
if (sLine.Length == 0)
continue;
string[] asTemp2 = sLine.Split(',');
if (asTemp[0].ToString() == "DatabasePassword")
{
CCrypt oCrypt = new CCrypt();
m_lListDictionary.Add(asTemp2[0], oCrypt.DESDecrypt(asTemp2[1]));
continue;
}
m_lListDictionary.Add(asTemp2[0], asTemp2[1]);
}
oTr.Close();
}
示例10: LoadDetailInfo
public virtual bool LoadDetailInfo(int countryID)
{
ListDictionary parameters = new ListDictionary();
parameters.Add(new SqlParameter("@CountryID", SqlDbType.Int), countryID);
return base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_Country_LoadDetailInfo]", parameters);
}
示例11: Create
public object Create(object parent, object context, XmlNode section)
{
IDictionary directories;
NameValueSectionHandler nameValueSectionHandler;
XmlNodeList nodes;
DirectoryConfiguration directory;
NameValueCollection properties;
directories = new ListDictionary();
nameValueSectionHandler = new NameValueSectionHandler();
nodes = section.SelectNodes("directory");
foreach(XmlElement element in nodes) {
if(element.GetAttributeNode("name") == null)
throw(new ConfigurationException("Name not specified.", element));
if(element.GetAttributeNode("type") == null)
throw(new ConfigurationException("Type not specified.", element));
if(element.SelectSingleNode("properties") == null)
properties = new NameValueCollection();
else
properties = (NameValueCollection) nameValueSectionHandler.Create(null, context, element.SelectSingleNode("properties"));
directory = new DirectoryConfiguration(element.GetAttribute("name"), element.GetAttribute("type"), properties);
directories.Add(directory.Name, directory);
}
return(directories);
}
示例12: UpdateCoverByCategoryID
public virtual void UpdateCoverByCategoryID(int categoryID)
{
ListDictionary parameters = new ListDictionary();
parameters.Add(new SqlParameter("@CategoryID", SqlDbType.Int), categoryID);
base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_Gallery_UpdateCoverByCategoryID]", parameters);
}
示例13: lbSendToFriend_Click
protected void lbSendToFriend_Click(object sender, EventArgs e)
{
string url = Request.Url.AbsoluteUri;
SmtpClient client = new SmtpClient(); //host and port picked from web.config
client.EnableSsl = true;
MailDefinition message = new MailDefinition();
message.BodyFileName = @"~\EmailTemplate\MiriMargolinShareWithAFriend.htm";
message.IsBodyHtml = true;
message.From = "[email protected]";
message.Subject = "MiriMargolin - Share with a friend";
ListDictionary replacements = new ListDictionary();
replacements.Add("<% YourName %>", this.txtYourName.Text);
replacements.Add("<% Message %>", this.txtMessage.Text);
//MailMessage msgHtml = message.CreateMailMessage(this.txtFriendsEmail.Text, replacements, new LiteralControl());
//msgHtml.Bcc.Add(new MailAddress(RECIPIENTS));
try
{
//client.Send(msgHtml);
}
catch (Exception)
{
//this.lblMsg.Text = "There was a problem to send an email.";
}
}
示例14: sendEmailToAdmin
private void sendEmailToAdmin()
{
//Sending out emails to Admin
MailDefinition md_2 = new MailDefinition();
md_2.From = ConfigurationManager.AppSettings["MailFrom"];
md_2.IsBodyHtml = true;
md_2.Subject = ConfigurationManager.AppSettings["emailSubject"];
ListDictionary replacements = new ListDictionary();
replacements.Add("<%client_name%>", (string)(Session["client_name"]));
replacements.Add("<%client_church_name%>", (string)(Session["client_church_name"]));
replacements.Add("<%client_address%>", (string)(Session["client_address"]));
replacements.Add("<%client_city%>", (string)(Session["client_city"]));
replacements.Add("<%client_state%>", (string)(Session["client_state"]));
replacements.Add("<%client_Zip%>", (string)(Session["client_Zip"]));
replacements.Add("<%client_phone%>", (string)(Session["client_phone"]));
replacements.Add("<%client_email%>", (string)(Session["client_email"]));
replacements.Add("<%Payment_Amount%>", (string)(Session["Payment_Amount"]));
replacements.Add("<%client_roommate1%>", (string)(Session["client_roommate1"]));
replacements.Add(" <%client_registrationType%>", (string)(Session["client_registrationType"]));
string body = String.Empty;
using (StreamReader sr_2 = new StreamReader(Server.MapPath(ConfigurationManager.AppSettings["emailPath"] + "registration.txt")))
{
body = sr_2.ReadToEnd();
}
MailMessage msg_2 = md_2.CreateMailMessage(ConfigurationManager.AppSettings["management_Email"], replacements, body, new System.Web.UI.Control());
SmtpClient client = new SmtpClient();
client.Send(msg_2);
}
示例15: SearchByCityIDAndCountryID
public virtual void SearchByCityIDAndCountryID(int cityID, int countryID)
{
ListDictionary parameters = new ListDictionary();
parameters.Add(new SqlParameter("@CityID", SqlDbType.Int), cityID);
parameters.Add(new SqlParameter("@CountryID", SqlDbType.Int), countryID);
base.LoadFromSql("[" + this.SchemaStoredProcedure + "usp_BlogPage_SearchByCityIDAndCountryID]", parameters);
}