Ejemplo n.º 1
0
        public IScriptCommand SyncWithCloudCommand(Network network)
        {
            var commandName = _engine.CommandLibrary.GetCommandFromType(typeof (SyncWithCloud)).BlankCommandCall().OriginalText;
            var parameters = " Network=\"" + network.Address + "\"";

            var result = new TextScriptCommand(commandName + parameters);

            return result;
        }
Ejemplo n.º 2
0
        public static IEnumerable <IScriptCommand> FromLines(string text)
        {
            var    reader = new StringReader(text);
            string line;

            while ((line = reader.ReadLine()) != null)
            {
                line = line.TrimStart();
                if (line.Any())
                {
                    var result = new TextScriptCommand(line);
                    yield return(result);
                }
            }
        }
Ejemplo n.º 3
0
        public void Add(string text)
        {
            try
            {
                var nodes       = Common.GetXml(text);
                var newCommands = XmlScriptCommand.FromNodes(nodes);
                Add(newCommands);
            }
            catch (RoomieScriptSyntaxErrorException)
            {
                //TODO: This is not the best way to detect the script format >.<

                var newCommands = TextScriptCommand.FromLines(text);
                Add(newCommands);
            }
        }
Ejemplo n.º 4
0
 public static IEnumerable<IScriptCommand> FromLines(string text)
 {
     var reader = new StringReader(text);
     string line;
     while ((line = reader.ReadLine()) != null)
     {
         line = line.TrimStart();
         if (line.Any())
         {
             var result = new TextScriptCommand(line);
             yield return result;
         }
     }
 }