Ejemplo n.º 1
0
        public TestCaller()
        {
            string temp = "Hello";

            Dict = new Dictionary <string, Action <CallModel, object> >();
            Type type = typeof(CallModel);

            CallerManagement.AddType(type);
            DictHandler      = DictOperator.CreateFromType(type);
            FuzzyDictHandler = FuzzyDictOperator.CreateFromType(type);
            HashDictHandler  = HashDictOperator.CreateFromType(type);
            LinkHandler      = LinkOperator.CreateFromType(type);
            FuzzyLinkHandler = FuzzyLinkOperator.CreateFromType(type);
            HashLinkHandler  = HashLinkOperator.CreateFromType(type);
            Model            = new CallModel();
            Dynamic          = new CallModel();
            DictModel        = new CallModel();
            DictHandler.New();
            FuzzyDictHandler.New();
            HashDictHandler.New();
            LinkHandler.New();
            FuzzyLinkHandler.New();
            HashLinkHandler.New();
            Dict["Name"] = NDelegate.DefaultDomain().Action <CallModel, object>("arg1.Name=(string)arg2;");
        }
Ejemplo n.º 2
0
 public TestCaller()
 {
     NatashaInitializer.InitializeAndPreheating();
     string temp = "Hello";
     Dict = new Dictionary<string, Action<CallModel, object>>();
     Type type = typeof(CallModel);
     PrecisionDict = PrecisionDictOperator.CreateFromType(type);
     FuzzyDict = FuzzyDictOperator.CreateFromType(type);
     HashDict = HashDictOperator.CreateFromType(type);
     //LinkHandler = LinkOperator.CreateFromType(type);
     //FuzzyLinkHandler = FuzzyLinkOperator.CreateFromType(type);
     //HashLinkHandler = HashLinkOperator.CreateFromType(type);
     Model = new CallModel();
     Dynamic = new CallModel();
     DictModel = new CallModel();
     PrecisionDict.New();
     FuzzyDict.New();
     HashDict.New();
     Dict["Name"] = NDelegate.DefaultDomain().Action<CallModel, object>("arg1.Name=(string)arg2;");
     for (int i = 0; i < 3000; i++)
     {
         Model.Name = "Hello";
         Dynamic.Name = "Hello";
         Dict["Name"](DictModel, "Hello");
         PrecisionDict.Set("Name", "Hello");
     }
 }
Ejemplo n.º 3
0
        public FutureInstanceVisitor(DictBase handler, Type sourceType, AlgorithmKind kind, bool repeatable,
                                     IDictionary <string, object> initialValues = null, bool liteMode = false, bool strictMode = false)
        {
            _handler       = handler ?? throw new ArgumentNullException(nameof(handler));
            _sourceType    = sourceType ?? throw new ArgumentNullException(nameof(sourceType));
            _algorithmKind = kind;

            _handler.New();
            NormalHistoricalContext = repeatable
                ? new HistoricalContext(sourceType, kind)
                : null;
            LiteMode = liteMode;

            _lazyMemberHandler = MemberHandler.Lazy(() => new MemberHandler(_handler, _sourceType), liteMode);
            _validationContext = strictMode
                ? new CorrectContext(this, true)
                : null;

            if (initialValues != null)
            {
                SetValue(initialValues);
            }
        }