示例#1
0
        public override int GetHashCode()
        {
            var hash = 13;

            hash = (hash * 7) + LCID.GetHashCode();

            return(hash);
        }
 public void OutputLCID(LCID valueSet)
 {
     OutputStatusMessage(string.Format("Values in {0}", valueSet.GetType()));
     foreach (var value in Enum.GetValues(typeof(LCID)))
     {
         OutputStatusMessage(value.ToString());
     }
 }
示例#3
0
        public override int GetHashCode()
        {
            int result = 10;

            for (int i = 0; i < value.Length; i += 1)
            {
                result = 91 * result + (int)(value [i] ^ (value [i] >> 32));
            }
            result = 91 * result + LCID.GetHashCode();
            result = 91 * result + (int)compareOptions;
            return(result);
        }
 public static unsafe partial int OleCreatePropertyFrame(
     IntPtr hwndOwner,
     int x,
     int y,
     string caption,
     uint cObjects,
     IntPtr *pobjs,
     uint cPages,
     Guid *pClsid,
     LCID lcid,
     uint dwReserved,
     IntPtr pvReserved);
示例#5
0
        public static string ToLCIDString(this LCID lcid)
        {
            switch (lcid)
            {
            case LCID.enUS:
                return(LCIDStrings.enUS);

            case LCID.zhCHS:
                return(LCIDStrings.zhCHS);

            default:
                return(LCIDStrings.enUS);
            }
        }
 public unsafe static void OleCreatePropertyFrame(
     HandleRef hwndOwner,
     int x,
     int y,
     string caption,
     uint cObjects,
     IntPtr *pobjs,
     uint cPages,
     Guid *pClsid,
     LCID lcid,
     uint dwReserved,
     IntPtr pvReserved)
 {
     OleCreatePropertyFrame(hwndOwner.Handle, x, y, caption, cObjects, pobjs, cPages, pClsid, lcid, dwReserved, pvReserved);
     GC.KeepAlive(hwndOwner.Wrapper);
 }
        /// <summary>
        /// Determines whether the specified Object is equal to the current Object.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }


            var other = (VLLanguage)obj;

            //reference types
            if (!Object.Equals(EnglishName, other.EnglishName))
            {
                return(false);
            }
            if (!Object.Equals(Name, other.Name))
            {
                return(false);
            }
            if (!Object.Equals(TwoLetterISOCode, other.TwoLetterISOCode))
            {
                return(false);
            }
            if (!Object.Equals(ThreeLetterISOCode, other.ThreeLetterISOCode))
            {
                return(false);
            }
            //value types
            if (!LanguageId.Equals(other.LanguageId))
            {
                return(false);
            }
            if (!LCID.Equals(other.LCID))
            {
                return(false);
            }

            return(true);
        }
示例#8
0
 public static extern int MpqSetFileLocale(int hMPQ, String lpFileName, LCID nOldLocale, LCID nNewLocale);
示例#9
0
 public static extern LCID SFileSetLocale(LCID nNewLocale);
 public extern static BOOL SetThreadLocale(LCID Locale);
示例#11
0
        // 取得國別碼
        public static LCID GetLocaleID(TLocaleID xLocaleID)
        {
            LCID result = null;

            return(result);
        }
示例#12
0
 public bool Equals(LCID other) => other.RawValue == RawValue;
 virtual HRESULT __stdcall Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 {
     return(E_NOTIMPL);
 }
示例#14
0
 public static extern int MpqSetFileLocale(int hMPQ, String lpFileName, LCID nOldLocale, LCID nNewLocale);
示例#15
0
 public Boolean Update(LCID lcid)
 {
     return(Update(lcid.GetCultureInfo()));
 }
 virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetErrorInfo(
     /* [in] */ ULONG ulRecordNum,
     /* [in] */ LCID lcid,
     /* [out] */ IErrorInfo **ppErrorInfo) = 0;
示例#17
0
 public static extern bool EnumSystemLocales(LOCALE_ENUMPROC lpLocaleEnumProc, LCID dwFlags);
示例#18
0
文件: LocaleManaged.cs 项目: rr-/ALAS
        public static extern bool EnumSystemLocales(
			EnumLocalesProcDelegate pEnumProc,
			LCID dwFlags);
示例#19
0
 virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetErrorInfo(
     /* [in] */ ULONG ulRecordNum,
     /* [in] */ LCID lcid,
     /* [out] */ IErrorInfo **ppErrorInfo) = 0;
示例#20
0
 public static extern LCID SFileSetLocale(LCID nNewLocale);
示例#21
0
 public static Boolean Update(LCID lcid)
 {
     return(Current.Update(lcid));
 }
 virtual HRESULT __stdcall GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 {
     return(E_NOTIMPL);
 }
示例#23
0
        public static CultureInfo ToCultureInfo(this LCID lcid)
        {
            string lcidString = lcid.ToLCIDString();

            return(new CultureInfo(lcidString));
        }
        /// <summary>
        /// Save language to file
        /// </summary>
        internal virtual void Save()
        {
            if (!IsValid())
            {
                throw new InvalidOperationException("Invalid settings");
            }

            if (!Directory.Exists(ToolLanguages.DirectoryPath))
            {
                Directory.CreateDirectory(ToolLanguages.DirectoryPath);
            }
            string targetFilePath = Path.Combine(ToolLanguages.DirectoryPath, LCID + ToolLanguages.Extension);

            string tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());

            Directory.CreateDirectory(tempPath);

            XDocument indexDocument = new XDocument();
            XElement  rootNode      = new XElement("NetOffice.DeveloperToolbox.Translation.ToolLanguage");

            rootNode.Add(new XElement("NameGlobal", System.Xml.XmlConvert.EncodeName(NameGlobal)));
            rootNode.Add(new XElement("NameLocal", System.Xml.XmlConvert.EncodeName(Name)));
            rootNode.Add(new XElement("LCID", System.Xml.XmlConvert.EncodeName(LCID.ToString())));
            rootNode.Add(new XElement("AuthorName", System.Xml.XmlConvert.EncodeName(Author)));
            rootNode.Add(new XElement("AuthorMail", System.Xml.XmlConvert.EncodeName(AuthorMail)));
            rootNode.Add(new XElement("AuthorSite", System.Xml.XmlConvert.EncodeName(AuthorSite)));
            indexDocument.Add(rootNode);
            indexDocument.Save(Path.Combine(tempPath, "Index"));

            foreach (var item in Application.Components)
            {
                XDocument appComponentDocument = new XDocument();
                XElement  rootAppComponent     = new XElement("NetOffice.DeveloperToolbox.Translation.Component", new XAttribute("IsSystem", true));

                foreach (var subItem in item.ControlResources)
                {
                    rootAppComponent.Add(new XElement("Pair", new XElement("Name", subItem.Value), new XElement("Value", subItem.Value2)));
                }

                rootAppComponent.Save(Path.Combine(tempPath, item.Value));
            }

            foreach (var item in Components)
            {
                XDocument appComponentDocument = new XDocument();
                XElement  rootAppComponent     = new XElement("NetOffice.DeveloperToolbox.Translation.Component", new XAttribute("IsSystem", false));

                foreach (var subItem in item.ControlResources)
                {
                    rootAppComponent.Add(new XElement("Pair", new XElement("Name", subItem.Value), new XElement("Value", System.Xml.XmlConvert.EncodeName(subItem.Value2))));
                }
                rootAppComponent.Save(Path.Combine(tempPath, item.Value));
            }

            ZipFile.CreateFromDirectory(tempPath, targetFilePath);

            Directory.Delete(tempPath, true);

            _parent.ValidateFiles();

            IsNew   = false;
            IsDirty = false;
        }
示例#25
0
 public static extern bool IsValidLocale(uint Locale, LCID dwFlags);
 virtual HRESULT __stdcall GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 {
     return(E_NOTIMPL);
 }
示例#27
0
 public static Boolean TryGetCultureInfo(this LCID lcid, out CultureInfo info)
 {
     return(TryGetCultureInfo(lcid.Code, out info));
 }
示例#28
0
 public static partial BOOL SetThreadLocale(LCID Locale);