コード例 #1
0
        protected override void PageLoad()
        {
            Master.DisabledSidePanel = true;

            Statuses = EngineFactory.StatusEngine.GetWithDefaults()
                       .OrderBy(t => t.StatusType)
                       .ThenBy(t => t.Order)
                       .ToList();

            _hintPopupTaskRemove.Options.IsPopup       = true;
            _hintPopupMilestoneRemove.Options.IsPopup  = true;
            _hintPopupMilestoneTasks.Options.IsPopup   = true;
            _hintPopupTaskWithSubtasks.Options.IsPopup = true;
            _moveTaskOutMilestone.Options.IsPopup      = true;
            _addNewLinkPopup.Options.IsPopup           = true;

            Page.RegisterStyle("~/Products/Projects/App_Themes/default/css/ganttchart.css");

            HelpLink = CommonLinkUtility.GetHelpLink();

            if (!string.IsNullOrEmpty(HelpLink))
            {
                HelpLink = HelpLink.TrimEnd('/') + "/projects.aspx";
            }

            Title = HeaderStringHelper.GetPageTitle(ProjectResource.GanttGart);
        }
コード例 #2
0
        static void OnHelpLinkClicked(
            HelpPanel helpPanel,
            HelpLink helpLink)
        {
            HelpLink.LinkType linkType;
            string            content;

            if (!HelpLinkData.TryGet(helpLink.Link, out linkType, out content))
            {
                return;
            }

            switch (linkType)
            {
            case HelpLink.LinkType.Action:
                GuiMessage.ShowInformation(
                    "An ACTION link has been clicked:\n" + content);
                break;

            case HelpLink.LinkType.Help:
                helpPanel.Show(
                    content == "sample1" ?
                    Images.Name.GenericBuho1 :
                    Images.Name.GenericBuhoShe1,
                    content == "sample1" ?
                    TestingHelpData.GetSample1() :
                    TestingHelpData.GetSample2());
                break;

            case HelpLink.LinkType.Link:
                Process.Start(content);
                break;
            }
        }
コード例 #3
0
        public void GetAllLinksSuccessfulSingleTest()
        {
            var helpLink  = new HelpLink("Url", "Text", 1);
            var helpLinks = new List <HelpLink> {
                helpLink
            };

            var helpLinkDto = new HelpLinkDto
            {
                Url      = "Url",
                LinkText = "Text",
                Order    = 1
            };

            var helpLinkDtos = new List <HelpLinkDto> {
                helpLinkDto
            };

            _helpRepoMock.Setup(x => x.GetAllLinks()).Returns(helpLinks);
            _mapperMock.Setup(x => x.Map <IList <HelpLinkDto> >(helpLinks)).Returns(helpLinkDtos);

            var response = _helpService.GetAllLinks();

            Assert.IsNotNull(response);
            Assert.AreEqual(ResponseCode.Success, response.Code);
            Assert.IsEmpty(response.ErrorMessage);
            Assert.IsNotNull(response.Entity);
            Assert.AreEqual(1, response.Entity.Count);
            Assert.Contains(helpLinkDto, response.Entity.ToList());
        }
コード例 #4
0
 internal static Data BuildForLink(HelpLink link)
 {
     return(new Data()
     {
         Begin = link.Position,
         Length = link.Length,
         Prefix = LINK_PREFIX,
         Suffix = LINK_SUFFIX
     });
 }
コード例 #5
0
    public override void GetObjectData(SerializationInfo info,
                                       StreamingContext context)
    {
        // Change the case of two properties, and then use the
        // method of the base class.
        HelpLink = HelpLink.ToLower( );
        Source   = Source.ToUpperInvariant();

        base.GetObjectData(info, context);
    }
コード例 #6
0
        private ExceptionLog BuildExceptionLog(LoggedErrorDTO error)
        {
            var message = db.Messages.FirstOrDefault(m => m.Text == error.Message);

            if (message == null)
            {
                message = new Message {
                    Text = error.Message
                }
            }
            ;

            var helpLink = db.HelpLinks.FirstOrDefault(hl => hl.Link == error.HelpLink);

            if (helpLink == null && error.HelpLink != null)
            {
                helpLink = new HelpLink {
                    Link = error.HelpLink
                }
            }
            ;

            var source = db.Sources.FirstOrDefault(s => s.Application == error.Source);

            if (source == null && error.Source != null)
            {
                source = new Source {
                    Application = error.Source
                }
            }
            ;

            //var data = db.Data.Where(d => d.DataEntries.)

            var exceptionType = db.ExceptionTypes.FirstOrDefault(e => e.Name == error.ExceptionType);

            if (exceptionType == null)
            {
                exceptionType = new ExceptionType {
                    Name = error.ExceptionType
                }
            }
            ;

            var loggedException = new ExceptionLog();

            loggedException.Message       = message;
            loggedException.HelpLink      = helpLink;
            loggedException.Source        = source;
            loggedException.ExceptionType = exceptionType;
            return(loggedException);
        }
    }
}
コード例 #7
0
        static Segment.Data GetSegmentData(object segment)
        {
            if (segment is HelpLink)
            {
                HelpLink link = (HelpLink)segment;
                return(Segment.BuildForLink(link));
            }

            HelpFormat format = (HelpFormat)segment;

            return(Segment.BuildForFormat(format));
        }
コード例 #8
0
        private static DiagnosticDescriptor NewRule()
        {
            var localize = Localizers.Of <R>(R.ResourceManager);

            return(new DiagnosticDescriptor(
                       DiagnosticId,
                       localize(nameof(R.Title)),
                       localize(nameof(R.MessageFormat)),
                       Category,
                       DiagnosticSeverity.Warning,
                       isEnabledByDefault: true,
                       description: localize(nameof(R.Description)),
                       helpLinkUri: HelpLink.ToUri(DiagnosticId)));
        }
コード例 #9
0
        public void CreateTwoLinkHeaders()
        {
            var request = new HttpRequestMessage();
            var about = new AboutLink() { Target = new Uri("http://example.org/about") };
            var help = new HelpLink() { Target = new Uri("http://example.org/help") };

            request.Headers.AddLinkHeader(about);
            request.Headers.AddLinkHeader(help);

            var headers = request.Headers.GetValues("Link");

            Assert.Equal("<http://example.org/about>;rel=\"about\"", headers.First().ToString());
            Assert.Equal("<http://example.org/help>;rel=\"help\"", headers.Last().ToString());
        }
コード例 #10
0
        public ViewResult Help()
        {
            var links = _config.GetSection("HelpLinks").GetChildren().ToArray();
            var help  = new Help();

            foreach (var link in links)
            {
                var helpLink = new HelpLink();
                link.Bind(helpLink);
                help.Add(helpLink);
            }

            return(View(help));
        }
コード例 #11
0
ファイル: HelpPanel.cs プロジェクト: shuwithu/Faces
        internal bool TryGetLinkAtChar(
            int charIndex,
            out HelpLink link)
        {
            link = null;

            FormattedHelpLink formattedLink = GetFormattedLinkAtChar(
                mFormattedLinks, charIndex);

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

            link = formattedLink.Source;

            return(!BuildFormattedHelp.IsLinkMetaChar(formattedLink, charIndex));
        }
コード例 #12
0
        private void RemoveHelpLink_Click(object sender, RoutedEventArgs e)
        {
            HelpLink helpLink = HelpLinksGrid.SelectedItem as HelpLink;

            if (helpLink == null)
            {
                return;
            }

            if (ViewerApplicationControl.Instance == null ||
                ViewerApplicationControl.Instance.ViewerApplication == null ||
                ViewerApplicationControl.Instance.ViewerApplication.HelpLinks == null)
            {
                return;
            }

            ViewerApplicationControl.Instance.ViewerApplication.HelpLinks.Remove(helpLink);
        }
コード例 #13
0
        public void CreateTwoLinkHeaders()
        {
            var request = new HttpRequestMessage();
            var about   = new AboutLink()
            {
                Target = new Uri("http://example.org/about")
            };
            var help = new HelpLink()
            {
                Target = new Uri("http://example.org/help")
            };

            request.Headers.AddLinkHeader(about);
            request.Headers.AddLinkHeader(help);

            var headers = request.Headers.GetValues("Link");

            Assert.Equal("<http://example.org/about>;rel=\"about\"", headers.First().ToString());
            Assert.Equal("<http://example.org/help>;rel=\"help\"", headers.Last().ToString());
        }
コード例 #14
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Id != null
                    ? Id.GetHashCode()
                    : 0;

                hashCode = (hashCode * 397) ^ (Title != null
                    ? Title.GetHashCode()
                    : 0);
                hashCode = (hashCode * 397) ^ (Name != null
                    ? Name.GetHashCode()
                    : 0);
                hashCode = (hashCode * 397) ^ (int)Type;
                hashCode = (hashCode * 397) ^ (ExtraTitleInfo != null
                    ? ExtraTitleInfo.GetHashCode()
                    : 0);
                hashCode = (hashCode * 397) ^ (Category != null
                    ? Category.GetHashCode()
                    : 0);
                hashCode = (hashCode * 397) ^ Allocation.GetHashCode();
                hashCode = (hashCode * 397) ^ Precision.GetHashCode();
                hashCode = (hashCode * 397) ^ Calculated.GetHashCode();
                hashCode = (hashCode * 397) ^ Segmentable.GetHashCode();
                hashCode = (hashCode * 397) ^ (Description != null
                    ? Description.GetHashCode()
                    : 0);
                hashCode = (hashCode * 397) ^ (int)Polarity;
                hashCode = (hashCode * 397) ^ (HelpLink != null
                    ? HelpLink.GetHashCode()
                    : 0);
                hashCode = (hashCode * 397) ^ AllowedForReporting.GetHashCode();

                return(hashCode);
            }
        }
コード例 #15
0
 private void CommandHelp_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     HelpLink.DoClick();
 }
コード例 #16
0
        protected override void Render(HtmlTextWriter output)
        {
            output.Write(
                "<table " +
                "id='" + this.ClientID + "' " +
                ((Height == null) ? "" : "height='" + Height + "' ") +
                ((Width == null) ? "" : "width='" + Width + "' ") +
                ((BorderWidth == null) ? "border='0' " : "border='" + BorderWidth + "' ") +
                ((CssClass == null) ? "" : "class='" + CssClass + "' ") +
                ">\r\n"
                );


            output.Write(
                "<tr " +
                ">\r\n" +
                "<td " +
                ((VertialAlign == null) ? "valign='top' " : "valign='" + VertialAlign + "' ") +

                ">\r\n"
                );



            HelpText.RenderControl(output);


            output.Write(
                "</td>\r\n" +
                "<td " +
                "width='25' " +
                ((HorizontalAlign == null) ? "align='right' " : "align='" + HorizontalAlign + "' ") +
                ((VertialAlign == null) ? "valign='top' " : "valign='" + VertialAlign + "' ") +
                ">\r\n"
                );


            HelpLink.RenderControl(output);

            output.Write(
                "</td>\r\n" +
                "</tr>\r\n" +
                "</table>\r\n"
                );

            /*
             * AddAttribute( output,HtmlTextWriterAttribute.Height, Height, null );
             * AddAttribute( output,HtmlTextWriterAttribute.Border, BorderWidth, "0" );
             * AddAttribute( output,HtmlTextWriterAttribute.Class, CssClass, null );
             * AddAttribute( output,HtmlTextWriterAttribute.Id, ClientID, null );
             * AddAttribute( output,HtmlTextWriterAttribute.Width, Width,null );
             * output.RenderBeginTag( HtmlTextWriterTag.Table );
             *
             * output.RenderBeginTag( HtmlTextWriterTag.Tr );
             *
             * //Text Row
             * AddAttribute( output,HtmlTextWriterAttribute.Align, HorizontalAlign,null );
             * AddAttribute( output,HtmlTextWriterAttribute.Valign, VertialAlign,null );
             * output.RenderBeginTag( HtmlTextWriterTag.Td );
             *
             * if( null!=HelpText )
             *      HelpText.RenderControl( output );
             *
             * output.RenderEndTag();//HtmlTextWriterTag.Td
             *
             * AddAttribute( output,HtmlTextWriterAttribute.Width, "25",null );
             * AddAttribute( output,HtmlTextWriterAttribute.Align, HorizontalAlign,null );
             * AddAttribute( output,HtmlTextWriterAttribute.Valign, VertialAlign,null );
             * output.RenderBeginTag( HtmlTextWriterTag.Td );
             *
             * if( null!=HelpLink )
             *      HelpLink.RenderControl( output );
             *
             * output.RenderEndTag();//HtmlTextWriterTag.Td
             *
             * output.RenderEndTag();//HtmlTextWriterTag.Tr
             * output.RenderEndTag();//HtmlTextWriterTag.Table
             */
        }