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


C# this.AddValue方法代码示例

本文整理汇总了C#中this.AddValue方法的典型用法代码示例。如果您正苦于以下问题:C# this.AddValue方法的具体用法?C# this.AddValue怎么用?C# this.AddValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在this的用法示例。


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

示例1: AddValueWithType

 public static void AddValueWithType(this SerializationInfo Info, String Name, Object Object)
 {
     if (Object == null)
     {
         Info.AddValue(Name + ".Type", "Nothing");
     }
     else
     {
         Info.AddValue(Name + ".Type", Object.GetType().FullName);
         Info.AddValue(Name, Object, Object.GetType());
     }
 }
开发者ID:Shayan-To,项目名称:OpenMesh,代码行数:12,代码来源:Utils.cs

示例2: TryAddValue

 /// <summary>
 /// Checks if a value exists for a node, if not, it adds one.
 /// </summary>
 public static void TryAddValue(this ConfigNode node, string name, string value)
 {
     if (!node.HasValue(name))
     {
         node.AddValue(name, value);
     }
 }
开发者ID:CYBUTEK,项目名称:KRES,代码行数:10,代码来源:ConfigNodeExt.cs

示例3: Globalization

 /// <summary>
 /// Configures <see cref="GlobalizationConfiguration"/>
 /// </summary>
 /// <param name="environment">An <see cref="INancyEnvironment"/> that should be configured.</param>
 /// <param name="supportedCultureNames">Cultures that the application can accept</param>
 /// <param name="defaultCulture">Used to set a default culture for the application</param>
 /// <param name="dateTimeStyles">The <see cref="DateTimeStyles"/> that should be used for date parsing.</param>
 /// <remarks>If defaultCulture not specified the first supported culture is used</remarks>
 public static void Globalization(this INancyEnvironment environment, IEnumerable<string> supportedCultureNames, string defaultCulture = null, DateTimeStyles? dateTimeStyles = null)
 {
     environment.AddValue(new GlobalizationConfiguration(
         supportedCultureNames: supportedCultureNames,
         defaultCulture: defaultCulture,
         dateTimeStyles: dateTimeStyles));
 }
开发者ID:RadifMasud,项目名称:Nancy,代码行数:15,代码来源:GlobalizationConfigurationExtensions.cs

示例4: Json

 /// <summary>
 /// Configures JSON serialization.
 /// </summary>
 /// <param name="environment"><see cref="INancyEnvironment"/> that should be configured.</param>
 /// <param name="maxJsonLength">Max length of JSON output.</param>
 /// <param name="defaultEncoding">The <see cref="Encoding"/> that should be as a default.</param>
 /// <param name="converters">List of <see cref="JavaScriptConverter"/> that should be used.</param>
 /// <param name="primitiveConverters">List of <see cref="JavaScriptPrimitiveConverter"/> that should be used.</param>
 /// <param name="retainCasing"><see langword="true" /> if C# casing should be retained, otherwise <see langword="false" /> to use camel-casing.</param>
 public static void Json(this INancyEnvironment environment, int? maxJsonLength = null, Encoding defaultEncoding = null, IList<JavaScriptConverter> converters = null, IList<JavaScriptPrimitiveConverter> primitiveConverters = null, bool? retainCasing = null)
 {
     environment.AddValue(new JsonConfiguration(
         defaultEncoding ?? JsonConfiguration.Default.DefaultEncoding,
         converters ?? JsonConfiguration.Default.Converters,
         primitiveConverters ?? JsonConfiguration.Default.PrimitiveConverters,
         retainCasing ?? JsonConfiguration.Default.RetainCasing));
 }
开发者ID:RadifMasud,项目名称:Nancy,代码行数:17,代码来源:JsonConfigurationExtensions.cs

示例5: AddValue

 /// <summary>SqlParameterCollection に連番のパラメタとその値を設定する。
 /// </summary>
 /// <param name="parameters"></param>
 /// <param name="parameternamePrefix"></param>
 /// <param name="values"></param>
 public static void AddValue(this SqlParameterCollection parameters, string parameternamePrefix, IEnumerable<int> values)
 {
     int i = -1;
     foreach (var value in values)
     {
         parameters.AddValue(parameternamePrefix + (++i), value);
     }
 }
开发者ID:robot-punk,项目名称:csharp_programs,代码行数:13,代码来源:SqlServerUtility.cs

示例6: Diagnostics

 /// <summary>
 /// Configures diagnostics.
 /// </summary>
 /// <param name="environment"><see cref="INancyEnvironment"/> that should be configured.</param>
 /// <param name="password">Password used to secure the dashboard.</param>
 /// <param name="path">Relative path of the dashboard.</param>
 /// <param name="cookieName">Name of the cookie to store diagnostics information.</param>
 /// <param name="slidingTimeout">Number of minutes that expiry of the diagnostics dashboard.</param>
 /// <param name="cryptographyConfiguration">Cryptography config to use for securing the dashboard.</param>
 public static void Diagnostics(this INancyEnvironment environment, string password, string path = null, string cookieName = null, int slidingTimeout = 15, CryptographyConfiguration cryptographyConfiguration = null)
 {
     environment.AddValue(new DiagnosticsConfiguration(
         password,
         path,
         cookieName,
         slidingTimeout,
         cryptographyConfiguration));
 }
开发者ID:afwilliams,项目名称:Nancy,代码行数:18,代码来源:DiagnosticsConfigurationExtensions.cs

示例7: GetAddValue

 /// <summary>
 /// Gets a value if available, otherwise adds the value and then returns the defaultValue
 /// </summary>
 public static string GetAddValue(this ConfigNode node, string name, string defaultValue)
 {
     if (node.HasValue(name))
     {
         return node.GetValue(name);
     }
     node.AddValue(name, defaultValue);
     return defaultValue;
 }
开发者ID:CYBUTEK,项目名称:KRES,代码行数:12,代码来源:ConfigNodeExt.cs

示例8: Json

 /// <summary>
 /// Configures JSON serialization.
 /// </summary>
 /// <param name="environment"><see cref="INancyEnvironment"/> that should be configured.</param>
 /// <param name="useIso8601DateFormat"><see langword="true" /> if ISO-860 date formats should be used, otherwise <see langword="false" />.</param>
 /// <param name="maxJsonLength">Max length of JSON output.</param>
 /// <param name="maxRecursions">Maximum number of recursions.</param>
 /// <param name="defaultEncoding">The <see cref="Encoding"/> that should be as a default.</param>
 /// <param name="converters">List of <see cref="JavaScriptConverter"/> that should be used.</param>
 /// <param name="primitiveConverters">List of <see cref="JavaScriptPrimitiveConverter"/> that should be used.</param>
 /// <param name="retainCasing"><see langword="true" /> if C# casing should be retained, otherwise <see langword="false" /> to use camel-casing.</param>
 public static void Json(this INancyEnvironment environment, bool? useIso8601DateFormat = null, int? maxJsonLength = null, int? maxRecursions = null, Encoding defaultEncoding = null, IList<JavaScriptConverter> converters = null, IList<JavaScriptPrimitiveConverter> primitiveConverters = null, bool? retainCasing = null)
 {
     environment.AddValue(new JsonConfiguration(
         useIso8601DateFormat ?? JsonConfiguration.Default.UseISO8601DateFormat,
         maxJsonLength ?? JsonConfiguration.Default.MaxJsonLength,
         maxRecursions ?? JsonConfiguration.Default.MaxRecursions,
         defaultEncoding ?? JsonConfiguration.Default.DefaultEncoding,
         converters ?? JsonConfiguration.Default.Converters,
         primitiveConverters ?? JsonConfiguration.Default.PrimitiveConverters,
         retainCasing ?? JsonConfiguration.Default.RetainCasing));
 }
开发者ID:afwilliams,项目名称:Nancy,代码行数:22,代码来源:JsonConfigurationExtensions.cs

示例9: Cultures

 /// <summary>
 /// Configures <see cref="GlobalizationConfiguration"/>
 /// </summary>
 /// <param name="environment">An <see cref="INancyEnvironment"/> that should be configured.</param>
 /// <param name="supportedCultureNames">Cultures that the application can accept</param>
 /// <param name="defaultCulture">Used to set a default culture for the application</param>
 /// <remarks>If defaultCulture not specified the first supported culture is used</remarks>
 public static void Cultures(this INancyEnvironment environment, IEnumerable<string> supportedCultureNames, string defaultCulture = null)
 {
     environment.AddValue(new GlobalizationConfiguration(
         supportedCultureNames: supportedCultureNames,
         defaultCulture: defaultCulture));
 }
开发者ID:VPashkov,项目名称:Nancy,代码行数:13,代码来源:GlobalizationConfigurationExtensions.cs

示例10: AddXml

        /// <summary>
        /// Add a new <see cref="T:System.String"/> XML value to the current <see cref="T:Tridion.ContentManager.Templating.Package" />
        /// </summary>
        /// <param name="package"><see cref="T:Tridion.ContentManager.Templating.Package" /></param>
        /// <param name="name">Name.</param>
        /// <param name="value">Value.</param>
        /// <remarks>An XML processing instruction is automatically added if required.</remarks>
        public static void AddXml(this Package package, String name, String value)
        {
            if (package != null)
            {
                String packageValue = value;

                // Add an XML prolog to ensure a valid XML snippet
                if (!packageValue.StartsWith("<?xml", StringComparison.OrdinalIgnoreCase))
                    packageValue = String.Format("<?xml version=\"1.0\" encoding=\"{0}\"?>\n", Encoding.UTF8.HeaderName) + packageValue;

                package.AddValue(ContentType.Xml, name, packageValue);
            }
        }
开发者ID:TcmExtensions,项目名称:TcmTemplating,代码行数:20,代码来源:PackageExtensions.cs

示例11: AddDateTime

 /// <summary>
 /// Add a new <see cref="T:System.DateTime"/> value to the current <see cref="T:Tridion.ContentManager.Templating.Package" />
 /// </summary>
 /// <param name="package"><see cref="T:Tridion.ContentManager.Templating.Package" /></param>
 /// <param name="name">Name.</param>
 /// <param name="value">Value.</param>
 public static void AddDateTime(this Package package, String name, DateTime value)
 {
     if (package != null)
         package.AddValue(ContentType.DateTime, name, value.ToString());
 }
开发者ID:TcmExtensions,项目名称:TcmTemplating,代码行数:11,代码来源:PackageExtensions.cs

示例12: AddNumber

 /// <summary>
 /// Add a new <see cref="T:System.Double"/> value to the current <see cref="T:Tridion.ContentManager.Templating.Package" />
 /// </summary>
 /// <param name="package"><see cref="T:Tridion.ContentManager.Templating.Package" /></param>
 /// <param name="name">Name.</param>
 /// <param name="value">Value.</param>
 public static void AddNumber(this Package package, String name, double value)
 {
     if (package != null)
         package.AddValue(ContentType.Number, name, value.ToString());
 }
开发者ID:TcmExtensions,项目名称:TcmTemplating,代码行数:11,代码来源:PackageExtensions.cs

示例13: AddXhtml

 /// <summary>
 /// Add a new <see cref="T:System.String"/> XHTML value to the current <see cref="T:Tridion.ContentManager.Templating.Package" />
 /// </summary>
 /// <param name="package"><see cref="T:Tridion.ContentManager.Templating.Package" /></param>
 /// <param name="name">Name.</param>
 /// <param name="value">Value.</param>
 public static void AddXhtml(this Package package, String name, String value)
 {
     if (package != null)
         package.AddValue(ContentType.Xhtml, name, value);
 }
开发者ID:TcmExtensions,项目名称:TcmTemplating,代码行数:11,代码来源:PackageExtensions.cs

示例14: SetOptionsSyntheticMargin

		internal static void SetOptionsSyntheticMargin(this Security security, decimal value)
		{
			security.AddValue(SecurityOptionsSyntheticMargin, value);
		}
开发者ID:rudrp,项目名称:StockSharp,代码行数:4,代码来源:SmartComExtensionInfoHelper.cs

示例15: SetEvMultiplier

		internal static void SetEvMultiplier(this ExecutionMessage trade, decimal multiplier)
		{
			trade.AddValue(_evMultiplier, multiplier);
		}
开发者ID:josan84,项目名称:StockSharp,代码行数:4,代码来源:Extensions.cs


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