public LibraryFilterControl()
        {
            InitializeComponent();

            // Rotate the SORT icon 270 degrees
            TransformedBitmap sort_icon_rotated = new TransformedBitmap();

            {
                BitmapImage sort_icon = Icons.GetAppIcon(Icons.Sort);
                sort_icon_rotated.BeginInit();
                sort_icon_rotated.Transform = new RotateTransform(270);
                sort_icon_rotated.Source    = sort_icon;
                sort_icon_rotated.EndInit();
            }

            // Move the tabs into their correct places...
            DualTabTags.Children.Clear();
            DualTabTags.AddContent("Sort", "Sort", sort_icon_rotated, false, false, TabSort);
            DualTabTags.AddContent("Tag", "Tag", null, false, false, TabTags);
            DualTabTags.AddContent("AutoTag", "AutoTag", null, false, false, TabAITags);
            DualTabTags.AddContent("Author", "Author", null, false, false, TabAuthors);
            DualTabTags.AddContent("Publ.", "Publ.", null, false, false, TabPublications);
            DualTabTags.AddContent("Year", "Year", null, false, false, TabYear);
            DualTabTags.AddContent("Stage", "Stage", null, false, false, TabReadingStages);
            DualTabTags.AddContent("Rating", "Rating", null, false, false, TabRatings);
            DualTabTags.AddContent("Theme", "Theme", null, false, false, TabThemes);
            DualTabTags.AddContent("Type", "Type", null, false, false, TabTypes);
            DualTabTags.MakeActive("Tag");
            DualTabTags.TabPosition = DualTabbedLayout.TabPositions.Sides;

            SearchTag.OnSoftSearch += SearchTag_OnSoftSearch;

            ObjTagExplorerControl.OnTagSelectionChanged          += ObjTagExplorerControl_OnTagSelectionChanged;
            ObjAITagExplorerControl.OnTagSelectionChanged        += ObjAITagExplorerControl_OnTagSelectionChanged;
            ObjAuthorExplorerControl.OnTagSelectionChanged       += ObjAuthorExplorerControl_OnTagSelectionChanged;
            ObjPublicationExplorerControl.OnTagSelectionChanged  += ObjPublicationExplorerControl_OnTagSelectionChanged;
            ObjReadingStageExplorerControl.OnTagSelectionChanged += ObjReadingStageExplorerControl_OnTagSelectionChanged;
            ObjYearExplorerControl.OnTagSelectionChanged         += ObjYearExplorerControl_OnTagSelectionChanged;
            ObjRatingExplorerControl.OnTagSelectionChanged       += ObjRatingExplorerControl_OnTagSelectionChanged;
            ObjThemeExplorerControl.OnTagSelectionChanged        += ObjThemeExplorerControl_OnTagSelectionChanged;
            ObjTypeExplorerControl.OnTagSelectionChanged         += ObjTypeExplorerControl_OnTagSelectionChanged;

            ObjLibraryFilterControl_Sort.SortChanged += ObjLibraryFilterControl_Sort_SortChanged;

            ObjPanelSearchByTag.Visibility = ConfigurationManager.Instance.NoviceVisibility;

            //  DispatcherTimer setup
            var dispatcherTimer = new DispatcherTimer();

            dispatcherTimer.Tick += WeakEventHandler2.Wrap(dispatcherTimer_Tick, (eh) =>
            {
                dispatcherTimer.Tick -= eh;
            });
            dispatcherTimer.Interval = TimeSpan.FromMilliseconds(Constants.UI_REFRESH_POLLING_INTERVAL);
            dispatcherTimer.Start();
        }
Пример #2
0
        public LibraryFilterControl()
        {
            InitializeComponent();

            // Rotate the SORT icon 270 degrees
            TransformedBitmap sort_icon_rotated = new TransformedBitmap();

            {
                BitmapImage sort_icon = Icons.GetAppIcon(Icons.Sort);
                sort_icon_rotated.BeginInit();
                sort_icon_rotated.Transform = new RotateTransform(270);
                sort_icon_rotated.Source    = sort_icon;
                sort_icon_rotated.EndInit();
            }

            // Move the tabs into their correct places...
            DualTabTags.Children.Clear();
            DualTabTags.AddContent("Sort", "Sort", sort_icon_rotated, false, false, TabSort);
            DualTabTags.AddContent("Tag", "Tag", null, false, false, TabTags);
            DualTabTags.AddContent("AutoTag", "AutoTag", null, false, false, TabAITags);
            DualTabTags.AddContent("Author", "Author", null, false, false, TabAuthors);
            DualTabTags.AddContent("Publ.", "Publ.", null, false, false, TabPublications);
            DualTabTags.AddContent("Year", "Year", null, false, false, TabYear);
            DualTabTags.AddContent("Stage", "Stage", null, false, false, TabReadingStages);
            DualTabTags.AddContent("Rating", "Rating", null, false, false, TabRatings);
            DualTabTags.AddContent("Theme", "Theme", null, false, false, TabThemes);
            DualTabTags.AddContent("Type", "Type", null, false, false, TabTypes);
            DualTabTags.MakeActive("Tag");
            DualTabTags.TabPosition = DualTabbedLayout.TabPositions.Sides;

            SearchTag.OnSoftSearch += SearchTag_OnSoftSearch;

            ObjTagExplorerControl.OnTagSelectionChanged          += ObjTagExplorerControl_OnTagSelectionChanged;
            ObjAITagExplorerControl.OnTagSelectionChanged        += ObjAITagExplorerControl_OnTagSelectionChanged;
            ObjAuthorExplorerControl.OnTagSelectionChanged       += ObjAuthorExplorerControl_OnTagSelectionChanged;
            ObjPublicationExplorerControl.OnTagSelectionChanged  += ObjPublicationExplorerControl_OnTagSelectionChanged;
            ObjReadingStageExplorerControl.OnTagSelectionChanged += ObjReadingStageExplorerControl_OnTagSelectionChanged;
            ObjYearExplorerControl.OnTagSelectionChanged         += ObjYearExplorerControl_OnTagSelectionChanged;
            ObjRatingExplorerControl.OnTagSelectionChanged       += ObjRatingExplorerControl_OnTagSelectionChanged;
            ObjThemeExplorerControl.OnTagSelectionChanged        += ObjThemeExplorerControl_OnTagSelectionChanged;
            ObjTypeExplorerControl.OnTagSelectionChanged         += ObjTypeExplorerControl_OnTagSelectionChanged;

            ObjLibraryFilterControl_Sort.SortChanged += ObjLibraryFilterControl_Sort_SortChanged;

            ObjPanelSearchByTag.Visibility = ConfigurationManager.Instance.NoviceVisibility;
        }
        public CSLEditorControl()
        {
            InitializeComponent();

            // Toolbar
            ButtonNew.Icon        = Icons.GetAppIcon(Icons.New);
            ButtonNew.Caption     = "New";
            ButtonNew.Click      += ButtonNew_Click;
            ButtonOpen.Caption    = "Open";
            ButtonOpen.Icon       = Icons.GetAppIcon(Icons.Open);
            ButtonOpen.Click     += ButtonOpen_Click;
            ButtonSave.Caption    = "Save ";
            ButtonSave.Icon       = Icons.GetAppIcon(Icons.Save);
            ButtonSave.Click     += ButtonSave_Click;
            ButtonSaveAs.Caption  = "Save As";
            ButtonSaveAs.Icon     = Icons.GetAppIcon(Icons.SaveAs);
            ButtonSaveAs.Click   += ButtonSaveAs_Click;
            ButtonRefresh.Caption = "Refresh (F5)";
            ButtonRefresh.Icon    = Icons.GetAppIcon(Icons.Refresh);
            ButtonRefresh.Click  += ButtonRefresh_Click;
            ButtonHelp.Caption    = "Help";
            ButtonHelp.Icon       = Icons.GetAppIcon(Icons.Help);
            ButtonHelp.Click     += ButtonHelp_Click;



            // Fix the DualTab
            DualTabTags.Children.Clear();
            DualTabTags.AddContent("CSL", "CSL", null, false, false, ObjCSLEditorPanel);
            DualTabTags.AddContent("BibTeX", "BibTeX", null, false, false, ObjBibTexEditorPanel);
            DualTabTags.AddContent("JavaScript", "JavaScript", null, false, false, ObjJavaScriptEditorPanel);
            DualTabTags.MakeActive("CSL");
            DualTabTags.TabPosition = DualTabbedLayout.TabPositions.Sides;

            DragToEditorManager.RegisterControl(ObjCSLEditor);
            DragToEditorManager.RegisterControl(ObjBibTexEditor);
            DragToEditorManager.RegisterControl(ObjJavaScriptEditor);

            // Code folding
            folding_manager  = FoldingManager.Install(ObjCSLEditor.TextArea);
            folding_strategy = new XmlFoldingStrategy();
            folding_strategy.ShowAttributesWhenFolded = true;
            ObjCSLEditor.TextArea.Options.ShowSpaces  = true;
            ObjCSLEditor.TextArea.Options.ShowTabs    = true;
            ObjCSLEditor.TextArea.Options.ShowBoxForControlCharacters             = true;
            ObjCSLEditor.TextArea.Options.EnableHyperlinks                        = true;
            ObjCSLEditor.TextArea.Options.EnableEmailHyperlinks                   = true;
            ObjCSLEditor.TextArea.Options.RequireControlModifierForHyperlinkClick = true;
            ObjCSLEditor.TextArea.Options.EnableRectangularSelection              = true;
            ObjCSLEditor.TextArea.Options.EnableTextDragDrop                      = true;
            ObjCSLEditor.TextArea.Options.CutCopyWholeLine                        = true;

            // Events
            ObjCSLEditor.TextChanged    += ObjCSLEditor_TextChanged;
            ObjBibTexEditor.TextChanged += ObjBibTexEditor_TextChanged;

            // Load the samples
            string sample_csl_filename = ConfigurationManager.Instance.StartupDirectoryForQiqqa + @"InCite\styles\apa.csl";

            ObjCSLEditor.Text = File.ReadAllText(sample_csl_filename);
            string sample_bibtex_filename = ConfigurationManager.Instance.StartupDirectoryForQiqqa + @"InCite\CSLEditorStuff\SampleBibTeX.txt";

            ObjBibTexEditor.Text = File.ReadAllText(sample_bibtex_filename);

            // Bind the keys
            this.PreviewKeyDown += CSLEditorControl_PreviewKeyDown;
        }