Ejemplo n.º 1
0
        public MainPageViewModel(
            [Import(typeof(IClientModel))] IClientModel clientModel,
            [Import(typeof(ISystemModel))] ISystemModel systemModel,
            [Import(typeof(IGlobals))] IGlobals globals)
        {
            _clientModel = clientModel;
            _systemModel = systemModel;
            _globals     = globals;

            this.LoginBoxVisibility       = true;
            this.UserDetailsBoxVisibility = false;
            this.ErrorMessageVisibility   = false;

            LoginCommand = new RelayCommand(LoginCommandAction);

            this.UserName = "******";

            this.MenuItemCommand = new RelayCommand <SYStblMenu>((menuItemClicked) =>
            {
                switch (menuItemClicked.Action)
                {
                case "VIEW":
                    this.NavigateView(menuItemClicked.ActionObject, menuItemClicked.Name);
                    break;

                case "DIALOG":
                    break;

                default:
                    throw new Exception(string.Format("Don't know what to do with the navigation action {0} ", menuItemClicked.Action));
                }
            });
        }
        public MainPageViewModel(
            [Import(typeof(IClientModel))] IClientModel clientModel, 
            [Import(typeof(ISystemModel))] ISystemModel systemModel, 
            [Import(typeof(IGlobals))] IGlobals globals) 
        {
            _clientModel = clientModel;
            _systemModel = systemModel;
            _globals = globals;

            this.LoginBoxVisibility = true;
            this.UserDetailsBoxVisibility = false;
            this.ErrorMessageVisibility = false;

            LoginCommand = new RelayCommand(LoginCommandAction);

            this.UserName = "******";

            this.MenuItemCommand = new RelayCommand<SYStblMenu>((menuItemClicked) =>
            {
                switch (menuItemClicked.Action)
                {
                    case "VIEW":
                        this.NavigateView(menuItemClicked.ActionObject, menuItemClicked.Name);
                        break;
                    case "DIALOG":
                        break;
                    default:
                        throw new Exception(string.Format("Don't know what to do with the navigation action {0} ", menuItemClicked.Action));
                }
            });
        }
Ejemplo n.º 3
0
 public LuaCompiler(string code, IExecutionProperties execProps, ICompilerProperties compProps,
                    IGlobals globals = null)
 {
     SourceCode         = code;
     ExecuteProperties  = execProps;
     CompilerProperties = compProps;
     Globals            = globals;
 }
Ejemplo n.º 4
0
 public PyCompiler(string code, IExecutionProperties eProps, ICompilerProperties cProps,
                   string libSearchPath = null, IGlobals globals = null)
 {
     SourceCode         = code;
     CompilerProperties = cProps;
     ExecuteProperties  = eProps;
     LibSearchPath      = libSearchPath;
     Globals            = globals;
 }
Ejemplo n.º 5
0
 public Properties(Language language, string code,
                   string[] imports             = null,
                   string jdkPath               = null,
                   string pyPath                = null,
                   IExecutionProperties exProps = null,
                   ICompilerProperties comProps = null,
                   IGlobals globals             = null)
 {
     Language           = language;
     Code               = code;
     Imports            = imports;
     JdkPath            = jdkPath;
     PySearchPath       = pyPath;
     ExecuteProperties  = exProps;
     CompilerProperties = comProps;
     Globals            = globals;
 }
Ejemplo n.º 6
0
        public static async ValueTask <object> RunQueryAsync <T>(string linQuery, IGlobals <T> globals)
        {
            ScriptOptions scriptOptions = ScriptOptions.Default;

            scriptOptions = scriptOptions.AddReferences("System");
            scriptOptions = scriptOptions.AddReferences("System.Linq");
            scriptOptions = scriptOptions.AddReferences("System.Collections.Generic");

            var state = await CSharpScript.RunAsync($@"
                using System;
                using System.Linq;
                using System.Collections.Generic;
                
                return DataSource.{linQuery ?? "ToList()"};", scriptOptions, globals);

            return(state.ReturnValue);
        }
Ejemplo n.º 7
0
        public CSharpCompiler(string code, IExecutionProperties execProps, ICompilerProperties compProps,
                              string[] imports = null, IGlobals globals = null)
        {
            SourceCode         = code;
            ExecuteProperties  = execProps;
            CompilerProperties = compProps;
            if (imports == null || !imports.Any())
            {
                LoadReferences();
            }
            else
            {
                Imports = imports;
            }

            Globals = globals ?? new Globals(new StringBuilder());
            Create();
        }
 public SystemModel([Import(typeof(IGlobals))] IGlobals globals)
 {
     _globals = globals;
 }
Ejemplo n.º 9
0
 public PyCompiler(string code, string libSearchPath = null, IGlobals globals = null) : this(code,
                                                                                             new ExecutionProperties(), new CompilerProperties(), libSearchPath, globals)
 {
 }
Ejemplo n.º 10
0
 public SystemModel([Import(typeof(IGlobals))] IGlobals globals)
 {
     _globals = globals;
 }
 public ClientModel([Import(typeof(IGlobals))] IGlobals globals) 
 {
     _globals = globals;
 }
Ejemplo n.º 12
0
 public ClientModel([Import(typeof(IGlobals))] IGlobals globals)
 {
     _globals = globals;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Sets the current globals provider.
 /// </summary>
 /// <param name="globals"></param>
 public static void SetGlobals(IGlobals globals)
 {
     current = globals;
 }