Esempio n. 1
0
 // https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.MediaElement#remarks
 public UseMediaPlayerElementTag(TagDependencies tagDeps)
     : base(tagDeps, "RXT402", TagErrorType.Warning)
 {
     this.ToolTip         = StringRes.UI_XamlAnalysisUseMediaPlayerElementToolTip;
     this.Description     = StringRes.UI_XamlAnalysisUseMediaPlayerElementDescription;
     this.ExtendedMessage = StringRes.UI_XamlAnalysisUseMediaPlayerElementExtendedMessage;
 }
        protected RapidXamlDisplayedTag(TagDependencies deps, string errorCode, TagErrorType defaultErrorType)
            : base(deps.Span, deps.Snapshot, deps.FileName, deps.Logger)
        {
            if (deps.Span.Start > deps.Snapshot.Length)
            {
                if (deps.Snapshot.Length > 0)
                {
                    deps.Logger?.RecordError(
                        $"Span calculated outside snapshot for ErrorCode={errorCode}",
                        deps.TelemetryProperties);
                }

                // Reset the span location to something that's definitely valid
                deps.Span = new Span(0, 0);
            }

            var line = deps.Snapshot.GetLineFromPosition(deps.Span.Start);
            var col  = deps.Span.Start - line.Start.Position;

            this.ErrorCode                  = errorCode;
            this.Line                       = line.LineNumber;
            this.Column                     = col;
            this.DefaultErrorType           = defaultErrorType;
            this.VsPfp                      = deps.VsPfp;
            this.ProjectFilePath            = deps.ProjectFilePath;
            this.MoreInfoUrl                = deps.MoreInfoUrl;
            this.CustomFeatureUsageOverride = deps.FeatureUsageOverride;
        }
Esempio n. 3
0
 public SelectedItemBindingModeTag(TagDependencies tagDeps)
     : base(tagDeps, "RXT160", TagErrorType.Warning)
 {
     this.SuggestedAction = typeof(SelectedItemBindingModeAction);
     this.ToolTip         = StringRes.UI_XamlAnalysisSetBindingModeToTwoWayToolTip;
     this.Description     = StringRes.UI_XamlAnalysisSetBindingModeToTwoWayDescription;
 }
Esempio n. 4
0
 public MissingRowDefinitionTag(TagDependencies tagDeps)
     : base(tagDeps, "RXT101", TagErrorType.Warning)
 {
     this.SuggestedAction = typeof(AddMissingRowDefinitionsAction);
     this.ToolTip         = StringRes.UI_XamlAnalysisMissingRowDefinitionTooltip;
     this.ExtendedMessage = StringRes.UI_XamlAnalysisMissingRowDefinitionExtendedMessage;
 }
Esempio n. 5
0
 public AddTextBoxInputScopeTag(TagDependencies tagDeps)
     : base(tagDeps, "RXT150", TagErrorType.Suggestion)
 {
     this.SuggestedAction = typeof(AddTextBoxInputScopeAction);
     this.Description     = StringRes.UI_XamlAnalysisTextBoxWithoutInputScopeDescription;
     this.ExtendedMessage = StringRes.UI_XamlAnalysisTextBoxWithoutInputScopeExtendedMessage;
 }
Esempio n. 6
0
        public UidTitleCaseTag(TagDependencies tagDeps, string value)
            : base(tagDeps, "RXT451", TagErrorType.Suggestion)
        {
            this.ToolTip     = StringRes.UI_XamlAnalysisUidTitleCaseToolTip;
            this.Description = StringRes.UI_XamlAnalysisUidTitleCaseDescription.WithParams(value);

            this.CurrentValue = value;
        }
Esempio n. 7
0
        public NameTitleCaseTag(TagDependencies tagDeps, string value)
            : base(tagDeps, "RXT452", TagErrorType.Suggestion)
        {
            this.SuggestedAction = typeof(MakeNameStartWithCapitalAction);
            this.ToolTip         = StringRes.UI_XamlAnalysisNameTitleCaseToolTip;
            this.Description     = StringRes.UI_XamlAnalysisNameTitleCaseDescription.WithParams(value);

            this.CurrentValue = value;
        }
Esempio n. 8
0
 public HardCodedStringTag(TagDependencies tagDeps, string elementName, string attributeName, ProjectType projType)
     : base(tagDeps, "RXT200", TagErrorType.Warning)
 {
     this.ToolTip = StringRes.UI_XamlAnalysisHardcodedStringTooltip;
     this.ExtendedMessage = StringRes.UI_XamlAnalysisHardcodedStringExtendedMessage;
     this.ElementName = elementName;
     this.AttributeName = attributeName;
     this.ProjType = projType;
 }
Esempio n. 9
0
        // https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/checkbox#handle-click-and-checked-events
        public CheckBoxCheckedAndUncheckedEventsTag(TagDependencies tagDeps, string existingName, bool hasChecked)
            : base(tagDeps, "RXT401", TagErrorType.Warning)
        {
            this.ToolTip         = StringRes.UI_XamlAnalysisCheckBoxCheckedAndUncheckedEventsToolTip;
            this.Description     = StringRes.UI_XamlAnalysisCheckBoxCheckedAndUncheckedEventsDescription;
            this.ExtendedMessage = StringRes.UI_XamlAnalysisCheckBoxCheckedAndUncheckedEventsExtendedMessage;

            this.ExistingIsChecked = hasChecked;
            this.ExistingName      = existingName;
        }
Esempio n. 10
0
        protected RapidXamlDisplayedTag(TagDependencies deps, string errorCode, TagErrorType defaultErrorType)
            : base(deps.Span, deps.Snapshot, deps.FileName, deps.Logger)
        {
            var line = deps.Snapshot.GetLineFromPosition(deps.Span.Start);
            var col  = deps.Span.Start - line.Start.Position;

            this.ErrorCode                  = errorCode;
            this.Line                       = line.LineNumber;
            this.Column                     = col;
            this.DefaultErrorType           = defaultErrorType;
            this.VsAbstraction              = deps.VsAbstraction;
            this.ProjectFilePath            = deps.ProjectFilePath;
            this.MoreInfoUrl                = deps.MoreInfoUrl;
            this.CustomFeatureUsageOverride = deps.FeatureUsageOverride;
        }
Esempio n. 11
0
 public MissingColumnDefinitionTag(TagDependencies tagDeps)
     : base(tagDeps, "RXT102", TagErrorType.Warning)
 {
     this.ToolTip         = StringRes.UI_XamlAnalysisMissingColumnDefinitionTooltip;
     this.ExtendedMessage = StringRes.UI_XamlAnalysisMissingColumnDefinitionExtendedMessage;
 }
Esempio n. 12
0
 public ColumnSpanOverflowTag(TagDependencies tagDeps)
     : base(tagDeps, "RXT104", TagErrorType.Warning)
 {
     this.SuggestedAction = typeof(ColumnSpanOverflowAction);
     this.ToolTip         = StringRes.UI_XamlAnalysisColumnSpanOverflowTooltip;
 }
Esempio n. 13
0
 public RowSpanOverflowTag(TagDependencies tagDeps)
     : base(tagDeps, "RXT103", TagErrorType.Warning)
 {
     this.ToolTip = StringRes.UI_XamlAnalysisRowSpanOverflowTooltip;
 }