Show
Ignore:
Timestamp:
09/13/07 02:09:29 (3 years ago)
Author:
tomoyo
Message:

Added Dateに対応した。

Location:
iTunesPlayCountImporter/iTunesPlayCountImporter
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • iTunesPlayCountImporter/iTunesPlayCountImporter/MainForm.Designer.cs

    r312 r313  
    4141            //  
    4242            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 
    43             this.button1.Location = new System.Drawing.Point(354, 40); 
     43            this.button1.Location = new System.Drawing.Point(410, 40); 
    4444            this.button1.Name = "button1"; 
    4545            this.button1.Size = new System.Drawing.Size(93, 23); 
     
    6060            this.labelStatus.Location = new System.Drawing.Point(4, 77); 
    6161            this.labelStatus.Name = "labelStatus"; 
    62             this.labelStatus.Size = new System.Drawing.Size(437, 17); 
     62            this.labelStatus.Size = new System.Drawing.Size(493, 17); 
    6363            this.labelStatus.TabIndex = 1; 
    6464            //  
     
    6969            this.progressBar1.Location = new System.Drawing.Point(6, 11); 
    7070            this.progressBar1.Name = "progressBar1"; 
    71             this.progressBar1.Size = new System.Drawing.Size(441, 23); 
     71            this.progressBar1.Size = new System.Drawing.Size(497, 23); 
    7272            this.progressBar1.TabIndex = 2; 
    7373            //  
     
    104104            this.textBoxResults.Name = "textBoxResults"; 
    105105            this.textBoxResults.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 
    106             this.textBoxResults.Size = new System.Drawing.Size(441, 64); 
     106            this.textBoxResults.Size = new System.Drawing.Size(497, 64); 
    107107            this.textBoxResults.TabIndex = 5; 
    108108            //  
     
    111111            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 
    112112            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 
    113             this.ClientSize = new System.Drawing.Size(453, 184); 
     113            this.ClientSize = new System.Drawing.Size(509, 184); 
    114114            this.Controls.Add(this.textBoxResults); 
    115115            this.Controls.Add(this.radioButtonAdd); 
     
    119119            this.Controls.Add(this.button1); 
    120120            this.MaximizeBox = false; 
    121             this.MinimumSize = new System.Drawing.Size(459, 211); 
     121            this.MinimumSize = new System.Drawing.Size(525, 211); 
    122122            this.Name = "MainForm"; 
    123123            this.Text = "iTunes Play Count Importer"; 
  • iTunesPlayCountImporter/iTunesPlayCountImporter/MainForm.cs

    r312 r313  
    1818        { 
    1919            InitializeComponent(); 
     20        } 
     21 
     22        private T? GetValue<T>(Hashtable hashtable, String key) where T : struct 
     23        { 
     24            T? retValue = (hashtable.ContainsKey(key) ? 
     25                new T?((T)hashtable[key]) : 
     26                null 
     27            ); 
     28 
     29            return retValue; 
    2030        } 
    2131 
     
    6474                        if (!String.IsNullOrEmpty(location) && tracksByLocation.ContainsKey(location)) 
    6575                        { 
     76                            DateTime? playedDate = GetValue<DateTime>(tracksByLocation[track2.Location], "Play Date UTC"); 
    6677                            Int32 playedCount = (tracksByLocation[track2.Location].ContainsKey("Play Count") ? (Int32)(Int64)tracksByLocation[track2.Location]["Play Count"] : 0); 
    6778 
     
    7788                                track2.PlayedCount += playedCount; 
    7889                            } 
     90 
     91                            // PlayedDate 
     92                            if (playedDate != null && track2.PlayedDate < playedDate.Value) 
     93                            { 
     94                                track2.PlayedDate = playedDate.Value; 
     95                            } 
     96 
    7997                            updateCount++; 
    8098                            labelStatus.Text = String.Format("�g���b�N {0} ��V���܂����B", track2.Name); 
  • iTunesPlayCountImporter/iTunesPlayCountImporter/PropertyList.cs

    r312 r313  
    8787                    value = false; 
    8888                    break; 
     89                case "date": 
     90                    DateTime dateTime; 
     91                    if (!DateTime.TryParse(node.InnerText, out dateTime)) 
     92                    { 
     93                        // throw new ApplicationException("date�v�f�ɂ͓��݂̂�ނ��Ƃ��ł��܂��B"); 
     94                        dateTime = new DateTime(); 
     95                    } 
     96                    value = dateTime; 
     97                    break; 
    8998                default: 
    9099                                        value = node;