本文整理汇总了C#中System.Collections.Specialized.StringDictionary.Add方法的典型用法代码示例。如果您正苦于以下问题:C# StringDictionary.Add方法的具体用法?C# StringDictionary.Add怎么用?C# StringDictionary.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.StringDictionary
的用法示例。
在下文中一共展示了StringDictionary.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ItemAdded
public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
SPWeb web = properties.OpenWeb();
string _listName = "Resource_Allocation";
if (properties.ListTitle == "Resource_Allocation")
{
try
{
if (SPUtility.IsEmailServerSet(web))
{
string body = GetParameter("UserContent", properties);
StringDictionary headers = new StringDictionary();
headers.Add("To", GetSPUserEmailID(_listName, properties, "Owner"));
headers.Add("Subject", GetParameter("UserSubject", properties));
headers.Add("Content-Type", "text/html; charset=\"UTF-8\"");
SPUtility.SendEmail(web, headers, body);
}
}
catch (Exception ex)
{
throw ex;
}
}
}
示例2: VsAddValidFileStringConverter
/// <summary>
/// Initializes a new instance of the <see cref="T:VsAddCodeFileStringConverter"/> class
/// and load the properties for the <see cref="OverwriteItemConverter"/> converter.
/// </summary>
/// <remarks>This constructor is likely to be used from code rather than from a recipe.</remarks>
/// <param name="projectArgument">The project argument.</param>
/// <param name="itemPostfix">The item postfix.</param>
public VsAddValidFileStringConverter(string projectArgument, string itemPostfix)
{
StringDictionary attributes = new StringDictionary();
attributes.Add(OverwriteItemConverter.ProjectArgument, projectArgument);
attributes.Add(OverwriteItemConverter.ItemPostfixArgument, itemPostfix);
base.Configure(attributes);
}
示例3: StartWorkflowButton1_Executed
void StartWorkflowButton1_Executed(object sender, EventArgs e)
{
List<string> mailList = new List<string>();
List<SPUser> users = WorkFlowUtil.GetSPUsersInGroup("wf_EquApp");
List<SPUser> usersReception = WorkFlowUtil.GetSPUsersInGroup("wf_Reception");
foreach (SPUser user in users)
{
mailList.Add(user.Email);
}
foreach (SPUser user in usersReception)
{
string sMai=user.Email;
if (!mailList.Contains(sMai))
{
mailList.Add(sMai);
}
}
string EmployeeName=((TextBox)DataForm1.FindControl("txtEmployeeName")).Text;
StringDictionary dict = new StringDictionary();
dict.Add("to", string.Join(";", mailList.ToArray()));
dict.Add("subject",EmployeeName+"'s new employee equipment request" );
string mcontent = EmployeeName + "'s new employee equipment request has been submitted. Workflow number is "
+ SPContext.Current.ListItem["WorkflowNumber"] + ".<br/><br/>" + @" Please view the detail by clicking <a href='"
+ SPContext.Current.Web.Url
+ "/_layouts/CA/WorkFlows/Equipment2/DisplayForm.aspx?List="
+ SPContext.Current.ListId.ToString()
+ "&ID="
+ SPContext.Current.ListItem.ID
+ "'>here</a>.";
SPUtility.SendEmail(SPContext.Current.Web, dict, mcontent);
}
示例4: Args
public Args(string[] args)
{
argDict = new StringDictionary();
Regex regEx = new Regex(@"^-", RegexOptions.IgnoreCase | RegexOptions.Compiled);
Regex regTrim = new Regex(@"^['""]?(.*?)['""]?$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
string arg = "";
string[] chunks;
foreach (string s in args)
{
chunks = regEx.Split(s, 3);
if (regEx.IsMatch(s))
{
arg = chunks[1];
argDict.Add(arg, "true");
}
else
{
if (argDict.ContainsKey(arg))
{
chunks[0] = regTrim.Replace(chunks[0], "$1");
argDict.Remove(arg);
argDict.Add(arg, chunks[0]);
arg = "";
}
}
}
}
示例5: SetOptions
/// <summary>
/// Calls the remote Viddler API method: viddler.encoding.setOptions
/// </summary>
public Data.EncodingOptions SetOptions(int profileId, bool? profileEnabled, int? profileBitrate)
{
StringDictionary parameters = new StringDictionary();
if (profileEnabled.HasValue) parameters.Add(string.Concat("profile_", profileId, "_enabled"), profileEnabled.Value ? "1" : "0");
if (profileBitrate.HasValue) parameters.Add(string.Concat("profile_", profileId, "_bitrate"), profileBitrate.Value.ToString(CultureInfo.InvariantCulture));
return this.Service.ExecuteHttpRequest<Encoding.SetOptions, Data.EncodingOptions>(parameters);
}
示例6: List
/// <summary>
/// Calls the remote Viddler API method: viddler.playlists.list
/// </summary>
public Data.PlaylistList List(int? page, int? perPage)
{
StringDictionary parameters = new StringDictionary();
if (page.HasValue) parameters.Add("page", page.Value.ToString(CultureInfo.InvariantCulture));
if (perPage.HasValue) parameters.Add("per_page", perPage.Value.ToString(CultureInfo.InvariantCulture));
return this.Service.ExecuteHttpRequest<Playlists.List, Data.PlaylistList>(parameters);
}
示例7: SetCommentStatus
/// <summary>
/// Calls the remote Viddler API method: viddler.moderation.setCommentStatus
/// </summary>
public Data.Comment SetCommentStatus(string commentId, Data.CommentsModerationStatus status)
{
StringDictionary parameters = new StringDictionary();
parameters.Add("comment_id", commentId);
parameters.Add("status", ViddlerHelper.GetEnumName(status.GetType().GetField(status.ToString())));
return this.Service.ExecuteHttpRequest<Moderation.SetCommentStatus, Data.Comment>(parameters);
}
示例8: GetSubaccounts
/// <summary>
/// Calls the remote Viddler API method: viddler.resellers.getSubaccounts
/// </summary>
public Data.SubaccountList GetSubaccounts(int? page, int? perPage)
{
StringDictionary parameters = new StringDictionary();
if (page.HasValue) parameters.Add("page", page.Value.ToString(CultureInfo.InvariantCulture));
if (perPage.HasValue) parameters.Add("per_page", perPage.Value.ToString(CultureInfo.InvariantCulture));
return this.Service.ExecuteHttpRequest<Resellers.GetSubAccounts, Data.SubaccountList>(parameters);
}
示例9: Encode
/// <summary>
/// Calls the remote Viddler API method: viddler.encoding.encode
/// </summary>
public Data.VideoFileEncoding Encode(string videoId, int profileId)
{
StringDictionary parameters = new StringDictionary();
parameters.Add("video_id", videoId);
parameters.Add("profile_id", profileId.ToString(CultureInfo.InvariantCulture));
return this.Service.ExecuteHttpRequest<Encoding.Encode, Data.VideoFileEncoding>(parameters);
}
示例10: GetByTag
/// <summary>
/// Calls the remote Viddler API method: viddler.groups.getByTag
/// </summary>
public Data.GroupList GetByTag(string tag, int? page, int? perPage)
{
StringDictionary parameters = new StringDictionary();
if (page.HasValue) parameters.Add("page", page.Value.ToString(CultureInfo.InvariantCulture));
if (perPage.HasValue) parameters.Add("per_page", perPage.Value.ToString(CultureInfo.InvariantCulture));
parameters.Add("tag", tag);
return this.Service.ExecuteHttpRequest<Groups.GetByTag, Data.GroupList>(parameters);
}
示例11: Arguments
public Arguments(string[] args)
{
_params = new StringDictionary();
Regex spliter = new Regex(@"^-{1,2}|^/|=|:", RegexOptions.IgnoreCase | RegexOptions.Compiled);
Regex remover = new Regex(@"^['""]?(.*?)['""]?$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
string parm = null;
string[] parts;
foreach (var a in args)
{
parts = spliter.Split(a, 3);
switch (parts.Length)
{
case 1:
if (parm != null)
{
if (!_params.ContainsKey(parm))
{
parts[0] = remover.Replace(parts[0], "$1");
_params.Add(parm, parts[0]);
}
parm = null;
}
break;
case 2:
if (parm != null)
{
if (!_params.ContainsKey(parm))
_params.Add(parm, "true");
}
parm = parts[1];
break;
case 3:
if (parm != null)
{
if (!_params.ContainsKey(parm))
_params.Add(parm, "true");
}
parm = parts[1];
if (!_params.ContainsKey(parm))
{
parts[2] = remover.Replace(parts[2], "$1");
_params.Add(parm, parts[2]);
}
parm = null;
break;
}
}
if (parm != null)
{
if (!_params.ContainsKey(parm))
_params.Add(parm, "true");
}
}
示例12: GetComments
/// <summary>
/// Calls the remote Viddler API method: viddler.moderation.getComments
/// </summary>
public Data.CommentsModerationList GetComments(int? page, int? perPage, Data.CommentListSortType? sort)
{
StringDictionary parameters = new StringDictionary();
if (page.HasValue) parameters.Add("page", page.Value.ToString(CultureInfo.InvariantCulture));
if (perPage.HasValue) parameters.Add("per_page", perPage.Value.ToString(CultureInfo.InvariantCulture));
if (sort.HasValue) parameters.Add("sort", ViddlerHelper.GetEnumName(sort.Value.GetType().GetField(sort.Value.ToString())));
return this.Service.ExecuteHttpRequest<Moderation.GetComments, Data.CommentsModerationList>(parameters);
}
示例13: GetDetails
/// <summary>
/// Calls the remote Viddler API method: viddler.playlists.getDetails
/// </summary>
public Data.PlaylistVideoList GetDetails(string playlistId, int? page, int? perPage)
{
StringDictionary parameters = new StringDictionary();
if (page.HasValue) parameters.Add("page", page.Value.ToString(CultureInfo.InvariantCulture));
if (perPage.HasValue) parameters.Add("per_page", perPage.Value.ToString(CultureInfo.InvariantCulture));
parameters.Add("playlist_id", playlistId);
return this.Service.ExecuteHttpRequest<Playlists.GetDetails, Data.PlaylistVideoList>(parameters);
}
示例14: Add
/// <summary>
/// Calls the remote Viddler API method: viddler.videos.comments.add
/// </summary>
public Data.Video Add(string videoId, string text, int? timepoint)
{
StringDictionary parameters = new StringDictionary();
parameters.Add("video_id", videoId);
parameters.Add("text", text);
if (timepoint.HasValue) parameters.Add("timepoint", timepoint.Value.ToString(CultureInfo.InvariantCulture));
return this.Service.ExecuteHttpRequest<Videos.Comments.Add, Data.Video>(parameters);
}
示例15: GetABCRank
public static StringDictionary GetABCRank()
{
StringDictionary result = new StringDictionary();
result.Add("A", "1");
result.Add("B", "2");
result.Add("C", "3");
result.Add("D", "4");
return result;
}