Source/BarFunctions.cs

(开头部分) 82KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Drawing;
using System.Reflection;
using System.Xml;
using System.Resources;
using System.Collections;
using System.Windows.Forms;
using DevComponents.DotNetBar.Design;
using System.ComponentModel;
using System.Drawing.Drawing2D;

namespace DevComponents.DotNetBar
{
	/// <summary>
	/// Summary description for BarFunctions.
	/// </summary>
	internal sealed class BarFunctions
	{
		public const int ANIMATION_INTERVAL=100;
		
		private static string ms_ResourceName="";
		const string DEFAULT_RESOURCE=".Strings";
		private static bool m_ThemedOS=false;
        private static bool m_IsVista = false;
		private static bool m_SupportsAnimation=true;

		static BarFunctions()
		{

			m_ThemedOS=false;
			
			NativeFunctions.OSVERSIONINFO os = new NativeFunctions.OSVERSIONINFO();
			os.dwOSVersionInfoSize=System.Runtime.InteropServices.Marshal.SizeOf(typeof(NativeFunctions.OSVERSIONINFO)); 
			NativeFunctions.GetVersionEx(ref os);
			if(os.dwPlatformId==2 && os.dwMajorVersion==4)
				m_SupportsAnimation=false;
			if(os.dwMajorVersion==5 && os.dwMinorVersion>=1 && os.dwPlatformId==2 ||
                os.dwMajorVersion > 5 && os.dwPlatformId == 2)
				m_ThemedOS=System.Windows.Forms.OSFeature.Feature.IsPresent(System.Windows.Forms.OSFeature.Themes);
            m_IsVista = System.Environment.OSVersion.Version.Major >= 6;
			RefreshScreens();
		}

        internal static char GetCharForKeyValue(int keyValue)
        {
            byte[] chars = new byte[2];
            try
            {
                byte[] keyState = new byte[256];
                if (NativeFunctions.GetKeyboardState(keyState))
                {
                    if (NativeFunctions.ToAscii((uint)keyValue, 0, keyState, chars, 0) != 0)
                    {
                        return (char)chars[0];
                    }
                }
            }
            catch (Exception)
            {
                return char.MinValue;
后面还有 2058 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。