當前位置: 首頁>>代碼示例>>C#>>正文


C# StringDictionary.Add方法代碼示例

本文整理匯總了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;
                }
            }
        }
開發者ID:photon-infotech,項目名稱:sharepoint-resource-management,代碼行數:27,代碼來源:EventReceiver.cs

示例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);
 }
開發者ID:riseandcode,項目名稱:open-wscf-2010,代碼行數:14,代碼來源:VsAddValidFileStringConverter.cs

示例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);
        }
開發者ID:porter1130,項目名稱:C-A,代碼行數:33,代碼來源:NewForm.aspx.cs

示例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 = "";
                }
                }
              }
        }
開發者ID:FabioCuneaz,項目名稱:Cookie365,代碼行數:30,代碼來源:CmdLineParse.cs

示例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);
    }
開發者ID:donnierayjones,項目名稱:Viddler-.NET,代碼行數:11,代碼來源:EncodingNamespaceWrapper.cs

示例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);
    }
開發者ID:spokanedj,項目名稱:Viddler-.NET,代碼行數:11,代碼來源:PlaylistsNamespaceWrapper.cs

示例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);
    }
開發者ID:spokanedj,項目名稱:Viddler-.NET,代碼行數:11,代碼來源:ModerationNamespaceWrapper.cs

示例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);
    }
開發者ID:spokanedj,項目名稱:Viddler-.NET,代碼行數:11,代碼來源:ResellersNamespaceWrapper.cs

示例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);
    }
開發者ID:viddler,項目名稱:Viddler-.NET,代碼行數:11,代碼來源:EncodingNamespaceWrapper.cs

示例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);
    }
開發者ID:spokanedj,項目名稱:Viddler-.NET,代碼行數:12,代碼來源:GroupsNamespaceWrapper.cs

示例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");
            }
        }
開發者ID:rreynolds-yp,項目名稱:csharp-swift-consoleclient,代碼行數:57,代碼來源:Program.cs

示例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);
    }
開發者ID:spokanedj,項目名稱:Viddler-.NET,代碼行數:12,代碼來源:ModerationNamespaceWrapper.cs

示例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);
    }
開發者ID:spokanedj,項目名稱:Viddler-.NET,代碼行數:12,代碼來源:PlaylistsNamespaceWrapper.cs

示例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);
    }
開發者ID:spokanedj,項目名稱:Viddler-.NET,代碼行數:12,代碼來源:CommentsNamespaceWrapper.cs

示例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;
         }
開發者ID:erwin-hamid,項目名稱:LogPro,代碼行數:10,代碼來源:Operators.cs


注:本文中的System.Collections.Specialized.StringDictionary.Add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。