当前位置: 首页>>代码示例>>C#>>正文


C# Specialized.StringDictionary类代码示例

本文整理汇总了C#中System.Collections.Specialized.StringDictionary的典型用法代码示例。如果您正苦于以下问题:C# StringDictionary类的具体用法?C# StringDictionary怎么用?C# StringDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StringDictionary类属于System.Collections.Specialized命名空间,在下文中一共展示了StringDictionary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendByMail

        /// <summary>
        /// Sends an error message by opening the user's mail client.
        /// </summary>
        /// <param name="recipient"></param>
        /// <param name="subject"></param>
        /// <param name="ex"></param>
        /// <param name="assembly">The assembly where the error originated. This will 
        /// be used to extract version information.</param>
        public static void SendByMail(string recipient, string subject, Exception ex,
            Assembly assembly, StringDictionary additionalInfo)
        {
            string attributes = GetAttributes(additionalInfo);

            StringBuilder msg = new StringBuilder();

            msg.AppendLine("[ Please send this as plain text to allow automatic pre-processing ]");
            msg.AppendLine();
            msg.AppendLine(GetMessage(ex));
            msg.AppendLine();
            msg.AppendLine(GetAttributes(additionalInfo));
            msg.AppendLine();
            msg.AppendLine("[ Please send this as plain text to allow automatic pre-processing ]");
            msg.AppendLine();

            string command = string.Format("mailto:{0}?subject={1}&body={2}",
                recipient,
                Uri.EscapeDataString(subject),
                Uri.EscapeDataString(msg.ToString()));

            Debug.WriteLine(command);
            Process p = new Process();
            p.StartInfo.FileName = command;
            p.StartInfo.UseShellExecute = true;

            p.Start();
        }
开发者ID:necora,项目名称:ank_git,代码行数:36,代码来源:ErrorMessage.cs

示例2: access_token

		public static async Task<string> access_token(TwitterContext twitterContext, string oauth_verifier)
		{
			StringDictionary query = new StringDictionary();
			query["oauth_verifier"] = oauth_verifier;

            return await new TwitterRequest(twitterContext, API.Methods.POST, new Uri(API.Urls.Oauth_AccessToken), query).Request();
		}
开发者ID:kinoh,项目名称:Twitch,代码行数:7,代码来源:OAuth.cs

示例3: Execute

        /// <summary>
        /// Runs the specified command.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="keyValues">The key values.</param>
        /// <param name="output">The output.</param>
        /// <returns></returns>
        public override int Execute(string command, StringDictionary keyValues, out string output)
        {
            output = string.Empty;

            string url = Params["url"].Value.TrimEnd('/');

            using (SPSite site = new SPSite(url))
            {
                using (SPWeb web = site.AllWebs[Utilities.GetServerRelUrlFromFullUrl(url)])
                {

                    foreach (SPLanguage lang in web.RegionalSettings.InstalledLanguages)
                    {
                        foreach (SPWebTemplate template in site.GetWebTemplates((uint)lang.LCID))
                        {
                            output += template.Name + " = " + template.Title + " (" + lang.LCID + ")\r\n";
                        }
                        foreach (SPWebTemplate template in site.GetCustomWebTemplates((uint)lang.LCID))
                        {
                            output += template.Name + " = " + template.Title + " (Custom)(" + lang.LCID + ")\r\n";
                        }
                    }
                }
            }

            return (int)ErrorCodes.NoError;
        }
开发者ID:GSoft-SharePoint,项目名称:PowerShell-SPCmdlets,代码行数:34,代码来源:EnumInstalledSiteTemplates.cs

示例4: OnDownload

        public void OnDownload(Series series, EpisodeFile episodeFile, string sourcePath, CustomScriptSettings settings)
        {
            var environmentVariables = new StringDictionary();

            environmentVariables.Add("Sonarr_EventType", "Download");
            environmentVariables.Add("Sonarr_Series_Id", series.Id.ToString());
            environmentVariables.Add("Sonarr_Series_Title", series.Title);
            environmentVariables.Add("Sonarr_Series_Path", series.Path);
            environmentVariables.Add("Sonarr_Series_TvdbId", series.TvdbId.ToString());
            environmentVariables.Add("Sonarr_EpisodeFile_Id", episodeFile.Id.ToString());
            environmentVariables.Add("Sonarr_EpisodeFile_RelativePath", episodeFile.RelativePath);
            environmentVariables.Add("Sonarr_EpisodeFile_Path", Path.Combine(series.Path, episodeFile.RelativePath));
            environmentVariables.Add("Sonarr_EpisodeFile_SeasonNumber", episodeFile.SeasonNumber.ToString());
            environmentVariables.Add("Sonarr_EpisodeFile_EpisodeNumbers", string.Join(",", episodeFile.Episodes.Value.Select(e => e.EpisodeNumber)));
            environmentVariables.Add("Sonarr_EpisodeFile_EpisodeAirDates", string.Join(",", episodeFile.Episodes.Value.Select(e => e.AirDate)));
            environmentVariables.Add("Sonarr_EpisodeFile_EpisodeAirDatesUtc", string.Join(",", episodeFile.Episodes.Value.Select(e => e.AirDateUtc)));
            environmentVariables.Add("Sonarr_EpisodeFile_Quality", episodeFile.Quality.Quality.Name);
            environmentVariables.Add("Sonarr_EpisodeFile_QualityVersion", episodeFile.Quality.Revision.Version.ToString());
            environmentVariables.Add("Sonarr_EpisodeFile_ReleaseGroup", episodeFile.ReleaseGroup ?? string.Empty);
            environmentVariables.Add("Sonarr_EpisodeFile_SceneName", episodeFile.SceneName ?? string.Empty);
            environmentVariables.Add("Sonarr_EpisodeFile_SourcePath", sourcePath);
            environmentVariables.Add("Sonarr_EpisodeFile_SourceFolder", Path.GetDirectoryName(sourcePath));
            
            ExecuteScript(environmentVariables, settings);
        }
开发者ID:Djohnnie,项目名称:Sonarr,代码行数:25,代码来源:CustomScriptService.cs

示例5: 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

示例6: SandcastleToolBase

        /// <summary>
        /// Initializes a new instance of the <see cref="SandcastleToolBase"/> class.
        /// </summary>
        public SandcastleToolBase()
        {
            EnviromentVariables = new StringDictionary();
            SandcastleEnviroment = new SandcastleEnviroment();

            EnviromentVariables["DXROOT"] = SandcastleEnviroment.SandcastleRoot;
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:10,代码来源:SandcastleToolBase.cs

示例7: SimpleElement

 public SimpleElement(String tagName)
 {
     this.tagName = tagName;
     attrib = new StringDictionary();
     childElems = new SimpleElements();
     this.text = "";
 }
开发者ID:SonicZentropy,项目名称:MiscProjects,代码行数:7,代码来源:SimpleElement.cs

示例8: ParseParameters

		/// <summary>
		/// Parses the parameters.
		/// </summary>
		/// <param name="uri">The URI.</param>
		/// <returns></returns>
		private static StringDictionary ParseParameters(
			Uri uri )
		{
			StringDictionary result = new StringDictionary();

			if ( !string.IsNullOrEmpty( uri.Query ) )
			{
				string query = uri.Query.Trim( '&', '?' );
				string[] pairs = query.Split( '&' );

				foreach ( string pair in pairs )
				{
					if ( pair.Contains( @"=" ) )
					{
						string[] ab = pair.Split( '=' );
						result[ab[0]] = ab[1];
					}
					else
					{
						result[pair] = pair;
					}
				}
			}

			return result;
		}
开发者ID:divyang4481,项目名称:lextudio,代码行数:31,代码来源:UrlParser.cs

示例9: BindSettings

        public void BindSettings(StringDictionary settings)
        {
            // bind servers
            try
            {
                ddlServers.DataSource = ES.Services.StatisticsServers.GetServers(PanelRequest.ServiceId);
                ddlServers.DataBind();
            }
            catch
            { /* skip */ }

            txtSmarterUrl.Text = settings["SmarterUrl"];
            txtUsername.Text = settings["Username"];
            ViewState["PWD"] = settings["Password"];
            Utils.SelectListItem(ddlServers, settings["ServerID"]);
            Utils.SelectListItem(ddlLogFormat, settings["LogFormat"]);
            txtLogWilcard.Text = settings["LogWildcard"];
            txtLogDeleteDays.Text = settings["LogDeleteDays"];
            txtSmarterLogs.Text = settings["SmarterLogsPath"];
            txtSmarterLogDeleteMonths.Text = settings["SmarterLogDeleteMonths"];
			chkBuildUncLogsPath.Checked = Utils.ParseBool(settings["BuildUncLogsPath"], false);

            if (settings["TimeZoneId"] != null)
                timeZone.TimeZoneId = Utils.ParseInt(settings["TimeZoneId"], 1);

            txtStatsUrl.Text = settings["StatisticsURL"];

        }
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:28,代码来源:SmarterStats_Settings.ascx.cs

示例10: GetSettings

        /// <summary>
        /// Retreaves StringDictionary object from database or file system
        /// </summary>
        /// <param name="extensionType">
        /// Extension Type
        /// </param>
        /// <param name="extensionId">
        /// Extension Id
        /// </param>
        /// <returns>
        /// StringDictionary object as Stream
        /// </returns>
        public object GetSettings(ExtensionType extensionType, string extensionId)
        {
            SerializableStringDictionary ssd;
            var sd = new StringDictionary();
            var serializer = new XmlSerializer(typeof(SerializableStringDictionary));

            if (Section.DefaultProvider == "XmlBlogProvider")
            {
                var stm = (Stream)BlogService.LoadFromDataStore(extensionType, extensionId);
                if (stm != null)
                {
                    ssd = (SerializableStringDictionary)serializer.Deserialize(stm);
                    stm.Close();
                    sd = ssd;
                }
            }
            else
            {
                var o = BlogService.LoadFromDataStore(extensionType, extensionId);
                if (!string.IsNullOrEmpty((string)o))
                {
                    using (var reader = new StringReader((string)o))
                    {
                        ssd = (SerializableStringDictionary)serializer.Deserialize(reader);
                    }

                    sd = ssd;
                }
            }

            return sd;
        }
开发者ID:CharlesZHENG,项目名称:BlogEngine.NET,代码行数:44,代码来源:StringDictionaryBehavior.cs

示例11: InstallCertificate

        private static void InstallCertificate(StringDictionary parametrs)
        {
            try
            {
                string[] param = parametrs["assemblypath"].Split('\\');
                string certPath = String.Empty;

                for (int i = 0; i < param.Length - 1; i++)
                {
                    certPath += param[i] + '\\';
                }
                certPath += "certificate.pfx";

                var cert = new X509Certificate2(certPath, "",
                  X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);

                var store = new X509Store(StoreName.AuthRoot, StoreLocation.LocalMachine);
                store.Open(OpenFlags.ReadWrite);
                store.Add(cert);
                store.Close();
            }
            catch (Exception ex)
            {
                throw new Exception("Certificate appeared to load successfully but also seems to be null.", ex);
            }
        }
开发者ID:kapryeong,项目名称:HTTP-SPEED-PLUS-MOBILITY,代码行数:26,代码来源:InstallerCertificate.cs

示例12: 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

示例13: GetProfile

    /// <summary>
    /// Calls the remote Viddler API method: viddler.users.getProfile
    /// </summary>
    public Data.User GetProfile(string userName)
    {
      StringDictionary parameters = new StringDictionary();
      parameters.Add("user", userName);

      return this.Service.ExecuteHttpRequest<Users.GetProfile, Data.User>(parameters);
    }
开发者ID:donnierayjones,项目名称:Viddler-.NET,代码行数:10,代码来源:UsersNamespaceWrapper.cs

示例14: LinkMessage

 public LinkMessage(StringDictionary attributes, NodeInfo local, NodeInfo remote, string token)
 {
   _attributes = attributes;
   _local_ni = local;
   _remote_ni = remote;
   _token = token;
 }
开发者ID:bakriy,项目名称:brunet,代码行数:7,代码来源:LinkMessage.cs

示例15: BuildElsticSearchConnection

        public static ElasticsearchConnection BuildElsticSearchConnection(string connectionString)
        {
            try
            {
                var builder = new System.Data.Common.DbConnectionStringBuilder();
                builder.ConnectionString = connectionString.Replace("{", "\"").Replace("}", "\"");

                var lookup = new StringDictionary();
                foreach (string key in builder.Keys)
                {
                    lookup[key] = Convert.ToString(builder[key]);
                }

                var index = lookup["Index"];

                // If the user asked for rolling logs, setup the index by day
                if (!string.IsNullOrEmpty(lookup["rolling"]))
                    if (lookup["rolling"] == "true")
                        index = string.Format("{0}-{1}", index, DateTime.Now.ToString("yyyy.MM.dd"));

                return
                    new ElasticsearchConnection
                    {
                        Server = lookup["Server"],
                        Port = lookup["Port"],
                        Index = index
                    };
            }
            catch
            {
                throw new InvalidOperationException("Not a valid connection string");
            }
        }
开发者ID:hippasus,项目名称:log4net.ElasticSearch,代码行数:33,代码来源:ConnectionBuilder.cs


注:本文中的System.Collections.Specialized.StringDictionary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。