コード例 #1
0
ファイル: FilePath.cs プロジェクト: formist/LinkMe
        public static string GetShortPathName(string fullPath)
        {
            var shortPath = new StringBuilder(Constants.Path.MaxPath, Constants.Path.MaxPath);

            if (GetShortPathName(fullPath, shortPath, Constants.Path.MaxPath) == 0)
            {
                throw new COMException(StringResourceManager.Format(Resources.Exceptions.FilePathShortPathName, fullPath), Marshal.GetLastWin32Error());
            }
            return(shortPath.ToString());
        }
コード例 #2
0
 public bool InstallAssemblyFile(string filePath)
 {
     if (filePath == null)
     {
         throw new ArgumentNullException("filePath");
     }
     if (!File.Exists(filePath))
     {
         throw new FileNotFoundException(StringResourceManager.Format(Resources.Exceptions.GacUtilAssemblyFileNotFound, filePath), filePath);
     }
     return(GAC.InstallAssembly((uint)IASSEMBLYCACHE_INSTALL_FLAG.IASSEMBLYCACHE_INSTALL_FLAG_FORCE_REFRESH, filePath, null) == 0);
 }
コード例 #3
0
 public static StringResourceManager GetManager(System.Type source)
 {
     lock ( Lock )
     {
         if (s_managers.ContainsKey(source))
         {
             return(s_managers[source]);
         }
         else
         {
             StringResourceManager manager = new StringResourceManager(source);
             s_managers[source] = manager;
             return(manager);
         }
     }
 }
コード例 #4
0
        public static string GetString(System.Type source, string name)
        {
            StringResourceManager manager = GetManager(source);

            return(manager.GetString(name));
        }
コード例 #5
0
        public static string GetString(System.Type source, string name, params object[] args)
        {
            StringResourceManager manager = GetManager(source);

            return(manager.GetString(name, args));
        }
コード例 #6
0
 public ResourceDescriptionAttribute(System.Type source, string name)
     : base(name)
 {
     m_manager = StringResourceManager.GetManager(source);
 }
コード例 #7
0
 public ResourceDisplayNameAttribute(System.Type source, string name)
     : base(name)
 {
     m_manager = StringResourceManager.GetManager(source);
 }
コード例 #8
0
 public ResourceCategoryAttribute(System.Type source, string category)
     : base(category)
 {
     m_manager = StringResourceManager.GetManager(source);
 }