OSDN Git Service

na-get-lib,不使用メソッドの削除
[applistation/AppliStation.git] / na-get-lib / NaGet / Utils.cs
index 8bd2e09..3e511b6 100644 (file)
@@ -1,8 +1,10 @@
 using System;\r
 using System;\r
+using System.Collections.Generic;\r
 using System.IO;\r
 using System.Text;\r
 using System.Globalization;\r
 using System.Security.Principal;\r
 using System.IO;\r
 using System.Text;\r
 using System.Globalization;\r
 using System.Security.Principal;\r
+using System.Security.AccessControl;\r
 using System.Reflection;\r
 using System.Diagnostics;\r
 using Microsoft.Win32;\r
 using System.Reflection;\r
 using System.Diagnostics;\r
 using Microsoft.Win32;\r
@@ -13,14 +15,9 @@ namespace NaGet
        /// <summary>\r
        /// 雑多な便利メソッドを集めたクラス\r
        /// </summary>\r
        /// <summary>\r
        /// 雑多な便利メソッドを集めたクラス\r
        /// </summary>\r
-       public sealed class Utils\r
+       public static class Utils\r
        {\r
        {\r
-               /// <summary>\r
-               /// 呼び出し禁止\r
-               /// </summary>\r
-               private Utils()\r
-               {\r
-               }\r
+               #region 汎用的なオブジェクト操作メソッド\r
                \r
                /// <summary>\r
                /// オブジェクトのフィールドをコピーしてクローン化する\r
                \r
                /// <summary>\r
                /// オブジェクトのフィールドをコピーしてクローン化する\r
@@ -36,10 +33,108 @@ namespace NaGet
                        }\r
                }\r
                \r
                        }\r
                }\r
                \r
+               #endregion\r
+               \r
+               #region リスト関連関数\r
+               \r
+               /// <summary>\r
+               /// イテレータを結合して、返す\r
+               /// </summary>\r
+               /// <param name="enus">元となる複数のイテレータ</param>\r
+               /// <returns>結合されたイテレータ</returns>\r
+               public static IEnumerable<T> MergeEnumerable<T>(params IEnumerable<T>[] enus)\r
+               {\r
+                       foreach (IEnumerable<T> enu in enus) {\r
+                               if (enu == null) continue;\r
+                               \r
+                               foreach (T elem in enu) {\r
+                                       yield return elem;\r
+                               }\r
+                       }\r
+               }\r
+\r
                /// <summary>\r
                /// <summary>\r
-               /// ã\83\91ã\82¹å¤\89æ\95°ã\81«æ\8c\87å®\9aã\81®ã\83\95ã\82©ã\83«ã\83\80ã\82\92追å\8a ã\81\99ã\82\8b\r
+               /// ã\82¤ã\83\86ã\83¬ã\83¼ã\82¿ã\82\92çµ\90å\90\88ã\81\97ã\81¦ã\80\81è¿\94ã\81\99\r
                /// </summary>\r
                /// </summary>\r
-               /// <param name="dir">追加するフォルダ</param>\r
+               /// <param name="enus">元となる複数のイテレータ</param>\r
+               /// <returns>結合されたイテレータ</returns>\r
+               public static IEnumerable<T> MergeEnumerable<T>(params IEnumerator<T>[] enus)\r
+               {\r
+                       foreach (IEnumerator<T> enu in enus) {\r
+                               if (enu == null) continue;\r
+                               \r
+                               try {\r
+                                       while (enu.MoveNext()) {\r
+                                               yield return enu.Current;\r
+                                       }\r
+                               } finally {\r
+                                       enu.Dispose();\r
+                               }\r
+                       }\r
+               }\r
+               \r
+               /// <summary>\r
+               /// イテレータを結合して、Listとして返す\r
+               /// </summary>\r
+               /// <param name="enus">元となる複数のイテレータ</param>\r
+               /// <returns>結合されたイテレータ</returns>\r
+               public static List<T> MergeList<T>(params IEnumerable<T>[] enus)\r
+               {\r
+                       List<T> list = new List<T>();\r
+                       \r
+                       foreach (IEnumerable<T> enu in enus) {\r
+                               if (enu == null) continue;\r
+                       \r
+                               list.AddRange(enu);\r
+                       }\r
+                       return list;\r
+               }\r
+               \r
+               /// <summary>\r
+               /// イテレータを配列に効率的に変換する\r
+               /// </summary>\r
+               /// <remarks>与えられる型が具体的にわかっているならば、それに特化した手続きをとる方が好ましい</remarks>\r
+               /// <param name="enu">元となるイテレータ</param>\r
+               /// <returns>変換された配列</returns>\r
+               public static T[] IEnumerable2Array<T>(IEnumerable<T> enu) {\r
+                       T[] retval = enu as T[];\r
+                       \r
+                       if (retval == null) {\r
+                               List<T> list = enu as List<T>;\r
+                               if (list == null) {\r
+                                       list = new List<T>(enu);\r
+                               }\r
+                               retval = list.ToArray();\r
+                       }\r
+                       \r
+                       return retval;\r
+               }\r
+               \r
+               /// <summary>\r
+               /// リストに対して指定した2つの要素の位置を入れ替える\r
+               /// </summary>\r
+               /// <param name="list">操作対象のリスト</param>\r
+               /// <param name="indexA">位置</param>\r
+               /// <param name="indexB">位置</param>\r
+               public static void ListSwap(System.Collections.IList list, int indexA, int indexB)\r
+               {\r
+                       if ((indexA < 0) || (list.Count <= indexA) || (indexB < 0) || (list.Count <= indexB)) {\r
+                               throw new IndexOutOfRangeException();\r
+                       } else if (indexA != indexB) {\r
+                               object temp = list[indexA];\r
+                               list[indexA] = list[indexB];\r
+                               list[indexB] = temp;\r
+                       }\r
+               }\r
+               \r
+               #endregion\r
+                               \r
+               #region ファイル情報関連ユーテイリティ関数\r
+               \r
+               /// <summary>\r
+               /// パス変数に指定のフォルダーを追加する\r
+               /// </summary>\r
+               /// <param name="dir">追加するフォルダー</param>\r
                public static void AddDirectoryToPath(string dir)\r
                {\r
                        string path = Environment.GetEnvironmentVariable("PATH");\r
                public static void AddDirectoryToPath(string dir)\r
                {\r
                        string path = Environment.GetEnvironmentVariable("PATH");\r
@@ -73,15 +168,13 @@ namespace NaGet
                return FormatSize((double) bytes);\r
         }\r
                \r
                return FormatSize((double) bytes);\r
         }\r
                \r
-               #region ファイル操作関数群\r
-               \r
                /// <summary>\r
                /// URLからそのファイル名を生成する\r
                /// </summary>\r
                /// <param name="url">対象のurl</param>\r
                /// <summary>\r
                /// URLからそのファイル名を生成する\r
                /// </summary>\r
                /// <param name="url">対象のurl</param>\r
-               public static string Url2filename(string url)\r
+               public static string Url2filename(Uri url)\r
                {\r
                {\r
-                       string filename = Path.GetFileName(UrlDecode(url, Encoding.UTF8));\r
+                       string filename = Path.GetFileName(System.Web.HttpUtility.UrlDecode(url.ToString(), Encoding.UTF8));\r
                        \r
                        int pos;\r
                        if ((pos = filename.IndexOfAny(Path.GetInvalidFileNameChars())) >= 0) {\r
                        \r
                        int pos;\r
                        if ((pos = filename.IndexOfAny(Path.GetInvalidFileNameChars())) >= 0) {\r
@@ -97,85 +190,9 @@ namespace NaGet
                }\r
                \r
                /// <summary>\r
                }\r
                \r
                /// <summary>\r
-               /// URLのデコードを行う\r
+               /// 再帰的にファイルの属性を指定します。強制的にフォルダーの再帰削除の前に読み込み専用属性を消すのに使います。\r
                /// </summary>\r
                /// </summary>\r
-               /// <param name="s">対象のurl文字列</param>\r
-               /// <param name="e">デコードの処理に使う文字コード</param>\r
-               public static string UrlDecode(string s, Encoding e)\r
-               {\r
-                       // mono の System.Net.HttpUtility より作成\r
-                       \r
-                       if (null == s)\r
-                               return null;\r
-\r
-                       if (s.IndexOf ('%') == -1 && s.IndexOf ('+') == -1)\r
-                               return s;\r
-\r
-                       if (e == null)\r
-                               e = Encoding.GetEncoding (28591);\r
-\r
-                       StringBuilder output = new StringBuilder ();\r
-                       long len = s.Length;\r
-                       NumberStyles hexa = NumberStyles.HexNumber;\r
-                       MemoryStream bytes = new MemoryStream ();\r
-\r
-                       for (int i = 0; i < len; i++) {\r
-                               if (s [i] == '%' && i + 2 < len) {\r
-                                       if (s [i + 1] == 'u' && i + 5 < len) {\r
-                                               if (bytes.Length > 0) {\r
-                                                       //output.Append (GetChars (bytes, e));\r
-                                                       output.Append(e.GetChars(bytes.GetBuffer(), 0, (int) bytes.Length));\r
-                                                       bytes.SetLength (0);\r
-                                               }\r
-                                               \r
-                                               output.Append ((char) int.Parse(s.Substring (i + 2, 4), hexa));\r
-                                               i += 5;\r
-                                       } else {\r
-                                               bytes.WriteByte ((byte) int.Parse(s.Substring (i + 1, 2), hexa));\r
-                                               i += 2;\r
-                                       }\r
-                                       continue;\r
-                               }\r
-\r
-                               if (bytes.Length > 0) {\r
-                                       //output.Append (GetChars (bytes, e));\r
-                                       output.Append(e.GetChars(bytes.GetBuffer(), 0, (int) bytes.Length));\r
-                                       bytes.SetLength (0);\r
-                               }\r
-\r
-                               if (s [i] == '+') {\r
-                                       output.Append (' ');\r
-                               } else {\r
-                                       output.Append (s [i]);\r
-                               }\r
-                       }\r
-\r
-                       if (bytes.Length > 0) {\r
-                               //output.Append (GetChars (bytes, e));\r
-                               output.Append(e.GetChars(bytes.GetBuffer(), 0, (int) bytes.Length));\r
-                       }\r
-\r
-                       bytes = null;\r
-                       return output.ToString ();\r
-               }\r
-               \r
-               /// <summary>\r
-               /// ファイルパスから、指定のパスセパレータの意味でファイル名を取り出す。\r
-               /// </summary>\r
-               /// <param name="filepath">ファイルパス(またはURLパス)</param>\r
-               /// <param name="separator">パスセパレータ</param>\r
-               public static string Basedir(string filepath, char separator)\r
-               {\r
-                       int dirSep = filepath.LastIndexOf(separator);\r
-                       if (dirSep < 0) return "";\r
-\r
-                       return filepath.Substring(0, dirSep);\r
-               }\r
-               \r
-               /// <summary>\r
-               /// 再帰的にファイルの属性を指定します。強制的にフォルダの再帰削除の前に読み込み専用属性を消すのに使います。\r
-               /// </summary>\r
-               /// <param name="path">設定するフォルダ</param>\r
+               /// <param name="path">設定するフォルダー</param>\r
                /// <param name="attr">設定する属性値</param>\r
                public static void SetAttributeRecursive(string path, FileAttributes attr)\r
                {\r
                /// <param name="attr">設定する属性値</param>\r
                public static void SetAttributeRecursive(string path, FileAttributes attr)\r
                {\r
@@ -187,17 +204,38 @@ namespace NaGet
                                File.SetAttributes(file, attr);\r
                        }\r
                        \r
                                File.SetAttributes(file, attr);\r
                        }\r
                        \r
-                       // 子フォルダを再帰的に属性変更\r
+                       // å­\90ã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\82\92å\86\8d帰ç\9a\84ã\81«å±\9eæ\80§å¤\89æ\9b´\r
                        foreach (string file in Directory.GetDirectories(path)) {\r
                                SetAttributeRecursive(file, attr);\r
                        }\r
                }\r
                \r
                /// <summary>\r
                        foreach (string file in Directory.GetDirectories(path)) {\r
                                SetAttributeRecursive(file, attr);\r
                        }\r
                }\r
                \r
                /// <summary>\r
-               /// ファイルまたはフォルダの容量を算出して返す\r
+               /// 再帰的にファイルのアクセス権限(ユーザ権限など)を設定します\r
+               /// </summary>\r
+               /// <param name="path">設定するフォルダー</param>\r
+               /// <param name="filesec">変更先権限</param>\r
+               public static void SetAccessControlRecursive(string path, FileSecurity filesec)\r
+               {\r
+                       // 自分自身の権限を変更\r
+                       File.SetAccessControl(path, filesec);\r
+                       \r
+                       // 子ファイルの権限を変更\r
+                       foreach (string file in Directory.GetFiles(path)) {\r
+                               File.SetAccessControl(file, filesec);\r
+                       }\r
+                       \r
+                       // 子フォルダーを再帰的に権限変更\r
+                       foreach (string file in Directory.GetDirectories(path)) {\r
+                               SetAccessControlRecursive(file, filesec);\r
+                       }\r
+               }\r
+               \r
+               /// <summary>\r
+               /// ファイルまたはフォルダーの容量を算出して返す\r
                /// </summary>\r
                /// <param name="path">\r
                /// </summary>\r
                /// <param name="path">\r
-               /// 対象ファイル及びフォルダのパス\r
+               /// å¯¾è±¡ã\83\95ã\82¡ã\82¤ã\83«å\8f\8aã\81³ã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\81®ã\83\91ã\82¹\r
                /// </param>\r
                /// <returns>\r
                /// 計算された容量(バイト単位)\r
                /// </param>\r
                /// <returns>\r
                /// 計算された容量(バイト単位)\r
@@ -209,10 +247,10 @@ namespace NaGet
                }\r
                \r
                /// <summary>\r
                }\r
                \r
                /// <summary>\r
-               /// フォルダの容量を算出して返す\r
+               /// ã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\81®å®¹é\87\8fã\82\92ç®\97å\87ºã\81\97ã\81¦è¿\94ã\81\99\r
                /// </summary>\r
                /// <param name="dirInfo">\r
                /// </summary>\r
                /// <param name="dirInfo">\r
-               /// 対象フォルダ\r
+               /// 対象フォルダ\r
                /// </param>\r
                /// <returns>\r
                /// 計算された容量(バイト単位)\r
                /// </param>\r
                /// <returns>\r
                /// 計算された容量(バイト単位)\r
@@ -240,7 +278,7 @@ namespace NaGet
                        }\r
 \r
                        string[] pathArray = pattern.Split(Path.DirectorySeparatorChar);\r
                        }\r
 \r
                        string[] pathArray = pattern.Split(Path.DirectorySeparatorChar);\r
-                       System.Collections.Generic.List<string> extended = new System.Collections.Generic.List<string>();\r
+                       List<string> extended = new List<string>();\r
                        try {\r
                                if (pathArray.Length == 1) {\r
                                        extended.AddRange(Directory.GetFiles(baseDir, pathArray[0], SearchOption.TopDirectoryOnly));\r
                        try {\r
                                if (pathArray.Length == 1) {\r
                                        extended.AddRange(Directory.GetFiles(baseDir, pathArray[0], SearchOption.TopDirectoryOnly));\r
@@ -270,45 +308,42 @@ namespace NaGet
                /// パスをパス区切り文字列ごとに分割した配列を返す\r
                /// </summary>\r
                /// <param name="path">パス文字列。相対・絶対は区別しない</param>\r
                /// パスをパス区切り文字列ごとに分割した配列を返す\r
                /// </summary>\r
                /// <param name="path">パス文字列。相対・絶対は区別しない</param>\r
-               /// <returns>フォルダ名ごとに分けられた文字列配列</returns>\r
+               /// <returns>フォルダ名ごとに分けられた文字列配列</returns>\r
                private static string[] splitPath(string path)\r
                {\r
                        return path.Split(new char[]{Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar});\r
                }\r
                \r
                /// <summary>\r
                private static string[] splitPath(string path)\r
                {\r
                        return path.Split(new char[]{Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar});\r
                }\r
                \r
                /// <summary>\r
-               /// Converts a given absolute path and a given base path to a path that leads\r
-               /// from the base path to the absoulte path. (as a relative path)\r
+               /// パスがフォルダーのとき、最後がパスセパレータで終了するようにする。\r
+               /// </summary>\r
+               /// <param name="path">パス</param>\r
+               /// <returns>処理されたパス</returns>\r
+               private static string fixLastPathCharForDirectory(string path)\r
+               {\r
+                       string fixedPath = path;\r
+                       if (Directory.Exists(path) && path[path.Length-1] != Path.DirectorySeparatorChar) {\r
+                               fixedPath += Path.DirectorySeparatorChar;\r
+                       }\r
+                       return fixedPath;\r
+               }\r
+               \r
+               /// <summary>\r
+               /// 絶対パスを相対パスに変換して返します。\r
                /// </summary>\r
                /// </summary>\r
+               /// <param name="baseDirectoryPath">相対パスの基準のフォルダー</param>\r
+               /// <param name="absPath">絶対パス</param>\r
+               /// <returns><code>absPath</code>の絶対パス表現</returns>\r
                public static string GetRelativePath(string baseDirectoryPath, string absPath)\r
                {\r
                public static string GetRelativePath(string baseDirectoryPath, string absPath)\r
                {\r
-                       // TODO SharpDevelopのICSharpCode.Core.FileUtilityからのコピペ(GPL)\r
+                       Uri baseuri     = new Uri(fixLastPathCharForDirectory(baseDirectoryPath));\r
+                       Uri absuri      = new Uri(fixLastPathCharForDirectory(absPath));\r
                        \r
                        \r
-                       string[] bPath = splitPath(baseDirectoryPath);\r
-                       string[] aPath = splitPath(absPath);\r
-                       int indx = 0;\r
-                       for(; indx < Math.Min(bPath.Length, aPath.Length); ++indx){\r
-                               if(!bPath[indx].Equals(aPath[indx], StringComparison.OrdinalIgnoreCase))\r
-                                       break;\r
-                       }\r
-\r
-                       if (indx == 0) {\r
-                               return absPath;\r
-                       }\r
-\r
-                       StringBuilder erg = new StringBuilder();\r
-\r
-                       if(indx == bPath.Length) {\r
-//                             erg.Append('.');\r
-//                             erg.Append(Path.DirectorySeparatorChar);\r
-                       } else {\r
-                               for (int i = indx; i < bPath.Length; ++i) {\r
-                                       erg.Append("..");\r
-                                       erg.Append(Path.DirectorySeparatorChar);\r
-                               }\r
-                       }\r
-                       erg.Append(String.Join(Path.DirectorySeparatorChar.ToString(), aPath, indx, aPath.Length-indx));\r
-                       return erg.ToString();\r
+                       string relative = baseuri.MakeRelativeUri(absuri).ToString();\r
+                       relative = System.Web.HttpUtility.UrlDecode(relative);\r
+                       relative = relative.Replace('/', Path.DirectorySeparatorChar);\r
+                       \r
+                       return relative;\r
                }\r
                \r
                /// <summary>\r
                }\r
                \r
                /// <summary>\r
@@ -319,13 +354,13 @@ namespace NaGet
                public static string GetDotsRemovedPath(string aPath)\r
                {\r
                        string[] folders = splitPath(aPath);\r
                public static string GetDotsRemovedPath(string aPath)\r
                {\r
                        string[] folders = splitPath(aPath);\r
-                       System.Collections.Generic.List<string> newFolders = new System.Collections.Generic.List<string>();\r
+                       List<string> newFolders = new List<string>();\r
                        \r
                        foreach (string fol in folders) {\r
                                if (fol == ".") {\r
                                        // 無視\r
                                } else if (fol == "..") {\r
                        \r
                        foreach (string fol in folders) {\r
                                if (fol == ".") {\r
                                        // 無視\r
                                } else if (fol == "..") {\r
-                                       // 一つ前のフォルダを消す\r
+                                       // ä¸\80ã\81¤å\89\8dã\81®ã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\82\92æ¶\88ã\81\99\r
                                        newFolders.RemoveAt(newFolders.Count-1);\r
                                } else {\r
                                        newFolders.Add(fol);\r
                                        newFolders.RemoveAt(newFolders.Count-1);\r
                                } else {\r
                                        newFolders.Add(fol);\r
@@ -337,18 +372,42 @@ namespace NaGet
                \r
                #endregion\r
                \r
                \r
                #endregion\r
                \r
-               #region XmlSerializer便利メソッド群\r
+               #region シリアル化関連\r
                \r
                \r
-               public static T GetDeserializedObject<T>(string path)\r
+               \r
+               /// <summary>\r
+               /// XMLでシリアル化したオブジェクトのXMLファイルを読み込み、デシリアル化したオブジェクトを取得する\r
+               /// </summary>\r
+               /// <param name="path">XMLファイルのパス</param>\r
+               /// <param name="sr">シリアライザ</param>\r
+               /// <returns>デシリアル化されたオブジェクト</returns>\r
+               public static object GetDeserializedObject(string path, System.Xml.Serialization.XmlSerializer sr)\r
                {\r
                {\r
-                       T retVal = default(T);\r
+                       object retVal = null;\r
                        using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) {\r
                        using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) {\r
-                               System.Xml.Serialization.XmlSerializer sr = new System.Xml.Serialization.XmlSerializer(typeof(T));\r
-                               retVal = (T) sr.Deserialize(fs);\r
+                               retVal = sr.Deserialize(fs);\r
                        }\r
                        return retVal;\r
                }\r
                \r
                        }\r
                        return retVal;\r
                }\r
                \r
+               /// <summary>\r
+               /// XMLでシリアル化したオブジェクトのXMLファイルを読み込み、デシリアル化したオブジェクトを取得する\r
+               /// </summary>\r
+               /// <param name="path">XMLファイルのパス</param>\r
+               /// <returns>デシリアル化されたオブジェクト</returns>\r
+               public static T GetDeserializedObject<T>(string path)\r
+               {\r
+                       T retVal = default(T);\r
+                       System.Xml.Serialization.XmlSerializer sr = new System.Xml.Serialization.XmlSerializer(typeof(T));\r
+                       retVal = (T) GetDeserializedObject(path, sr);\r
+                       return retVal;\r
+               }\r
+               \r
+               /// <summary>\r
+               /// オブジェクトをXMLでシリアル化してファイルに書き込む\r
+               /// </summary>\r
+               /// <param name="path">XMLファイルのパス</param>\r
+               /// <param name="obj">シリアル化する対象のオブジェクト</param>\r
                public static void PutSerializeObject<T>(string path, T obj)\r
                {\r
                        using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write)) {\r
                public static void PutSerializeObject<T>(string path, T obj)\r
                {\r
                        using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write)) {\r
@@ -362,12 +421,11 @@ namespace NaGet
                #region 権限関連関数群\r
                \r
                /// <summary>\r
                #region 権限関連関数群\r
                \r
                /// <summary>\r
-               /// 現在のユーザがAdministrators権限を持っているか否かを返す\r
+               /// 現在のユーザがAdministrators権限を持っているか否かを返す\r
                /// </summary>\r
                /// </summary>\r
+               /// <remarks>UAC有効時には権限昇格後になってtrueを返すようになります</remarks>\r
                public static bool IsAdministrators()\r
                {\r
                public static bool IsAdministrators()\r
                {\r
-                       // TODO UAC はどうするんだ!!!!\r
-                       \r
                        // 現在の Windows ユーザーを現在のスレッドのプリンシパルに反映する\r
                        AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal );\r
                        IPrincipal prin = System.Threading.Thread.CurrentPrincipal;\r
                        // 現在の Windows ユーザーを現在のスレッドのプリンシパルに反映する\r
                        AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal );\r
                        IPrincipal prin = System.Threading.Thread.CurrentPrincipal;\r
@@ -454,6 +512,7 @@ namespace NaGet
                \r
                #endregion\r
 \r
                \r
                #endregion\r
 \r
+               #region イベント情報\r
                \r
                /// <summary>\r
                /// 任意データのイベント情報を表現するクラス\r
                \r
                /// <summary>\r
                /// 任意データのイベント情報を表現するクラス\r
@@ -477,5 +536,7 @@ namespace NaGet
                                get { return data; }\r
                        }\r
                }\r
                                get { return data; }\r
                        }\r
                }\r
+\r
+               #endregion\r
        }\r
 }\r
        }\r
 }\r