예제 #1
0
        /// <summary>
        /// Invoked when the user edits the value of a property
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event data</param>
        /// <remarks>Will save the text to the temporary structure</remarks>
        private void EditableTextBlock_Edited(object sender, EditableTextBlockEventArgs e)
        {
            EditableTextBlock etb  = sender as EditableTextBlock;
            string            prop = etb.Tag as string;
            PropertyData      p    = null;

            foreach (PropertyData pd in properties)
            {
                if (pd.Name == prop)
                {
                    p = pd;
                    break;
                }
            }

            if (p != null)
            {
                p.Value = e.NewText;
                bool   multi  = p.Value == U.T("PropertiesDetailsMultipleValues");
                object curObj = GetTag(tempTrack, p.Name);
                string cur    = curObj as string;
                p.Edited =
                    curObj == null ||
                    (p.Value != curObj.ToString() &&
                     !(p.Name == "Track" && tempTrack.Track == 881102 && multi) &&
                     !(p.Name == "Year" && tempTrack.Year == 881102 && multi));
            }

            ToggleButtons();
        }
예제 #2
0
 /// <summary>
 /// Invoked when the "New playlist" item has been edited.
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 private void CreateNewPlaylist_Edited(object sender, EditableTextBlockEventArgs e)
 {
     if (e.NewText != U.T("NavigationCreateNew") && e.NewText != "")
     {
         List <object> addQueue = AddToPlaylistQueue;
         PlaylistManager.CreatePlaylist(e.NewText, addQueue.Count == 0);
         if (addQueue.Count > 0)
         {
             PlaylistManager.AddToPlaylist(addQueue, e.NewText);
             addQueue.Clear();
         }
     }
     else
     {
         CreateNewPlaylist_Canceled(sender, e);
     }
 }
예제 #3
0
파일: Details.xaml.cs 프로젝트: uQr/stoffi
 /// <summary>
 /// Invoked when a field has been edited
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 private void Field_Edited(object sender, EditableTextBlockEventArgs e)
 {
     EditableTextBlock etb = sender as EditableTextBlock;
     OnFieldEdited(etb.Tag as string, e.NewText);
 }
예제 #4
0
        /// <summary>
        /// Invoked when the user edits the value of a property
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event data</param>
        /// <remarks>Will save the text to the temporary structure</remarks>
        private void EditableTextBlock_Edited(object sender, EditableTextBlockEventArgs e)
        {
            EditableTextBlock etb = sender as EditableTextBlock;
            string prop = etb.Tag as string;
            PropertyData p = null;
            foreach (PropertyData pd in properties)
            {
                if (pd.Name == prop)
                {
                    p = pd;
                    break;
                }
            }

            if (p != null)
            {
                p.Value = e.NewText;
                bool multi = p.Value == U.T("PropertiesDetailsMultipleValues");
                object curObj = GetTag(tempTrack, p.Name);
                string cur = curObj as string;
                p.Edited =
                    curObj == null ||
                    (p.Value != curObj.ToString() &&
                    !(p.Name == "Track" && tempTrack.Track == 881102 && multi) &&
                    !(p.Name == "Year" && tempTrack.Year == 881102 && multi));
            }

            ToggleButtons();
        }
예제 #5
0
        /// <summary>
        /// Invoked when a field has been edited
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event data</param>
        private void Field_Edited(object sender, EditableTextBlockEventArgs e)
        {
            EditableTextBlock etb = sender as EditableTextBlock;

            OnFieldEdited(etb.Tag as string, e.NewText);
        }
예제 #6
0
 /// <summary>
 /// Invoked when a playlist's name has been edited.
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 public void Playlist_Edited(object sender, EditableTextBlockEventArgs e)
 {
     PlaylistManager.RenamePlaylist(e.OldText, e.NewText);
     SelectPlaylist(e.NewText);
 }
예제 #7
0
 /// <summary>
 /// Invoked when the "New playlist" item has been edited.
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 private void CreateNewPlaylist_Edited(object sender, EditableTextBlockEventArgs e)
 {
     if (e.NewText != U.T("NavigationCreateNew") && e.NewText != "")
     {
         List<object> addQueue = AddToPlaylistQueue;
         PlaylistManager.CreatePlaylist(e.NewText, addQueue.Count == 0);
         if (addQueue.Count > 0)
         {
             PlaylistManager.AddToPlaylist(addQueue, e.NewText);
             addQueue.Clear();
         }
     }
     else
         CreateNewPlaylist_Canceled(sender, e);
 }
예제 #8
0
 /// <summary>
 /// Invoked when a playlist's name has been edited.
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 public void Playlist_Edited(object sender, EditableTextBlockEventArgs e)
 {
     PlaylistManager.RenamePlaylist(e.OldText, e.NewText);
     SelectPlaylist(e.NewText);
 }
예제 #9
0
파일: Services.xaml.cs 프로젝트: uQr/stoffi
 /// <summary>
 /// Invoked when the user changes the device name.
 /// Will send the new name to the server.
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 private void DeviceName_Edited(object sender, EditableTextBlockEventArgs e)
 {
     ServiceManager.DeviceName = e.NewText;
 }