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


C# IProperties.GetBoolean方法代码示例

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


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

示例1: Initialize

		/// <summary>
		/// Initialization override for update management
		/// </summary>
		/// <param name="pluginOptions"></param>
		public override void Initialize(IProperties pluginOptions)
		{
			// Base
			base.Initialize(pluginOptions);

			// Initiate update management
			bool checkAtStartup = pluginOptions.GetBoolean(Updater.CheckUpdatesOnStartupOptionName, true);
			if (checkAtStartup)
			{
				Updater.Check(pluginOptions);
			}
		}
开发者ID:stevebeauge,项目名称:crayon-syntax-snippet-wlw,代码行数:16,代码来源:CrayonSnippetPlugin.cs

示例2: Check

		/// <summary>
		/// Check on startup
		/// </summary>
		/// <param name="properties">Plugin properties</param>
		/// <param name="ownerWindow">Owner window if any</param>
		public static void Check(IProperties properties, IWin32Window ownerWindow = null)
		{
			bool includePreReleaseVersions = properties.GetBoolean(IncludePreReleaseVersionsOptionName, false);
			VersionInfo latestVersion = GetLatestVersion(includePreReleaseVersions);
			string currentDateTime = DateTime.UtcNow.ToLocalTime().ToString("F", CultureInfo.CurrentCulture);
			properties.SetString(LastUpdateCheckDateOptionName, currentDateTime);

			// Check if latest version is more than installed version
			if (latestVersion == null)
			{
				if (ownerWindow != null)
				{
					MessageBox.Show(ownerWindow, Resources.Error_UpdateCheckFailure, Resources.Label_Warning);
				}
			}
			else if (latestVersion.Version > InstalledVersion.Version)
			{
				if (DialogResult.OK == MessageBox.Show(ownerWindow, string.Format(CultureInfo.CurrentCulture, Resources.Text_LatestVersionAvailableDownloadPrompt_Version,
								latestVersion.Version),
							Resources.Label_Information, MessageBoxButtons.OKCancel, MessageBoxIcon.Question,
							MessageBoxDefaultButton.Button1))
				{
					using (var updateForm = new DownloadUpdateForm(latestVersion))
					{
						DialogResult result = updateForm.ShowDialog(ownerWindow);
						if ((result == DialogResult.OK)
							&& updateForm.Downloaded)
						{
							Process.Start(new ProcessStartInfo(updateForm.DownloadedSetupFile));
						}
					}
				}
			}
			else
			{
				if (ownerWindow != null)
				{
					MessageBox.Show(ownerWindow, string.Format(CultureInfo.CurrentCulture, Resources.Text_InstalledVersionUpToDate_Version, InstalledVersion.Version), Resources.Label_Information);
				}
			}
		}
开发者ID:stevebeauge,项目名称:crayon-syntax-snippet-wlw,代码行数:46,代码来源:Updater.cs

示例3: GetImageMargin

 public static MarginStyle GetImageMargin(IProperties props)
 {
     if (props.GetBoolean(CUSTOM_MARGIN, false))
     {
         int top = props.GetInt(MARGIN_TOP, WriterDefaultMargin.Top);
         int right = props.GetInt(MARGIN_RIGHT, WriterDefaultMargin.Right);
         int bottom = props.GetInt(MARGIN_BOTTOM, WriterDefaultMargin.Bottom);
         int left = props.GetInt(MARGIN_LEFT, WriterDefaultMargin.Left);
         return new MarginStyle(top, right, bottom, left, StyleSizeUnit.PX);
     }
     else
     {
         return WriterDefaultMargin;
     }
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:15,代码来源:HtmlMarginDecorator.cs


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