Beispiel #1
0
            public void load(string file)
            {
                int i = 0;

                vars.length = 0;
                try{
                    string [] ss = File.ReadAllLines(file);
                    for (i = 0; i < ss.Length; i++)
                    {
                        arguments argss = new arguments(ss[i], '=');
                        vars.setvar((argss.argumentss.txt[0].Trim()).ToUpper(), argss.argumentss.texts[1]);
                    }
                }catch {
                }
            }
        private static arguments GetArguments(string[] args)
        {
            arguments commandLine = new arguments();

            commandLine.IncludeUpdatesWithRebootRequire = false;
            commandLine.SearchString          = "IsInstalled=0 And IsHidden=0 And Type='Software'";
            commandLine.CancelIfRebootRequire = true;

            if (args != null && args.Length != 0)
            {
                foreach (string arg in args)
                {
                    string currentArg = string.Empty;
                    if (arg.Contains("="))
                    {
                        currentArg = arg.Substring(0, arg.IndexOf('=') + 1).ToLower();
                    }
                    switch (currentArg)
                    {
                    case "searchstring=":
                        commandLine.SearchString = arg.Substring(arg.IndexOf('=') + 1);
                        break;

                    case "includeupdateswithrebootrequire=":
                        if (arg.Substring(arg.IndexOf('=') + 1).ToLower() == "true")
                        {
                            commandLine.IncludeUpdatesWithRebootRequire = true;
                        }
                        break;

                    case "cancelifrebootrequire=":
                        if (arg.Substring(arg.IndexOf('=') + 1).ToLower() == "false")
                        {
                            commandLine.CancelIfRebootRequire = false;
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
            return(commandLine);
        }
        static void Main(string[] args)
        {
            Logger.Initialize(@"C:\Windows\", "InstallPendingUpdates.log", Logger.Destination.File);
            Logger.Write("===========================================================================================================");
            Logger.Write("Starting with " + args.Length + " arguments.");
            for (int i = 0; i < args.Length; i++)
            {
                Logger.Write("Arguments N° " + i + " : " + args[i]);
            }
            _arguments = GetArguments(args);
            Logger.Write(_arguments.SearchString);
            Logger.Write(_arguments.IncludeUpdatesWithRebootRequire.ToString());
            Logger.Write(_arguments.CancelIfRebootRequire.ToString());

            if (!_arguments.CancelIfRebootRequire || !IsRebootRequireBeforeInstallation())
            {
                UpdateCollection pendingUpdates = SearchUpdates();
                InstallUpdates(pendingUpdates);
                System.Threading.Thread.Sleep(3000);
                ReportNow();
            }
            Logger.Write("End of InstallPendingUpdates.");
        }
Beispiel #4
0
 => new RemoteDesignerAttributeDiscoveryService(arguments, callback);
 ) => new RemoteProjectTelemetryService(arguments, callback);
 => new RemoteSymbolFinderService(arguments, callback);
Beispiel #7
0
            internal FunctionDef(FunctionDefinition def)
                : this() {
                _name = def.Name;
                _args = new arguments(def.Parameters);
                _body = ConvertStatements(def.Body);

                if (def.Decorators != null) {
                    _decorators = PythonOps.MakeEmptyList(def.Decorators.Count);
                    foreach (Compiler.Ast.Expression expr in def.Decorators)
                        _decorators.Add(Convert(expr));
                } else
                    _decorators = PythonOps.MakeEmptyList(0);
            }
 ) => new RemoteMissingImportDiscoveryService(arguments, callback);
Beispiel #9
0
            internal Lambda(LambdaExpression lambda)
                : this()
            {
                FunctionDef def = (FunctionDef)Convert(lambda.Function);
                _args = def.args;
                Debug.Assert(def.body.Count == 1, "LambdaExpression body should be one statement.");
                stmt statement = (stmt)def.body[0];
                if (statement is Return)
                    _body = ((Return)statement).value;
                else if (statement is Expr) {
                    // What should be sufficient is:
                    // _body = ((Expr)statement).value;
                    // but, AST comes with trees containing twice YieldExpression.
                    // For:
                    //   lamba x: (yield x)
                    // it comes back with:
                    //
                    //IronPython.Compiler.Ast.LambdaExpression
                    //IronPython.Compiler.Ast.FunctionDefinition<lambda$334>generator
                    //  IronPython.Compiler.Ast.Parameter  x
                    //  IronPython.Compiler.Ast.ExpressionStatement
                    //    IronPython.Compiler.Ast.YieldExpression     <<<<<<<<
                    //      IronPython.Compiler.Ast.YieldExpression   <<<<<<<< why twice?
                    //        IronPython.Compiler.Ast.NameExpression x

                    _body = ((Yield)((Expr)statement).value).value;
                }  else
                    throw PythonOps.TypeError("Unexpected statement type: {0}, expected Return or Expr", statement.GetType());
            }
Beispiel #10
0
 => new RemoteEncapsulateFieldService(arguments, callback);
Beispiel #11
0
 => new RemoteTodoCommentsDiscoveryService(arguments, callback);
Beispiel #12
0
 => new RemoteConvertTupleToStructCodeRefactoringService(arguments, callback);
Beispiel #13
0
 => RunAsync(arguments, TimeSpan.FromSeconds(10));
Beispiel #14
0
 public FunctionDef(string name, arguments args, PythonList body, PythonList decorators,
     [Optional]int? lineno, [Optional]int? col_offset)
     : this()
 {
     _name = name;
     _args = args;
     _body = body;
     _decorators = decorators;
     _lineno = lineno;
     _col_offset = col_offset;
 }
Beispiel #15
0
        static void Main(string[] args)
        {
            arguments argss = new arguments("hello world hi there -12.8", ' ');

            argss.report();
        }
Beispiel #16
0
 public Lambda(arguments args, expr body, [Optional]int? lineno, [Optional]int? col_offset)
     : this()
 {
     _args = args;
     _body = body;
     _lineno = lineno;
     _col_offset = col_offset;
 }
Beispiel #17
0
 => new RemoteSymbolSearchUpdateService(arguments, callback);
 => new RemoteEditAndContinueService(arguments, callback);
 => new RemoteNavigateToSearchService(arguments, callback);
Beispiel #20
0
 => new RemoteRenamerService(arguments, callback);
Beispiel #21
0
 ) => new RemoteFindUsagesService(arguments, callback);
Beispiel #22
0
 internal Lambda(LambdaExpression lambda)
     : this() {
     FunctionDef def = (FunctionDef)Convert(lambda.Function);
     _args = def.args;
     Debug.Assert(def.body.Count == 1, "LambdaExpression body should be one Return statement.");
     _body = ((Return)def.body[0]).value;
 }
Beispiel #23
0
 => new RemoteTodoCommentsService(arguments, callback);
 BracketedArgumentList
 (
     arguments: indices !.ToSyntaxList()
 public static void IABMethod1(this IABInterface aOrBObject, arguments args)
 {
     //This will be available for any A or B object without duplicating any code
 }