Beispiel #1
0
        public ITNodeDataCollection <ITNodeData> GetNodeDataCollection()
        {
            switch (IssueType)
            {
            case EIssueType.建筑物沉降:
                return(new BuildingSubsidenceCollection <BuildingSubsidenceDataV1>());

            case EIssueType.地表沉降:
                return(new SurfaceSubsidenceCollection <SurfaceSubsidenceDataV1>());

            case EIssueType.钢支撑轴力监测:
                return(new STBAPCollection <STBAPDataV1>());

            case EIssueType.管线沉降_无压:
                return(new UnpressedPipeLineSubsidenceCollection <UnpressedPipeLineSubsidenceDataV1>());

            case EIssueType.管线沉降_有压:
                return(new PressedPipeLineSubsidenceCollection <PressedPipeLineSubsidenceDataV1>());

            //case EIssueType.侧斜监测:
            //    return new SkewBackCollection<SkewBackDataV1>();
            default:
                throw new NotImplementedException("未支持该类型的ITNodeDataCollection:" + IssueType.ToString());
            }
        }
        public static string ToFriendlyName(this IssueType type)
        {
            switch (type)
            {
            case IssueType.Other:
            case IssueType.Sidewalks:
                return(type.ToString());

            case IssueType.DangerousBuildings:
                return("Dangerous buildings");

            case IssueType.DangerousTrees:
                return("Dangerous trees");

            case IssueType.GreenSpaces:
                return("Green spaces");

            case IssueType.ParkingZones:
                return("Parking zones");

            case IssueType.PublicTransport:
                return("Public transport");

            case IssueType.DamagedRoads:
                return("Damaged roads");

            case IssueType.StreetLighting:
                return("Street Lighting");

            default:
                return("");
            }
        }
        private static void OutputSection(
            Dictionary <IssueType, List <Issue> > labelSet,
            StringBuilder builder,
            IssueType key,
            bool includeHeader = true,
            bool problem       = false)
        {
            List <Issue> issues    = null;
            bool         hasIssues = labelSet.TryGetValue(key, out issues);

            if (hasIssues)
            {
                if (includeHeader)
                {
                    var issueTypeString = key.ToString();
                    builder.AppendLine(string.Format("**{0}s:**", issueTypeString));
                    builder.AppendLine();
                }

                foreach (var issue in labelSet[key])
                {
                    builder.AppendLine("* " + issue.Title + " - " + "[#" + issue.Number + "](" + issue.HtmlUrl + ")");
                    builder.AppendLine();
                }
            }
        }
Beispiel #4
0
 public NewIssuePage SelectType(IssueType type)
 {
     comboboxIssueType = new SelectElement(SearchElementUtil.GetElement(driver, locatorComboboxIssueType));
     if (type != IssueType.Default)
     {
         comboboxIssueType.SelectByText(type.ToString().Replace(" ", ""));
     }
     return(this);
 }
Beispiel #5
0
        public override void OnCreateView(LayoutInflater inflater, ViewGroup container)
        {
            base.OnCreateView(inflater, container);

            #region Desinger Stuff

            SetContentView(Resource.Layout.FragmentIssue, inflater, container);

            SlideUpToShowKeyboard();

            this.HasOptionsMenu = true;

            #endregion

            this.Title = _currentIssueType.ToString();

            this.TypeImage.Clickable = _issue == null;
            this.TypeImage.Enabled   = _issue == null;
            this.TypeImage.SetOnTouchListener(GestureListener.ForSingleTapUp(this.Activity,
                                                                             (e) =>
            {
                _currentIssueType++;
                if ((int)_currentIssueType == 4)
                {
                    _currentIssueType = IssueType.Crash;
                }

                this.Title = _currentIssueType.ToString();
                this.TapToChangeTypeLabel.Visibility = ViewStates.Gone;
                SetIssueTypeImage(_currentIssueType);
            }));

            this.DescriptionText.FocusChange += DescriptionText_FocusChange;

            this.EditButton.Click += EditButton_Click;

            SetIssueTypeImage(_currentIssueType);

            if (_issue != null)
            {
                LoadIssue();
            }
        }
Beispiel #6
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            #region Designer Stuff

            this.TitleText.SetPlaceholderColor(ViewBuilder.ColorFromARGB("FFd1d1d1"));

            AutoShouldReturnTextFields(new[] { this.TitleText });

            SlideUpToShowKeyboard();

            this.HasBarButtonItems = true;

            #endregion

            this.Title = _currentIssueType.ToString();

            this.TypeImage.UserInteractionEnabled = _issue == null;
            this.TypeImage.AddGestureRecognizer(new UITapGestureRecognizer(
                                                    () =>
            {
                _currentIssueType++;
                if ((int)_currentIssueType == 4)
                {
                    _currentIssueType = IssueType.Crash;
                }

                this.Title = _currentIssueType.ToString();
                this.TapToChangeTypeLabel.Hidden = true;
                SetIssueTypeImage(_currentIssueType);
            }));

            this.EditButton.TouchUpInside += EditButton_TouchUpInside;

            SetIssueTypeImage(_currentIssueType);

            if (_issue != null)
            {
                LoadIssue();
            }
        }
Beispiel #7
0
        /// <summary>
        /// Transforms the issue type into a valid query string value.
        /// </summary>
        /// <param name="value">Issue type.</param>
        /// <returns>Query string value representation of the provided issue type.</returns>
        private static string IssueTypeAsQueryParameter(IssueType value)
        {
            switch (value)
            {
            case IssueType.CodeSmell:
                return("CODE_SMELL");

            default:
                return(value.ToString().ToUpperInvariant());
            }
        }
Beispiel #8
0
 public IssueCreated(
     TenantId tenantId1,
     IssueId issueId1,
     ProductId productId1,
     string description1,
     string summary1,
     IssueType issueType)
 {
     // TODO: Complete member initialization
     this.tenantId    = tenantId1.ToString();
     this.issueId     = issueId1.ToString();
     this.productId   = productId1.ToString();
     this.description = description1.ToString();
     this.summary     = summary1.ToString();
     this.issueType   = issueType.ToString();
 }
        private IEnumerable ReportIssueAsync(string reporter, string description, IssueType type, HashSet<string> attachments)
        {
            var arguments = new List<string>
            {
                "SERVER", "REPORTISSUE",
                "--reporter", reporter,
                "--description", description,
                "--type", type.ToString()
            };
            if (attachments != null && attachments.Count > 0)
            {
                arguments.Add("--attachments");
                foreach (var attachment in attachments)
                    arguments.Add(attachment);
            }
            if (Settings.Current.Verbose)
                arguments.Add("--verbose");

            var reportIssue = ToolsRunner.RunCharonAsTool(arguments.ToArray());
            yield return reportIssue.IgnoreFault();

            var errorOutput = reportIssue.HasErrors ? reportIssue.Error.Message : reportIssue.GetResult().GetErrorData();
            if (string.IsNullOrEmpty(errorOutput) == false)
                throw new InvalidOperationException("Failed to report issue: " + (errorOutput.Length > 0 ? errorOutput : "An unknown error occured. Please report this issue directly to developer."));
        }
Beispiel #10
0
 /// <summary>
 /// Translate detected issue
 /// </summary>
 public static CV <String> TranslateDetectedIssueCode(IssueType issueType)
 {
     return(new CV <String>(Util.ToWireFormat((MARC.Everest.RMIM.CA.R020402.Vocabulary.ActDetectedIssueCode)Enum.Parse(typeof(MARC.Everest.RMIM.CA.R020402.Vocabulary.ActDetectedIssueCode), issueType.ToString()))));
 }
Beispiel #11
0
 private static string GetStringValue(IssueType?value)
 {
     return(value?.ToString());
 }
Beispiel #12
0
 public static string ToString(IssueType value)
 {
     if (value == IssueType.Invalid)
     {
         return("invalid");
     }
     else if (value == IssueType.Structure)
     {
         return("structure");
     }
     else if (value == IssueType.Required)
     {
         return("required");
     }
     else if (value == IssueType.Value)
     {
         return("value");
     }
     else if (value == IssueType.Invariant)
     {
         return("invariant");
     }
     else if (value == IssueType.Security)
     {
         return("security");
     }
     else if (value == IssueType.Login)
     {
         return("login");
     }
     else if (value == IssueType.Unknown)
     {
         return("unknown");
     }
     else if (value == IssueType.Expired)
     {
         return("expired");
     }
     else if (value == IssueType.Forbidden)
     {
         return("forbidden");
     }
     else if (value == IssueType.Processing)
     {
         return("processing");
     }
     else if (value == IssueType.NotSupported)
     {
         return("not-supported");
     }
     else if (value == IssueType.Duplicate)
     {
         return("duplicate");
     }
     else if (value == IssueType.NotFound)
     {
         return("not-found");
     }
     else if (value == IssueType.TooLong)
     {
         return("too-long");
     }
     else if (value == IssueType.CodeUnknown)
     {
         return("code-unknown");
     }
     else if (value == IssueType.Extension)
     {
         return("extension");
     }
     else if (value == IssueType.TooCostly)
     {
         return("too-costly");
     }
     else if (value == IssueType.BusinessRule)
     {
         return("business-rule");
     }
     else if (value == IssueType.Conflict)
     {
         return("conflict");
     }
     else if (value == IssueType.Transient)
     {
         return("transient");
     }
     else if (value == IssueType.LockError)
     {
         return("lock-error");
     }
     else if (value == IssueType.NoStore)
     {
         return("no-store");
     }
     else if (value == IssueType.Exception)
     {
         return("exception");
     }
     else if (value == IssueType.Timeout)
     {
         return("timeout");
     }
     else if (value == IssueType.Throttled)
     {
         return("throttled");
     }
     else
     {
         throw new ArgumentException("Unrecognized IssueType value: " + value.ToString());
     }
 }
 internal static string LowerName(this IssueType issueType)
 {
     return(issueType.ToString().ToLowerInvariant());
 }
Beispiel #14
0
        public async Task AllAsyncShould_ReturnsIssueWithCorrectModel(bool isApproved, int rowsCount, int page, RegionType region, IssueType issueType, string sortType)
        {
            //Arrange
            var issue       = CreateIssue(true, RegionType.Central, IssueType.DangerousTrees);
            var secondIssue = CreateIssue(true, RegionType.Central, IssueType.Sidewalks);
            var thirdIssue  = CreateIssue(true, RegionType.Western, IssueType.DangerousBuildings);

            await this.Db.AddRangeAsync(issue, secondIssue, thirdIssue);

            var notApprovedIssue       = CreateIssue(false, RegionType.Central, IssueType.DangerousBuildings);
            var secondNotApprovedIssue = CreateIssue(false, RegionType.Central, IssueType.DangerousBuildings);
            var thirdNotApprovedIssue  = CreateIssue(false, RegionType.South, IssueType.DangerousBuildings);

            await this.Db.AddRangeAsync(notApprovedIssue, secondNotApprovedIssue, thirdNotApprovedIssue);

            await this.Db.SaveChangesAsync();

            //TODO: rearrange test - now issueService has more parameters
            var service = new IssueService(this.Db, null);

            //Act
            (var pagesCount, var issues) = await service
                                           .AllAsync <IssuesListingModel>(isApproved, rowsCount, page, region.ToString(), issueType.ToString(), sortType);

            var result = issues.ToList();

            var expectedCount = await this.Db.UrbanIssues.Where(i => i.IsApproved == isApproved && i.Region == region && i.Type == issueType)
                                .Skip((page - 1) * IssuesOnRow * rowsCount)
                                .Take(IssuesOnRow).CountAsync();

            var dbIssues = this.Db.UrbanIssues.ToList();

            //Assert
            result.Should().BeOfType <List <IssuesListingModel> >();

            result.Should().HaveCount(expectedCount);

            result.Should().NotContain(i => i.IsApproved != isApproved);

            if (region != RegionType.All)
            {
                var issuesToNotContain = dbIssues.Where(x => x.Region != region);
                result.Should().NotContain(issuesToNotContain);
            }

            var issuesWithAnotherTypes = dbIssues.Where(x => x.Type != issueType).ToList();

            result.Should().NotContain(issuesWithAnotherTypes);

            if (sortType == null || sortType == SortDesc)
            {
                result.Should().BeInDescendingOrder(i => i.PublishedOn);
            }
            else
            {
                result.Should().BeInAscendingOrder(i => i.PublishedOn);
            }
        }
Beispiel #15
0
 public IssueCreated(
     TenantId tenantId1,
     IssueId issueId1,
     ProductId productId1,
     string description1,
     string summary1,
     IssueType issueType)
 {
     // TODO: Complete member initialization
         this.tenantId = tenantId1.ToString();
         this.issueId = issueId1.ToString();
         this.productId = productId1.ToString();
         this.description = description1.ToString();
         this.summary = summary1.ToString();
         this.issueType = issueType.ToString();
 }
Beispiel #16
0
 public static string ToVsts(this IssueType issueType)
 {
     return(IssueType.Map(issueType.ToString()));
 }
 public static string ToString(IssueType value)
 {
     if( value==IssueType.Invalid )
         return "invalid";
     else if( value==IssueType.Structure )
         return "structure";
     else if( value==IssueType.Required )
         return "required";
     else if( value==IssueType.Value )
         return "value";
     else if( value==IssueType.Invariant )
         return "invariant";
     else if( value==IssueType.Security )
         return "security";
     else if( value==IssueType.Login )
         return "login";
     else if( value==IssueType.Unknown )
         return "unknown";
     else if( value==IssueType.Expired )
         return "expired";
     else if( value==IssueType.Forbidden )
         return "forbidden";
     else if( value==IssueType.Processing )
         return "processing";
     else if( value==IssueType.NotSupported )
         return "not-supported";
     else if( value==IssueType.Duplicate )
         return "duplicate";
     else if( value==IssueType.NotFound )
         return "not-found";
     else if( value==IssueType.TooLong )
         return "too-long";
     else if( value==IssueType.CodeUnknown )
         return "code-unknown";
     else if( value==IssueType.Extension )
         return "extension";
     else if( value==IssueType.TooCostly )
         return "too-costly";
     else if( value==IssueType.BusinessRule )
         return "business-rule";
     else if( value==IssueType.Conflict )
         return "conflict";
     else if( value==IssueType.Transient )
         return "transient";
     else if( value==IssueType.LockError )
         return "lock-error";
     else if( value==IssueType.NoStore )
         return "no-store";
     else if( value==IssueType.Exception )
         return "exception";
     else if( value==IssueType.Timeout )
         return "timeout";
     else if( value==IssueType.Throttled )
         return "throttled";
     else
         throw new ArgumentException("Unrecognized IssueType value: " + value.ToString());
 }