Пример #1
0
        internal DiscussionBox(
            CustomFontForm parent,
            SingleDiscussionAccessor accessor, IGitCommandService git,
            User currentUser, ProjectKey projectKey, Discussion discussion,
            User mergeRequestAuthor,
            int diffContextDepth, ColorScheme colorScheme,
            Action <DiscussionBox> preContentChange,
            Action <DiscussionBox, bool> onContentChanged,
            Action <Control> onControlGotFocus)
        {
            Parent = parent;

            Discussion = discussion;

            _accessor           = accessor;
            _editor             = accessor.GetDiscussionEditor();
            _mergeRequestAuthor = mergeRequestAuthor;
            _currentUser        = currentUser;
            _imagePath          = StringUtils.GetHostWithPrefix(projectKey.HostName) + "/" + projectKey.ProjectName;

            _diffContextDepth    = new ContextDepth(0, diffContextDepth);
            _tooltipContextDepth = new ContextDepth(5, 5);
            if (git != null)
            {
                _panelContextMaker   = new EnhancedContextMaker(git);
                _tooltipContextMaker = new CombinedContextMaker(git);
            }
            _colorScheme = colorScheme;

            _preContentChange  = preContentChange;
            _onContentChanged  = onContentChanged;
            _onControlGotFocus = onControlGotFocus;

            _htmlDiffContextToolTip = new HtmlToolTip
            {
                AutoPopDelay = 20000, // 20s
                InitialDelay = 300
            };

            _htmlDiscussionNoteToolTip = new HtmlToolTip
            {
                AutoPopDelay = 20000, // 20s
                InitialDelay = 300,
            };

            _specialDiscussionNoteMarkdownPipeline =
                MarkDownUtils.CreatePipeline(Program.ServiceManager.GetJiraServiceUrl());

            onCreate();
        }
Пример #2
0
        internal DiscussionBox(Discussion discussion, DiscussionEditor editor, User mergeRequestAuthor, User currentUser,
                               int diffContextDepth, IGitRepository gitRepository, ColorScheme colorScheme,
                               Action <DiscussionBox> preContentChange, Action <DiscussionBox> onContentChanged)
        {
            Discussion          = discussion;
            _editor             = editor;
            _mergeRequestAuthor = mergeRequestAuthor;
            _currentUser        = currentUser;

            _diffContextDepth    = new ContextDepth(0, diffContextDepth);
            _tooltipContextDepth = new ContextDepth(5, 5);
            _formatter           = new DiffContextFormatter();
            if (gitRepository != null)
            {
                _panelContextMaker   = new EnhancedContextMaker(gitRepository);
                _tooltipContextMaker = new CombinedContextMaker(gitRepository);
            }
            _colorScheme = colorScheme;

            _preContentChange = preContentChange;
            _onContentChanged = onContentChanged;

            _toolTip = new ToolTip
            {
                AutoPopDelay = 5000,
                InitialDelay = 500,
                ReshowDelay  = 100
            };

            _toolTipNotifier = new ToolTip();

            _htmlToolTip = new HtmlToolTip
            {
                AutoPopDelay   = 10000, // 10s
                BaseStylesheet = ".htmltooltip { padding: 1px; }"
            };

            onCreate();
        }