SobaScript.Z.VS/BuildComponent.cs
/// <summary>
/// Work with ProjectsMap of solution node.
/// </summary>
/// <param name="sln"></param>
/// <param name="pm"></param>
/// <returns></returns>
Work with ProjectsMap of solution node.
Work with ProjectsMap of solution node .
[Property("First", "First project in Project Build Order.", "", nameof(StSolution)), Property("", "First", nameof(StSlnPMap))]
        [Property("Last", "Last project in Project Build Order.", "", nameof(StSolution)), Property("", "Last", nameof(StSlnPMap))]
        [Property("FirstRaw", "First project from defined list.\nIgnores used Build type.", "", nameof(StSolution)), Property("", "FirstRaw", nameof(StSlnPMap))]
        [Property("LastRaw", "Last project from defined list.\nIgnores used Build type.", "", nameof(StSolution)), Property("", "LastRaw", nameof(StSlnPMap))]
        [Property("GuidList", "Get list of project Guids.\nIn direct order of definition.", "", nameof(StSolution), CValType.List)]
        [Method("projectBy",
                "Get project by Guid string.",
                "",
                nameof(StSolution),
                new[] { "guid" },
                new[] { "Identifier of project." },
                CValType.Void,
                CValType.String), Property("", "projectBy", nameof(StSlnPMap))]
        protected string StSlnPMap(string sln, IPM pm)
        {
            if(string.IsNullOrWhiteSpace(sln)) {
                throw new ArgumentException($"Failed {nameof(StSlnPMap)}: sln is empty");
            }
            ProjectsMap map = GetProjectsMap(sln);
            if(pm.Is(LevelType.Property, "First")) {
                return UseProjectsMap(map.FirstBy(env.IsCleanOperation), pm.PinTo(1));
            }
            if(pm.Is(LevelType.Property, "Last")) {
                return UseProjectsMap(map.LastBy(env.IsCleanOperation), pm.PinTo(1));
            }
            if(pm.Is(LevelType.Property, "FirstRaw")) {
                return UseProjectsMap(map.First, pm.PinTo(1));
            }
            if(pm.Is(LevelType.Property, "LastRaw")) {
                return UseProjectsMap(map.Last, pm.PinTo(1));
            }
            if(pm.FinalEmptyIs(LevelType.Property, "GuidList")) {
                return Value.From(map.GuidList);
            }
            if(pm.Is(LevelType.Method, "projectBy"))
            {
                ILevel lvlPrjBy = pm.FirstLevel;
                lvlPrjBy.Is("projectBy(string guid)", ArgumentType.StringDouble);
                return UseProjectsMap(map.GetProjectBy((string)lvlPrjBy.Args[0].data), pm.PinTo(1));
            }
            throw new IncorrectNodeException(pm);
        }
[ Property ( " " , " " , " " , nameof ( StSolution ) ) , Property ( " " , " " , nameof ( StSlnPMap ) ) ] [ Property ( " " , " " , " " , nameof ( StSolution ) ) , Property ( " " , " " , nameof ( StSlnPMap ) ) ] [ Property ( " " , " \n " , " " , nameof ( StSolution ) ) , Property ( " " , " " , nameof ( StSlnPMap ) ) ] [ Property ( " " , " \n " , " " , nameof ( StSolution ) ) , Property ( " " , " " , nameof ( StSlnPMap ) ) ] [ Property ( " " , " \n " , " " , nameof ( StSolution ) , CValType . List ) ] [ Method ( " " , " " , " " , nameof ( StSolution ) , new [ ] { " " } , new [ ] { " " } , CValType . Void , CValType . String ) , Property ( " " , " " , nameof ( StSlnPMap ) ) ] protected string StSlnPMap ( string sln , IPM pm ) { if ( string . IsNullOrWhiteSpace ( sln ) ) { throw new ArgumentException ( $" Failed  { nameof ( StSlnPMap ) } : sln is empty " ) ; } ProjectsMap map = GetProjectsMap ( sln ) ; if ( pm . Is ( LevelType . Property , " " ) ) { return UseProjectsMap ( map . FirstBy ( env . IsCleanOperation ) , pm . PinTo ( 1 ) ) ; } if ( pm . Is ( LevelType . Property , " " ) ) { return UseProjectsMap ( map . LastBy ( env . IsCleanOperation ) , pm . PinTo ( 1 ) ) ; } if ( pm . Is ( LevelType . Property , " " ) ) { return UseProjectsMap ( map . First , pm . PinTo ( 1 ) ) ; } if ( pm . Is ( LevelType . Property , " " ) ) { return UseProjectsMap ( map . Last , pm . PinTo ( 1 ) ) ; } if ( pm . FinalEmptyIs ( LevelType . Property , " " ) ) { return Value . From ( map . GuidList ) ; } if ( pm . Is ( LevelType . Method , " " ) ) { ILevel lvlPrjBy = pm . FirstLevel ; lvlPrjBy . Is ( " " , ArgumentType . StringDouble ) ; return UseProjectsMap ( map . GetProjectBy ( ( string ) lvlPrjBy . Args [ 0 ] . data ) , pm . PinTo ( 1 ) ) ; } throw new IncorrectNodeException ( pm ) ; }
Work with ProjectsMap of solution node.
Work with ProjectsMap of solution node .
None
sln
string
None
pm
IPM
None