Exemple #1
0
        private void ExpandAuthors()
        {
            FeatureTrackingManager.Instance.UseFeature(Features.Brainstorm_ExploreLibrary_Document_Authors);

            PDFDocument pdf_document = pdf_document_node_content.PDFDocument;

            string authors = pdf_document.AuthorsCombined;

            if (String.IsNullOrEmpty(authors) || 0 == PDFDocument.UNKNOWN_AUTHORS.CompareTo(authors))
            {
                return;
            }

            List <NameTools.Name> names = new List <NameTools.Name>();

            string[] authors_split = NameTools.SplitAuthors_LEGACY(authors);
            foreach (string author_split in authors_split)
            {
                string first_names, last_name;
                NameTools.SplitName_LEGACY(author_split, out first_names, out last_name);
                string initial = String.IsNullOrEmpty(first_names) ? null : first_names.Substring(0, 1);
                PDFAuthorNodeContent pdf_author = new PDFAuthorNodeContent(pdf_document.Library.WebLibraryDetail.Id, last_name, initial);
                NodeControlAddingByKeyboard.AddChildToNodeControl(node_control, pdf_author, false);
            }
        }
Exemple #2
0
        private static void ExpandAuthors(PDFDocument doc, NodeControl node_control)
        {
            WPFDoEvents.AssertThisCodeIs_NOT_RunningInTheUIThread();
            ASSERT.Test(doc != null);

            FeatureTrackingManager.Instance.UseFeature(Features.Brainstorm_ExploreLibrary_Document_Authors);

            if (doc != null)
            {
                string authors = doc.AuthorsCombined;
                if (String.IsNullOrEmpty(authors) || Constants.UNKNOWN_AUTHORS == authors)
                {
                    return;
                }

                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

                    List <NameTools.Name> names = new List <NameTools.Name>();
                    string[] authors_split      = NameTools.SplitAuthors_LEGACY(authors);
                    foreach (string author_split in authors_split)
                    {
                        string first_names, last_name;
                        NameTools.SplitName_LEGACY(author_split, out first_names, out last_name);
                        string initial = String.IsNullOrEmpty(first_names) ? null : first_names.Substring(0, 1);
                        PDFAuthorNodeContent pdf_author = new PDFAuthorNodeContent(doc.LibraryRef.Id, last_name, initial);
                        NodeControlAddingByKeyboard.AddChildToNodeControl(node_control, pdf_author, false);
                    }
                });
            }
        }
        public PDFAuthorNodeContentEditor(NodeControl node_control, PDFAuthorNodeContent pdf_author_node_content)
        {
            this.node_control            = node_control;
            this.pdf_author_node_content = pdf_author_node_content;
            DataContext = pdf_author_node_content;

            InitializeComponent();
        }
Exemple #4
0
        public PDFAuthorNodeContentControl(NodeControl node_control, PDFAuthorNodeContent pdf_author_node_content)
        {
            this.node_control            = node_control;
            this.pdf_author_node_content = pdf_author_node_content;
            DataContext = pdf_author_node_content;

            InitializeComponent();

            Focusable = true;

            ImageIcon.Source = Icons.GetAppIcon(Icons.BrainstormPDFAuthor);

            ImageIcon.Width         = NodeThemes.image_width;
            TextBorder.CornerRadius = NodeThemes.corner_radius;
            TextBorder.Background   = NodeThemes.background_brush;
        }
Exemple #5
0
        public override bool Equals(object obj)
        {
            PDFAuthorNodeContent other = obj as PDFAuthorNodeContent;

            if (null == other)
            {
                return(false);
            }

            if (library_id != other.library_id)
            {
                return(false);
            }
            if (surname != other.surname)
            {
                return(false);
            }
            if (initial != other.initial)
            {
                return(false);
            }

            return(true);
        }