From: ttp Date: Mon, 28 Jul 2008 11:16:13 +0000 (+0000) Subject: AppliStation,バージョンを1.1.0.*に変更。ソースファイルへのコメントの加筆 X-Git-Tag: v1.1.0~44 X-Git-Url: http://git.sourceforge.jp/view?p=applistation%2FAppliStation.git;a=commitdiff_plain;h=d0f67394434587c7c3152f149be0675cb0a506ec;ds=sidebyside AppliStation,バージョンを1.1.0.*に変更。ソースファイルへのコメントの加筆 git-svn-id: http://localhost/svn/AppliStation/trunk@942 34ed2c89-c49f-4a4b-abdb-c318350108cf --- diff --git a/AppliStation/AppliStation.Util/GUIUtils.cs b/AppliStation/AppliStation.Util/GUIUtils.cs index 7e235d6..ce69965 100644 --- a/AppliStation/AppliStation.Util/GUIUtils.cs +++ b/AppliStation/AppliStation.Util/GUIUtils.cs @@ -57,11 +57,11 @@ namespace AppliStation.Util const float b = 0.114478f; ColorMatrix cm = new ColorMatrix(new float[][]{ - new float[]{r, r, r, 0, 0}, - new float[]{g, g, g, 0, 0}, - new float[]{b, b, b, 0, 0}, + new float[]{r, r, r, 0, 0}, + new float[]{g, g, g, 0, 0}, + new float[]{b, b, b, 0, 0}, new float[]{0, 0, 0, alpha, 0}, - new float[]{0, 0, 0, 0, 1}, + new float[]{0, 0, 0, 0, 1}, }); ImageAttributes ia = new ImageAttributes(); ia.SetColorMatrix(cm); @@ -69,6 +69,13 @@ namespace AppliStation.Util return ia; } + /// + /// 画像を指定領域の真中に描く + /// + /// 描画対象のグラフィックス + /// 画像 + /// 指定領域 + /// ImageAttributes。nullでもかまわない public static void Graphics_DrawCenterImage(Graphics g, Image img, Rectangle b, ImageAttributes ia) { int x = b.Left + (b.Width - img.Width ) / 2; diff --git a/AppliStation/AppliStation.Util/ListViewItemSortComparer.cs b/AppliStation/AppliStation.Util/ListViewItemSortComparer.cs index 11a5f61..dec8b05 100644 --- a/AppliStation/AppliStation.Util/ListViewItemSortComparer.cs +++ b/AppliStation/AppliStation.Util/ListViewItemSortComparer.cs @@ -8,12 +8,26 @@ using System.Collections.Generic; namespace AppliStation.Util { + /// + /// ListView‚̃\[ƒg‚ðƒJƒvƒZƒ‹‰»‚·‚邽‚߂̃Nƒ‰ƒX + /// class ListViewItemSortComparer : System.Collections.IComparer { + /// + /// ƒ\[ƒg‚Ì•ûŒüB¸‡‚©?~‡‚©? + /// public SortOrder Order = SortOrder.Ascending; + /// + /// ƒ\[ƒg‘Ώۂ̃Rƒ‰ƒ€ƒCƒ“ƒfƒbƒNƒX + /// public int Column = -1; + /// + /// ƒRƒ“ƒXƒgƒ‰ƒNƒ^ + /// + /// ƒ\[ƒg‘Ώۂ̃Rƒ‰ƒ€ƒCƒ“ƒfƒbƒNƒX + /// ƒ\[ƒg‚Ì•ûŒüB¸‡‚©?~‡‚©? public ListViewItemSortComparer(int index, SortOrder order) { this.Column = index; diff --git a/AppliStation/AppliStation.Util/NativeMethods.cs b/AppliStation/AppliStation.Util/NativeMethods.cs index 8f091db..5cdd40a 100644 --- a/AppliStation/AppliStation.Util/NativeMethods.cs +++ b/AppliStation/AppliStation.Util/NativeMethods.cs @@ -1,21 +1,27 @@ -using System; +using System; using System.Runtime.InteropServices; using System.Windows.Forms; namespace AppliStation.Util { + /// + /// Win32ネイティブメソッドを叩いてGUI操作するための関数群のクラス + /// public sealed class NativeMethods { + /// + /// 呼び出し禁止 + /// private NativeMethods() { } /// - /// WindowsVistaŒü‚¯AƒvƒƒOƒŒƒXƒo[ƒXƒe[ƒ^ƒX(F)‚ðÝ’è‚·‚é + /// WindowsVista向け、プログレスバーステータス(色)を設定する /// - /// ‘Ώۂ̃vƒƒOƒŒƒXƒo[ - /// ó‘ԁB(1:Normal,2:Error,3:Paused) + /// 対象のプログレスバー + /// 状態。(1:Normal,2:Error,3:Paused) public static void ProgressBar_SetState(ProgressBar progBar, uint state) { try { @@ -26,34 +32,34 @@ namespace AppliStation.Util } } - #region ƒ^ƒXƒNƒo[‚¨‚æ‚у^ƒCƒgƒ‹ƒo[‚̃tƒ‰ƒbƒVƒ… + #region タスクバーおよびタイトルバーのフラッシュ /// - /// ƒ^ƒXƒNƒo[‚¨‚æ‚у^ƒCƒgƒ‹ƒo[ƒ{ƒ^ƒ“‚̃tƒ‰ƒbƒVƒ…‚̐ݒèƒtƒ‰ƒO + /// タスクバーおよびタイトルバーボタンのフラッシュの設定フラグ /// public enum FlashFlag : uint { /// - /// “_–Å‚Ì’âŽ~ + /// 点滅の停止 /// Stop = 0, /// - /// ƒ^ƒCƒgƒ‹ƒo[‚ð“_–Å + /// タイトルバーを点滅 /// Caption = 1, /// - /// ƒ^ƒXƒNƒo[ƒ{ƒ^ƒ“‚ð“_–Å + /// タスクバーボタンを点滅 /// Tray = 2, /// - /// ƒ^ƒCƒgƒ‹ƒo[‚ƃ^ƒXƒNƒo[ƒ{ƒ^ƒ“‚ð“_–Å + /// タイトルバーとタスクバーボタンを点滅 /// All = 3, /// - /// Stop‚ªÝ’肳‚ê‚é‚Ü‚Å“_–Å‚·‚é + /// Stopが設定されるまで点滅する /// Timer = 4, /// - /// ƒtƒHƒAƒOƒ‰ƒEƒ“ƒh‚̏ó‘Ô‚É‚È‚é‚Ü‚Å“_–Å + /// フォアグラウンドの状態になるまで点滅 /// TimerNoFG = 12, } @@ -69,12 +75,12 @@ namespace AppliStation.Util } /// - /// ƒ^ƒXƒNƒo[‚¨‚æ‚у^ƒCƒgƒ‹ƒo[ƒ{ƒ^ƒ“‚ð“_–Å‚³‚¹‚é + /// タスクバーおよびタイトルバーボタンを点滅させる /// - /// ‘ΏۃtƒH[ƒ€ - /// “_–Ńpƒ‰ƒ[ƒ^ƒtƒ‰ƒO - /// “_–ʼnñ” - /// “_–Å‚ÌŠÔŠu(ƒ~ƒŠ•b) + /// 対象フォーム + /// 点滅パラメータフラグ + /// 点滅回数 + /// 点滅の間隔(ミリ秒) /// public static bool Form_FlashWindow(Form form, FlashFlag flag, uint count, uint timeout) { @@ -97,7 +103,7 @@ namespace AppliStation.Util #endregion - #region ColumnHeader‚̃\[ƒg‚ÌŽOŠpˆó—p + #region ColumnHeaderのソートの三角印用 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)] internal struct HD_ITEM @@ -120,11 +126,11 @@ namespace AppliStation.Util } /// - /// WinXPˆÈ~Aƒ\[ƒg‚Ì–îˆó‚ð•\Ž¦ + /// WinXP以降、ソートの矢印を表示 /// - /// ‘ΏۂÌListView - /// •\Ž¦‚·‚é–îˆó‚̃wƒbƒ_ - /// ƒ\[ƒg‚̏¸‡E~‡ + /// 対象のListView + /// 表示する矢印のヘッダ + /// ソートの昇順・降順 public static void ColumnHeader_SetSortState(ListView listView, int column, SortOrder order) { try { @@ -142,9 +148,9 @@ namespace AppliStation.Util if (i != column || order == SortOrder.None) { hdi.fmt = hdi.fmt & ~(HDF_SORTUP | HDF_SORTDOWN); - } else if (order == SortOrder.Ascending) { // ¸‡ + } else if (order == SortOrder.Ascending) { // 昇順 hdi.fmt = hdi.fmt & ~HDF_SORTDOWN | HDF_SORTUP; - } else if (order == SortOrder.Descending) { // ~‡ + } else if (order == SortOrder.Descending) { // 降順 hdi.fmt = hdi.fmt & ~HDF_SORTUP | HDF_SORTDOWN; } @@ -157,14 +163,14 @@ namespace AppliStation.Util #endregion - #region EnableWindow(ƒRƒƒ“ƒgƒAƒEƒg) + #region EnableWindow(コメントアウト) // /// -// /// Žw’肳‚ꂽƒRƒ“ƒgƒ[ƒ‹(ƒEƒBƒ“ƒhƒE)‚ւ́A -// /// ƒL[ƒ{[ƒh“ü—Í‚¨‚æ‚у}ƒEƒX“ü—Í‚ð—LŒø‰»‚Ü‚½‚Í–³Œø‰» +// /// 指定されたコントロール(ウィンドウ)への、 +// /// キーボード入力およびマウス入力を有効化または無効化 // /// -// /// ‘Ώۂ̃Rƒ“ƒgƒ[ƒ‹‚̃nƒ“ƒhƒ‰ -// /// —LŒø‚É‚·‚é‚©–³Œø‚É‚·‚é‚©‚ðŽw’è -// /// ’¼‘O‚ɃEƒBƒ“ƒhƒE‚ª–³Œøó‘Ô‚¾‚Á‚½ê‡‚Ítrue‚ð•Ô‚· +// /// 対象のコントロールのハンドラ +// /// 有効にするか無効にするかを指定 +// /// 直前にウィンドウが無効状態だった場合はtrueを返す // public static bool Control_EnableWindow(Control ctrl, bool bEnable) // { // try { @@ -176,16 +182,16 @@ namespace AppliStation.Util // } // // /// -// /// Žw’肳‚ꂽƒRƒ“ƒgƒ[ƒ‹(ƒEƒBƒ“ƒhƒE)‚ւ́A -// /// ƒL[ƒ{[ƒh“ü—Í‚¨‚æ‚у}ƒEƒX“ü—Í‚ð—LŒø‰»‚Ü‚½‚Í–³Œø‰» +// /// 指定されたコントロール(ウィンドウ)への、 +// /// キーボード入力およびマウス入力を有効化または無効化 // /// -// /// ‘Ώۂ̃Rƒ“ƒgƒ[ƒ‹‚̃nƒ“ƒhƒ‰ -// /// —LŒø‚É‚·‚é‚©–³Œø‚É‚·‚é‚©‚ðŽw’è -// /// ’¼‘O‚ɃEƒBƒ“ƒhƒE‚ª–³Œøó‘Ô‚¾‚Á‚½ê‡‚Ítrue‚ð•Ô‚· +// /// 対象のコントロールのハンドラ +// /// 有効にするか無効にするかを指定 +// /// 直前にウィンドウが無効状態だった場合はtrueを返す // [DllImport("user32.dll")] // public static extern bool EnableWindow(IntPtr hWnd, bool bEnable); #endregion - + [DllImport("user32.dll", CharSet=CharSet.Auto)] internal static extern IntPtr SendMessage( IntPtr hWnd, UInt32 Msg, UInt32 wParam, UInt32 lParam); diff --git a/AppliStation/AssemblyInfo.cs b/AppliStation/AssemblyInfo.cs index 187f47a..5cb4bc1 100644 --- a/AppliStation/AssemblyInfo.cs +++ b/AppliStation/AssemblyInfo.cs @@ -28,4 +28,4 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.1.*")] +[assembly: AssemblyVersion("1.1.0.*")] diff --git a/na-get-lib/AssemblyInfo.cs b/na-get-lib/AssemblyInfo.cs index b6d44a1..67d8eb8 100644 --- a/na-get-lib/AssemblyInfo.cs +++ b/na-get-lib/AssemblyInfo.cs @@ -8,10 +8,10 @@ using System.Runtime.CompilerServices; // you compile. [assembly: AssemblyTitle("NaGet Library")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("AppliStation Core Library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Team AppliStation")] -[assembly: AssemblyProduct("")] +[assembly: AssemblyProduct("AppliStation")] [assembly: AssemblyCopyright("Copyright (c) 2007-2008 Team AppliStation")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("1.0.1.*")] +[assembly: AssemblyVersion("1.1.0.*")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/na-get-lib/NaGet.InteropServices/CreateProcessCaller.cs b/na-get-lib/NaGet.InteropServices/CreateProcessCaller.cs index cfb1d5c..2e79d5e 100644 --- a/na-get-lib/NaGet.InteropServices/CreateProcessCaller.cs +++ b/na-get-lib/NaGet.InteropServices/CreateProcessCaller.cs @@ -4,6 +4,15 @@ using System.Runtime.InteropServices; namespace NaGet.InteropServices { + /// + /// Win32 API ‚ÌCreateProcess‚𒼂ɒ@‚­‚½‚߂̃Nƒ‰ƒXB + /// + /// + /// .NET‚ÌProcess.Start‚́ACreateProcess(NULL, cmdLine, ...) + /// ‚̂悤‚É‘æˆêˆø”‚ªNULL‚É‘Š“–‚·‚éŒÄ‚яo‚µ‚ªA + /// *Œµ–§‚ȈӖ¡*‚Å‚Å‚«‚È‚¢BŒµ–§‚ȈӖ¡‚ŁA + /// ‚±‚ê‚Æ“¯‚¶ŒÄ‚яo‚µ‚ðŽÀŒ»‚·‚é•K—v‚ª‚ ‚é‚Æ‚«‚ÉŽg‚í‚ê‚éB + /// public class CreateProcessCaller : IDisposable { #region Win32API @@ -78,6 +87,11 @@ namespace NaGet.InteropServices STARTUPINFO si; PROCESS_INFORMATION pi; + /// + /// ƒvƒƒZƒX‚𐶐¬‚·‚é + /// + /// ƒvƒƒZƒX‹N“®î•ñB + /// ‚È‚¨AprocInfo.UseShellExecute‚Í•K‚¸false‚Å‚È‚¯‚ê‚΂Ȃç‚È‚¢ public CreateProcessCaller(ProcessStartInfo procInfo) { if (procInfo.UseShellExecute) { @@ -101,17 +115,29 @@ namespace NaGet.InteropServices CloseHandle(pi.hThread); } + /// + /// ŠÖ˜A•t‚¯‚ç‚ꂽƒvƒƒZƒX‚ªI—¹‚·‚é‚܂ŁAÅ‘åŽw’肵‚½ƒ~ƒŠ•bŠÔ‘Ò‹@B + /// + /// Å‘å‘Ò‹@ŽžŠÔ(ƒ~ƒŠ•b’PˆÊ) + /// I—¹ƒR[ƒh public uint WaitForExit(uint timeout) { return WaitForSingleObject(pi.hProcess, timeout); } + /// + /// ŠÖ˜A•t‚¯‚ç‚ꂽƒvƒƒZƒX‚ªI—¹‚·‚é‚Ü‚Å–³ŠúŒÀ‚É‘Ò‹@B + /// + /// I—¹ƒR[ƒh public uint WaitForExit() { // return WaitForExit(INFINITE) return WaitForExit(0xFFFFFFFF); } + /// + /// I—¹ƒR[ƒh + /// public int ExitCode { get { int lpExitCode; @@ -122,6 +148,9 @@ namespace NaGet.InteropServices } } + /// + /// ƒvƒƒZƒX‚̃nƒ“ƒhƒ‹‚ðŠJ•ú‚·‚é + /// public void Dispose() { CloseHandle(pi.hProcess); diff --git a/na-get-lib/NaGet.Packages/HashValue.cs b/na-get-lib/NaGet.Packages/HashValue.cs index 20651d6..498d274 100644 --- a/na-get-lib/NaGet.Packages/HashValue.cs +++ b/na-get-lib/NaGet.Packages/HashValue.cs @@ -10,6 +10,9 @@ namespace NaGet.Packages /// public enum HashValueType { + /// + /// ファイルのサイズ(容量)をバイト単位で返す + /// [XmlEnum(Name="size")] SIZE, [XmlEnum(Name="md5")] @@ -17,7 +20,7 @@ namespace NaGet.Packages [XmlEnum(Name="sha1")] SHA1SUM, [XmlEnum(Name="sha256")] - SHA256SUM + SHA256SUM, } public class HashValue @@ -69,7 +72,7 @@ namespace NaGet.Packages /// /// ストリーム入力 /// ハッシュの種類(計算法) - /// + /// ハッシュ値 public static string HashValueFor(Stream stream, HashValueType type) { byte[] hash; diff --git a/na-get-lib/NaGet.Packages/VersionComparetor.cs b/na-get-lib/NaGet.Packages/VersionComparetor.cs index 60aa78d..6d94fda 100644 --- a/na-get-lib/NaGet.Packages/VersionComparetor.cs +++ b/na-get-lib/NaGet.Packages/VersionComparetor.cs @@ -1,11 +1,32 @@ -using System; +using System; using System.Text.RegularExpressions; namespace NaGet.Packages { - // TODO Debian-apt‚̃R[ƒh‚ð—˜—p‚µ‚Ä‚¢‚é‚Ì‚ÅGPL‚É‚È‚é‚Ì‚É’ˆÓ + // TODO Debian-aptのコードを利用しているのでGPLになるのに注意 + // 引用元: apt-pkg/deb/debversion.cc,v 1.8 2003/09/10 23:39:49 mdz Exp + // Debian Version - Versioning system for Debian + // This implements the standard Debian versioning system. + // Copyright (C) yyyy name of author + // + // This program is free software; you can redistribute it and/or + // modify it under the terms of the GNU General Public License + // as published by the Free Software Foundation; either version 2 + // of the License, or (at your option) any later version. + // + // This program is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU General Public License for more details. + // + // You should have received a copy of the GNU General Public License + // along with this program; if not, write to the Free Software + // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + /// + /// バージョン比較をするためのメソッドを含むクラス + /// public class VersionComparetor : System.Collections.Generic.IComparer { public VersionComparetor() @@ -22,7 +43,7 @@ namespace NaGet.Packages public int Compare(string a, string b) { - // ‘Oˆ— + // 前処理 a = a.ToLower(); b = b.ToLower(); if (Regex.IsMatch(a, @"\.0*$"))