Ejemplo n.º 1
0
        private static Id3Frame DecodeComment(byte[] data)
        {
            var frame = new CommentFrame {
                EncodingType = (Id3TextEncoding)data[0]
            };

            string language = TextEncodingHelper.GetDefaultEncoding().GetString(data, 1, 3).ToLowerInvariant();

            if (!Enum.IsDefined(typeof(Id3Language), language))
            {
                frame.Language = Id3Language.eng;
            }
            else
            {
                frame.Language = (Id3Language)Enum.Parse(typeof(Id3Language), language, true);
            }

            string[] splitStrings = TextEncodingHelper.GetSplitStrings(data, 4, data.Length - 4, frame.EncodingType);
            if (splitStrings.Length > 1)
            {
                frame.Description = splitStrings[0];
                frame.Comment     = splitStrings[1];
            }
            else if (splitStrings.Length == 1)
            {
                frame.Comment = splitStrings[0];
            }

            return(frame);
        }
Ejemplo n.º 2
0
 private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (Config.IsPageSwitched(e.PreviousSize, e.NewSize) && !string.IsNullOrEmpty(ViewModelBase.CurrentStoryId))
     {
         MainContentFrame.Navigate(typeof(MainContentPage));
         CommentFrame.Navigate(typeof(CommentPage));
     }
 }
Ejemplo n.º 3
0
 public HomePage()
 {
     this.InitializeComponent();
     instance = this;
     MyFeedbackListView.ItemsSource = feedbacks;
     CommentFrame.Navigate(typeof(CommentPage), new Feedback());
     commentPage = CommentFrame.Content as CommentPage;
     commentPage.BackButton.Click += BackButton_Click;
 }
Ejemplo n.º 4
0
        private void everyFiveSeconds_Tick(object sender, EventArgs e)
        {
            if (Globals.CommentCount != "0")
            {
                btCommentCount.Visibility = Visibility.Visible;
                btCommentCount.Content    = Globals.CommentCount;
                if (ConfigurationSettings.UserCommentClose == false)
                {
                    commentPanel.MessageCount = Globals.CommentCount;
                    CommentFrame.Refresh();
                }
            }
            else
            {
                btCommentCount.Visibility = Visibility.Collapsed;
                btCommentCount.Content    = "";
                commentPanel.MessageCount = "";
            }


            if (Globals.MentionCount != "0")
            {
                btMentionCount.Content    = Globals.MentionCount;
                btMentionCount.Visibility = Visibility.Visible;
                if (ConfigurationSettings.UserMentionClose == false)
                {
                    mentionPanel.MessageCount = Globals.MentionCount;
                    MentionFrame.Refresh();
                }
            }
            else
            {
                btMentionCount.Content    = "";
                btMentionCount.Visibility = Visibility.Collapsed;
                mentionPanel.MessageCount = "";
            }

            if (Globals.FollowerCount != "0")
            {
                btFollowerCount.Visibility = Visibility.Visible;
                btFollowerCount.Content    = Globals.FollowerCount;
                if (ConfigurationSettings.UserFollowerClose == false)
                {
                    followerPanel.MessageCount = Globals.FollowerCount;
                    UserFollowerFrame.Refresh();
                }
            }
            else
            {
                btFollowerCount.Visibility = Visibility.Collapsed;
                btFollowerCount.Content    = "";
                followerPanel.MessageCount = "";
            }
        }
Ejemplo n.º 5
0
 private void DisplayStory(string storyId)
 {
     ViewModelBase.CurrentStoryId = storyId;
     if (Config.UIStatus == AppUIStatus.All || Config.UIStatus == AppUIStatus.ListAndContent)
     {
         MainContentFrame.Navigate(typeof(MainContentPage), storyId);
         CommentFrame.Navigate(typeof(CommentPage), storyId);
     }
     else
     {
         ((Frame)Window.Current.Content).Navigate(typeof(MainContentPage), storyId);
     }
 }
 public ChannelFeedbackPage()
 {
     this.InitializeComponent();
     FBFormControl.SendBtn.Click       += SendBtn_Click;
     FBFormControl.BackBtn.Click       += BackBtn_Click;
     FBFormControl.AddImageBtn.Click   += AddImageBtn_Click;
     FBFormControl.ShowPanel.Completed += ShowPanel_Completed;
     CommentFrame.Navigate(typeof(CommentPage), new Feedback());
     commentPage = CommentFrame.Content as CommentPage;
     commentPage.BackButton.Click += BackButton_Click;
     SendFeedbackForm.Completed   += SendFeedbackForm_Completed;
     ShowFeedbackForm.Completed   += ShowFeedbackForm_Completed;
     HideFeedbackForm.Completed   += HideFeedbackForm_Completed;
 }
Ejemplo n.º 7
0
        private void DisplayStory(string storyId)
        {
            ViewModelBase.CurrentStoryId = storyId;
            if (Config.UIStatus == AppUIStatus.All || Config.UIStatus == AppUIStatus.ListAndContent)
            {
                MainContentFrame.Navigate(typeof(MainContentPage), storyId);
                CommentFrame.Navigate(typeof(CommentPage), storyId);
            }
            else
            {
                Frame rootFrame = App.GetWindowFrame();
                if (rootFrame == null)
                {
                    return;
                }

                rootFrame.Navigate(typeof(MainContentPage), storyId);
            }
        }
        internal override Id3Tag ReadTag(Stream stream, out object additionalData)
        {
            additionalData = null;

            if (!HasTag(stream))
            {
                return(null);
            }

            stream.Seek(-125, SeekOrigin.End);
            byte[] tagBytes = new byte[125];
            stream.Read(tagBytes, 0, 125);

            Id3Tag tag = CreateTag();

            tag.Title.Value       = ReadTagString(tagBytes, 0, 30);
            tag.Artists.TextValue = ReadTagString(tagBytes, 30, 30);
            tag.Album.Value       = ReadTagString(tagBytes, 60, 30);
            tag.Year.TextValue    = ReadTagString(tagBytes, 90, 4);
            tag.Genre.Value       = ReadTagString(tagBytes, 124, 1);
            string comment;

            if (tagBytes[122] == 0 && tagBytes[123] != 0)
            {
                comment         = ReadTagString(tagBytes, 94, 28);
                tag.Track.Value = tagBytes[123];
            }
            else
            {
                comment         = ReadTagString(tagBytes, 94, 30);
                tag.Track.Value = -1;
            }
            if (!string.IsNullOrEmpty(comment))
            {
                var commentFrame = new CommentFrame
                {
                    Comment = comment
                };
                tag.Comments.Add(commentFrame);
            }

            return(tag);
        }
Ejemplo n.º 9
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.NavigationMode == NavigationMode.New)
            {
                Model = e.Parameter as InfoBindingModel;
                if (Model != null)
                {
                    MainTitle.Text = WebUtility.HtmlDecode(Model.title);
                    SubHeader.Text = WebUtility.HtmlDecode(Model.SubHeader);
                    SetContent(Model.article.content);
                    CommentFrame.Navigate(typeof(CommentPage), Model.contentId);
                    Comment.Instance.QuoteId = -1;
                }
                Comment.Instance.QuoteFloorChanged += QuoteFloorChanged;

                FavoriteButtonRef(true);
            }
        }
Ejemplo n.º 10
0
        private void hbComment_Click(object sender, RoutedEventArgs e)
        {
            MiniModeWindows();
            AddPanel((int)Globals.Panels.CommentPanel);
            ConfigurationSettings.UserCommentClose = false;

            if (Globals.CommentCount != "0")
            {
                //btCommentCount.Content = "0";
                //commentPanel.MessageCount = "0";

                if (CommentFrame.CurrentSource == null)
                {
                    CommentFrame.Navigate(new Uri(String.Format("/UserComment"), UriKind.Relative));
                }
                else
                {
                    CommentFrame.Refresh();
                }
            }
        }
Ejemplo n.º 11
0
 private void FBListView_ItemClick(object sender, ItemClickEventArgs e)
 {
     CommentBlade.IsOpen = true;
     CommentFrame.Navigate(typeof(CommentPage), e.ClickedItem as Feedback);
 }