SobaScript.Z.VS/OwpComponent.cs
/// <summary>
/// To send data into OutputWindowPane window.
///     `item("name").write(true): content`
///     `item("name").writeLine(true): content`
/// </summary>
/// <param name="name"></param>
/// <param name="newline">Flag of new line symbol</param>
/// <param name="pm"></param>
/// <returns></returns>
To send data into OutputWindowPane window.
To send data into OutputWindowPane window .
[Method("write",
                "Writes data into selected pane.",
                "item",
                nameof(StItem),
                new[] { "force", "In" },
                new[] { "Creates selected item if it does not exist for true value.", "Content" },
                CValType.Void,
                CValType.Boolean, CValType.Input)]
        [Method("writeLine",
                "Writes data with the newline char into selected pane.",
                "item",
                nameof(StItem),
                new[] { "force", "In" },
                new[] { "Creates selected item if it does not exist for true value.", "Content" },
                CValType.Void,
                CValType.Boolean, CValType.Input)]
        protected string StItemWrite(string name, bool newline, IPM pm)
        {
            if(!pm.IsMethodWithArgs("write", ArgumentType.Boolean) 
                && !pm.IsMethodWithArgs("writeLine", ArgumentType.Boolean))
            {
                throw new IncorrectNodeException(pm);
            }
            bool createIfNo = (bool)pm.FirstLevel.Args[0].data;
            if(pm.Levels[1].Type != LevelType.RightOperandColon) {
                throw new IncorrectNodeException(pm);
            }
            string content = pm.Levels[1].Data;
            env.Write(content, newline, name, createIfNo);
            return Value.Empty;
        }
[ Method ( " " , " " , " " , nameof ( StItem ) , new [ ] { " " , " " } , new [ ] { " " , " " } , CValType . Void , CValType . Boolean , CValType . Input ) ] [ Method ( " " , " " , " " , nameof ( StItem ) , new [ ] { " " , " " } , new [ ] { " " , " " } , CValType . Void , CValType . Boolean , CValType . Input ) ] protected string StItemWrite ( string name , bool newline , IPM pm ) { if ( ! pm . IsMethodWithArgs ( " " , ArgumentType . Boolean ) && ! pm . IsMethodWithArgs ( " " , ArgumentType . Boolean ) ) { throw new IncorrectNodeException ( pm ) ; } bool createIfNo = ( bool ) pm . FirstLevel . Args [ 0 ] . data ; if ( pm . Levels [ 1 ] . Type != LevelType . RightOperandColon ) { throw new IncorrectNodeException ( pm ) ; } string content = pm . Levels [ 1 ] . Data ; env . Write ( content , newline , name , createIfNo ) ; return Value . Empty ; }
To send data into OutputWindowPane window.
To send data into OutputWindowPane window .
None
name
string
None
newline
bool
Flag of new line symbol
Flag of new line symbol
pm
IPM
None