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


C# Microsoft.GetValue方法代码示例

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


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

示例1: IISFix

 /// <summary>
 /// This fixes my mistake for naming IIS process "wp3.exe" and not "w3wp.exe" like it should be.
 /// </summary>
 /// <param name="key"></param>
 /// <param name="descriptorIndex"></param>
 internal static void IISFix( Microsoft.Win32.RegistryKey key, int descriptorIndex )
 {
     try {
         // get the name.
         var name = (string)key.GetValue ( ATASettings.Keys.AttachDescriptorName.With ( descriptorIndex ) );
         var processGroup = ATASettings.Keys.AttachDescriptorProcessNames.With ( descriptorIndex );
         var allProcesses = ( (string)key.GetValue ( processGroup ) )
                                                 .Split ( new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries );
         // does it have the fucked up process name?
         var hasWp3 = allProcesses.Any ( s => string.Compare ( s, "wp3.exe", true ) == 0 );
         // if it is iis, and it has the wrong process, fix that shit.
         if ( string.Compare ( name, "iis", true ) == 0 && hasWp3 ) {
             var newList = allProcesses.Where ( s => string.Compare ( s, "wp3.exe", true ) != 0 ).Concat ( new string[] { "w3wp.exe" } );
             key.SetValue ( processGroup, string.Join ( ";", newList ) );
         }
     } catch ( Exception ) {
         // if we dont have access to write, there is a problem.
     }
 }
开发者ID:modulexcite,项目名称:AttachToAny,代码行数:24,代码来源:Migrator.cs

示例2: EnsureAppInitSet

        public void EnsureAppInitSet(Microsoft.Win32.RegistryKey key, String szDllName)
        {
            key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(szAppInitKey, true);

            // Set the relevant values
            // TODO MAYBE record what these were set to and set them back if we uninstall?
            String LoadAppInit_DLLs = "LoadAppInit_DLLs";
            if (key.GetValue(LoadAppInit_DLLs, null) != null)
            {
                key.SetValue(LoadAppInit_DLLs, 1);
            }

            String RequireSignedAppInit_DLLs = "RequireSignedAppInit_DLLs";
            if (key.GetValue(RequireSignedAppInit_DLLs, null) != null)
            {
                key.SetValue(RequireSignedAppInit_DLLs, 1);
            }

            // Set the AppInit_Dlls value to include our DLL
            String value = key.GetValue(szAppInitValue).ToString();

            if (value.ToLower().Contains(GetDllPath(szDllName).ToLower()))
            {
                // Value already contains our DLL, so return
                return;
            }

            // Sanity check so I don't accidentally repeatedly add to this buffer
            if (value.Length > 1024)
            {
                // TODO Record an error
                return;
            }

            // Append a space if something is already there
            if (value.Length != 0)
            {
                value += " ";
            }

            // Append our DLL path
            value += GetDllPath(szDllName);

            // Set registry value
            key.SetValue(szAppInitValue, value);
        }
开发者ID:amohanta,项目名称:OpenHIPS,代码行数:46,代码来源:OhipsMonitor.cs

示例3: LoadSettings

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Tells the adapter to load it's settings from the specified keys.
		/// </summary>
		/// <param name="key"></param>
		/// ------------------------------------------------------------------------------------
		public void LoadSettings(Microsoft.Win32.RegistryKey key)
		{
			// Set the sidebar's width
			if (m_navPane.Parent != null)
				m_navPane.Parent.Width = (int)key.GetValue("SideBarWidth", m_navPane.Parent.Width);

			// Restore the active tab and active tab item.
			string tabName = key.GetValue("ActiveTab") as string;
			if (tabName != null)
			{
				// First set the current tab without causing events.
				SetCurrentTab(tabName, false);

				string itemName = key.GetValue("ActiveTabItem") as string;
				if (itemName != null)
					SetCurrentTabItem(tabName, itemName, true);
				else
				{
					// At this point, the registry didn't contain an active tab item, so
					// we'll set the current tab again, but this time generate events on
					// the assumption that when the application gets the event, it will
					// set a default tab item for the tab.
					SetCurrentTab(tabName, true);
				}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:32,代码来源:SIBAdapter.cs

示例4: getRegValue

 private string getRegValue(Microsoft.Win32.RegistryKey key, string keyName)
 {
     try
     {
         return key.GetValue(keyName).ToString();
     }
     catch
     {
         return null;
     }
 }
开发者ID:j3wbacca,项目名称:Trillium-CC-Allocator,代码行数:11,代码来源:ReportPrinter.cs

示例5: GetApplicationBar

 public static DeepForest.Phone.Assets.Shell.ApplicationBar GetApplicationBar(Microsoft.Phone.Controls.PhoneApplicationPage obj)
 {
     return (DeepForest.Phone.Assets.Shell.ApplicationBar)obj.GetValue(ApplicationBarProperty);
 }
开发者ID:Rakoun,项目名称:librometer,代码行数:4,代码来源:PhoneApplicationPage.cs

示例6: CopyKeyRecursive

                private static void CopyKeyRecursive(Microsoft.Win32.RegistryKey sourceKey, Microsoft.Win32.RegistryKey destKey)
                {
                        foreach (string ValueName in sourceKey.GetValueNames()) {
                                object Val = sourceKey.GetValue(ValueName);
                                destKey.SetValue(ValueName, Val, sourceKey.GetValueKind(ValueName));
                        }

                        foreach (string SubKeyName in sourceKey.GetSubKeyNames()) {
                                using (Microsoft.Win32.RegistryKey sourceSubKey = sourceKey.OpenSubKey(SubKeyName, false))
                                using (Microsoft.Win32.RegistryKey destSubKey = destKey.CreateSubKey(SubKeyName)) {
                                        CopyKeyRecursive(sourceSubKey, destSubKey);
                                }
                        }
                }
开发者ID:solutema,项目名称:ultralight,代码行数:14,代码来源:Program.cs

示例7: GetApplicationBar

 public static ApplicationBar GetApplicationBar(Microsoft.Phone.Controls.PhoneApplicationPage obj)
 {
     return (ApplicationBar)obj.GetValue(ApplicationBarProperty);
 }
开发者ID:arielbh,项目名称:SuiteValue.UI,代码行数:4,代码来源:PhoneApplicationPage.cs

示例8: GetCommand

 public static ICommand GetCommand(Microsoft.Phone.Controls.PhoneApplicationPage buttonBase)
 {
     return buttonBase.GetValue(CommandProperty) as ICommand;
 }
开发者ID:284247028,项目名称:MvvmCross,代码行数:4,代码来源:BackKeyPress.cs

示例9: VsPackageInfo

 public VsPackageInfo(Microsoft.Win32.RegistryKey packageKey)
 {
     DefaultName = packageKey.GetValue(System.String.Empty) as string;
     Class = packageKey.GetValue("Class") as string;
 }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:5,代码来源:VsPackageInfo.cs

示例10: LoadSettings

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Load the active tab's settings.
		/// </summary>
		///
		/// <param name='key'>The Registry Key.</param>
		/// ------------------------------------------------------------------------------------
		private void LoadSettings(Microsoft.Win32.RegistryKey key)
		{
			SuspendLayout();

			try
			{
				IRegistryKeyNameModifier modifier = Parent.Parent as IRegistryKeyNameModifier;
				key = modifier.ModifyKey(key, true);
			}
			catch
			{}
			m_nPressedButtonsStartup = (int)key.GetValue(Name + "State", -1);

			if (m_nPressedButtonsStartup != -1 && Buttons.Count > 0)
			{
				// note: In TE, there are no buttons created yet when settings are loaded.
				// So this section of code is probably never used.
				// Instead, the ResumeLayout() method takes care of the initial pressing of
				//buttons later, when the tab is redrawn after the buttons are created.
				for (int i = 0; i < Buttons.Count; i++)
				{
					bool fPress = (m_nPressedButtonsStartup & (1 << i)) != 0;
					Buttons[i].PressButton(fPress);
					// Also visually click only if not suspended (we are suspended at least once, because we
					// call SuspendLayout() above!)
					if (fPress && m_nSuspendedLayout < 2)
					{
						// Also click a pressed button if appropriate
						if (fPress && OkToClickAButtonInThisTab)
							Buttons[i].PerformClick();
					}
				}

				// Clear the startup button states, now that we have used them
				m_nPressedButtonsStartup = -1;
			}

			int nDefault = LargeIconsShowing ? 1 : 0;
			LargeIconsShowing = ((int)key.GetValue(Name + "LargeIcons", nDefault) == 1)
				? true : false;

			ResumeLayout();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:50,代码来源:SideBarTab.cs

示例11: getSmtpQSetting

        private string getSmtpQSetting(Microsoft.Win32.RegistryKey kSmtpQ,
            string name, string defaultVal)
        {
            string s;
            Object objVal;

            s = null;
            objVal = null;
            objVal = kSmtpQ.GetValue(name);
            if (objVal != null) s = objVal.ToString();
            if (s == null)
            {
                kSmtpQ.SetValue(name, defaultVal, Microsoft.Win32.RegistryValueKind.String);
                objVal = kSmtpQ.GetValue(name);
                if (objVal != null) s = objVal.ToString();
            }
            return s;
        }
开发者ID:chilkatsoft,项目名称:Chilkat-SMTPQ,代码行数:18,代码来源:Form1.cs

示例12: GetVsPackages

 public void GetVsPackages(Microsoft.Win32.RegistryKey hiveRoot, Microsoft.Win32.RegistryKey editorKey, string editorExt)
 {
     if ((extension == null) || (System.StringComparer.OrdinalIgnoreCase.Compare(editorExt, extension) == 0))
     {
         string s = editorKey.GetValue("Package") as string;
         if (!System.String.IsNullOrEmpty(s))
         {
             using (Microsoft.Win32.RegistryKey registryKey = hiveRoot.OpenSubKey("Packages\\" + s))
             {
                 if ((registryKey != null) && !editors.ContainsKey(registryKey.Name))
                     editors.Add(registryKey.Name, new VsPackageInfo(registryKey));
             }
         }
     }
 }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:15,代码来源:PDERegistry.cs

示例13: GetCommandParameter

 public static object GetCommandParameter(Microsoft.Phone.Controls.PhoneApplicationPage buttonBase)
 {
     return buttonBase.GetValue(CommandParameterProperty);
 }
开发者ID:284247028,项目名称:MvvmCross,代码行数:4,代码来源:BackKeyPress.cs

示例14: OnLoadSettings

		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected override void OnLoadSettings(Microsoft.Win32.RegistryKey key)
		{
			base.OnLoadSettings(key);

			if (m_list == null || key == null)
				return;

			string value = key.GetValue("SelectedCheckingError", null) as string;
			if (value != null)
			{
				Guid guid = new Guid(value);
				SelectCheckingError(guid);
			}
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:19,代码来源:EditorialChecksRenderingsControl.cs

示例15: LoadSettings

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Tells the adapter to load it's settings from the specified keys.
		/// </summary>
		/// <param name="key"></param>
		/// ------------------------------------------------------------------------------------
		public void LoadSettings(Microsoft.Win32.RegistryKey key)
		{
			// TODO for SilSidePane: some functionality here about setting items and tabs is irrelevant with SilSidePane, so identify and remove it.

			// Set the sidebar's width
			if (m_sidePane.ContainingControl != null)
				m_sidePane.ContainingControl.Width = (int)key.GetValue("SideBarWidth", m_sidePane.ContainingControl.Width);

			// Restore the active tab and active tab item.
			string tabName = key.GetValue("ActiveTab") as string;
			if (tabName != null)
			{
				// First set the current tab without causing events.
				SetCurrentTab(tabName, false);

				string itemName = key.GetValue("ActiveTabItem") as string;
				if (itemName != null)
					SetCurrentTabItem(tabName, itemName, true);
				else
				{
					// At this point, the registry didn't contain an active tab item, so
					// we'll set the current tab again, but this time generate events on
					// the assumption that when the application gets the event, it will
					// set a default tab item for the tab.
					SetCurrentTab(tabName, true);
				}
			}
			else
			{
				// Set to a default tab and tab item.
				// Use the first item on the first tab, rather than kScrSBTabName, kScrDraftViewSBItemName, since
				// this library shouldn't have to know what buttons the application uses.
				var tab = m_tabProps[0];
				if (null != tab)
				{
					SetCurrentTab(tab.Name, true);
					// Setting first item on tab should happen automatically.
				}
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:46,代码来源:SIBAdapter.cs


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