private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     _manager = new SymbolManager();
     Partitioner.ViewerFocusChanged += new REvolution.Editor.FragmentViewer.ViewerFocusChangedHandler(Partitioner_ViewerFocusChanged);
     Partitioner.Initialize(_manager);
     Editor.Visualize += new REvolution.Editor.SymbolEditor.VisualizeHanlder(Editor_Visualize);
 }
Exemple #2
0
        public void OnStyleLoaded(Style p0)
        {
            symbolManager = new SymbolManager(mapView, mapbox, p0);
            Com.Mapbox.Geojson.Point point = Com.Mapbox.Geojson.Point.FromLngLat(105.505, 21.033);
            mapbox.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(point.Latitude(), point.Longitude()), 8));

            var options = new SymbolOptions();

            options.WithIconImage("fire-station-11");
            options.WithGeometry(point);
            options.WithIconSize(new Float(2f))
            .WithDraggable(true);

            var symbol = symbolManager.Create(options);

            Com.Mapbox.Geojson.Point point2 = Com.Mapbox.Geojson.Point.FromLngLat(25.8672299, 85.1720807);
            var options2 = new SymbolOptions()
                           .WithIconImage("fire-station-11")
                           .WithGeometry(point2)
                           .WithIconSize(new Float(2f))
                           .WithDraggable(true);

            var symbol2 = symbolManager.Create(options2);

            symbolManager.AddClickListener(this);
        }
Exemple #3
0
        public override void OnProcessHit(HitInfo info)
        {
            base.OnProcessHit(info);
            string n = info.hitSymbol.name;

            if (n == "A" || n == "B")
            {
                SymbolManager sm    = slot.symbolManager;
                Symbol        _from = sm.GetSymbol(n);
                Symbol        _to   = sm.GetSymbol(n == "A" ? "B" : "A");
                sm.ApplySymbolMap(null, new SymbolSwapper {
                    from = _from, to = _to
                });
                foreach (SymbolHolder holder in info.hitHolders)
                {
                    holder.animator.SetTrigger("OnSwap");
                }
            }
            else
            {
                if (info.hitSymbol.animator)
                {
                    foreach (SymbolHolder holder in info.hitHolders)
                    {
                        holder.animator.SetTrigger("OnHit");
                    }
                }
            }
        }
Exemple #4
0
        public async Task Controller_GetByQuery()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleController(User, new ExampleModule(Context), smanager);
            var sym        = await PostTestSymbol(new Symbols.SymbolController(smanager, User));

            await PostTestExample(sym);

            var res = controller.Get(new ExampleController.ExampleQuery()
            {
                SymbolId = 1
            }) as JsonResult;
            var obj = res.Value as IEnumerable <Models.Output.Examples.Example>;

            Assert.AreEqual(1, obj.Count());
            Assert.AreEqual("This is a test example", obj.First().Description);
            res = controller.Get(new ExampleController.ExampleQuery()
            {
                Token = "test"
            }) as JsonResult;
            obj = res.Value as IEnumerable <Models.Output.Examples.Example>;
            Assert.AreEqual(1, obj.Count());
            Assert.AreEqual("This is a test example", obj.First().Description);
        }
Exemple #5
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //

            // Get configuration for environment

            // Get startup path
            path = Directory.GetCurrentDirectory() + @"\";

            // Create http manager object
            httpManager = new HttpManager();

            // Get configuration
            this.GetConfig();

            // Initialize SymbolManager
            symbolManager = new SymbolManager();

            // Initialize plugins services
            dataServices     = new DataServices();
            graphicsServices = new GraphicsServices();

            // Get data and plugin's instances
            if (Directory.Exists(path + "Data"))
            {
                this.GetSymbols();
                this.DisplaySymbols();
            }
            else
            {
                Directory.CreateDirectory(path + "Data");
            }

            if (Directory.Exists(path + "Plugins"))
            {
                this.GetDataSources();
                this.GetTools();
            }
            else
            {
                Directory.CreateDirectory(path + @"Plugins");
            }

            // Check if directory Plugins\Config exists

            if (!Directory.Exists(path + @"Plugins\Config"))
            {
                Directory.CreateDirectory(path + @"Plugins\Config");
            }
        }
Exemple #6
0
        public override void OnActivated()
        {
            base.OnActivated();
            SymbolManager sm    = slot.symbolManager;
            Symbol        _from = sm.GetSymbol("A");

            _from.matchType = Symbol.MatchType.Scatter;
        }
 public PreviewForwardInfo(SymbolManager sm, List <int> path, Transform target, int myIndex, Action place, Action unplace)
 {
     this.sm      = sm;
     this.path    = path;
     this.target  = target;
     my_index     = myIndex;
     this.place   = place;
     this.unplace = unplace;
 }
Exemple #8
0
 /// <summary>
 /// 层次符号表的构造器
 /// </summary>
 /// <param name="tableDepth">符号表深度</param>
 /// <param name="belonging">符号表的属节点</param>
 public KagaTable(int tableDepth, KagaNode belonging)
 {
     this.depth   = tableDepth;
     this.belong  = belonging;
     this.symbols = new List <KagaVar>();
     this.prefix  = String.Format("{0}_{1}_{2}", Consta.prefix_var, this.depth, this.belong.index);
     // 把自己追加到符号表里
     this.symbolMana = SymbolManager.getInstance();
     this.symbolMana.addSymbolTable(this);
 }
        private GenericSymbol SymbolForAddress(uint aAddress, SymbolManager aSymbolManager)
        {
            System.Diagnostics.Debug.Assert(aSymbolManager != null);

            // Try and find a matching collection / symbol entry
            GenericSymbolCollection collection;
            GenericSymbol           symbol = aSymbolManager.EntryByAddress(aAddress, out collection);

            return(symbol);
        }
Exemple #10
0
 public MemAnalysisParserBase(MemAnalysisParserOptions aOptions, SymbolManager aSymbolManager)
     : base(aOptions.SourceFileName, new AsyncTextReaderPrefix(aOptions.TracePrefix))
 {
     iOptions       = aOptions;
     iSymbolManager = aSymbolManager;
     //
     if (aOptions.SpecificThreadFilter != string.Empty)
     {
         AddFilter(new SymbianUtils.AsyncTextReaderFilter(aOptions.SpecificThreadFilter));
     }
 }
 void Awake()
 {
     gm            = GameObject.Find("GameManager");
     textPoints    = GameObject.Find("TextPoints");
     cameraManager = GameObject.FindWithTag("CameraManager");
     gameSettings  = gm.GetComponent <Settings> ();
     symbolManager = GameObject.Find("SymbolManager").GetComponent <SymbolManager> ();
     sfxmg         = GameObject.FindWithTag("SFXManager").GetComponent <SFXManager> ();
     wfsfxmg       = GameObject.FindWithTag("WolfSFXManager").GetComponent <SFXManager> ();
     gameOverPanel = GameObject.Find("GameOverPanel");
     wolfPowerIcon = GameObject.FindWithTag("WolfPowerIcon");
 }
Exemple #12
0
        public async Task Controller_Get_Error_Invalid()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleRequestController(User, new ExampleModule(Context), smanager);

            await PostTestExampleRequest();

            Assert.Throws <Shared.Exceptions.InvalidResource>(() => controller.Get(new ExampleRequestController.ExampleRequestQuery()));
            Assert.Throws <Shared.Exceptions.InvalidResource>(() => controller.Get(null));
        }
Exemple #13
0
        /// <summary>
        /// Initialize the static members of this instance.
        /// </summary>
        public static void Initialize()
        {
            Options = new AsmCommandLineOptions();

            Evaluator = new Evaluator(false);

            Encoding = new AsmEncoding(false);

            Output = new Compilation();

            Symbols = new SymbolManager();

            Log = new ErrorLog();
        }
Exemple #14
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
         return;
     }
     planetUnlocker = GetComponent <PlanetUnlocker>();
     LoadSymbols();
 }
Exemple #15
0
        public async Task Controller_Post_DELETE()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleRequestController(User, new ExampleModule(Context), smanager);

            await PostTestSymbol(new Symbols.SymbolController(smanager, User));

            await controller.PostAsync(new ExampleRequestCreate()
            {
                Method  = Data.Models.Examples.ExampleRequestType.POST,
                Message = "this is a test",
                Data    = new ExampleCreate()
                {
                    SymbolId    = 1,
                    Description = "Test example",
                    Code        = new ExampleCreate.CodeLine[]
                    {
                        new ExampleCreate.CodeLine()
                        {
                            Data = "int main() {}"
                        }
                    }
                }
            });

            await Manager.ApplyRequest(1);

            var res = await controller.PostAsync(new ExampleRequestCreate()
            {
                ApplyTo = 1,
                Method  = Data.Models.Examples.ExampleRequestType.DELETE,
                Message = "Delete first example"
            }) as JsonResult;

            var obj = res.Value as Models.Output.Examples.ExampleRequest;

            Assert.AreEqual("Delete first example", obj.Message);
            Assert.AreEqual(1, obj.ApplyToId);
            Assert.IsNotNull(obj.CreationDate);
            Assert.IsNull(obj.Data);
            User.SetPermissions(new string[] { });
            Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.PostAsync(new ExampleRequestCreate()
            {
                Method = Data.Models.Examples.ExampleRequestType.DELETE
            }));
        }
Exemple #16
0
        static void Main(string[] args)
        {
            SymbolManager manager = new SymbolManager();
            //manager.RegisterSymbol("year");
            //manager.RegisterSymbol("month");
            //manager.RegisterSymbol("day");
            //manager["year"].CreateExpression().Pattern = "[0-2]\\d{3}";
            //manager["month"].CreateExpression().Pattern = "\\d|1[0-2]";
            //manager["day"].CreateExpression().Pattern = "\\d|[12]\\d|3[01]";
            //manager["day"].Default.ChangeLabel("case1");
            //manager.RegisterSymbol("date");
            //manager["date"].CreateExpression().Pattern = "(?@year/0){1,2}-(?@month/0)-(?@day/case1)";
            //Expression date_d = manager["date"].Default;
            //date_d.Parse();
            //date_d.Link();

            char   a      = '\b';
            Regex  regex  = new Regex("^((?>[a-zA-Z\\d!#$%&'*+\\-/=?^_`{|}~]+\x20*|\"((?=[\x01-\x7f])[^\"\\\\]|\\\\[\\x01-\\x7f])*\"\\x20*)*(?<angle><))?((?!\\.)(?>\\.?[a-zA-Z\\d!#$%&'*+\\-/=?^_`{|}~]+)+|\"((?=[\\x01-\\x7f])[^\"\\\\]|\\\\[\\x01-\\x7f])*\")@(((?!-)[a-zA-Z\\d\\-]+(?<!-)\\.)+[a-zA-Z]{2,}|\\[(((?(?<!\\[)\\.)(25[0-5]|2[0-4]\\d|[01]?\\d?\\d)){4}|[a-zA-Z\\d\\-]*[a-zA-Z\\d]:((?=[\\x01-\\x7f])[^\\\\[\\]]|\\\\[\\x01-\\x7f])+)\\])(?(angle)>)$");
            Symbol year   = manager.RegisterSymbol("year");
            Symbol month  = manager.RegisterSymbol("month");
            Symbol day    = manager.RegisterSymbol("day");
            Symbol hour   = manager.RegisterSymbol("hour");
            Symbol minute = manager.RegisterSymbol("minute");
            Symbol second = manager.RegisterSymbol("second");

            year.CreateExpression().Pattern   = "(?:[1-9][0-9]*)?[0-9]{4}";
            month.CreateExpression().Pattern  = "1[0-2]|0[1-9]";
            day.CreateExpression().Pattern    = "3[0-1]|0[1-9]|[1-2][0-9]";
            hour.CreateExpression().Pattern   = "2[0-3]|[0-1][0-9]";
            minute.CreateExpression().Pattern = "[0-5][0-9]";
            second.CreateExpression().Pattern = "([0-5][0-9])(\\.[0-9]+)?";

            Symbol date = manager.RegisterSymbol("date");
            Symbol time = manager.RegisterSymbol("time");

            date.CreateExpression().Pattern = "(?@year)-(?@month)-(?@day)";
            time.CreateExpression().Pattern = "(?@hour)-(?@minute)-(?@second)";

            Symbol dt = manager.RegisterSymbol("date_time");

            dt.CreateExpression().Pattern = "(?@date)T(?@time)Z";

            dt.Default.Parse();
            dt.Default.Link();
            string str = dt.Default.Generate();

            //Regex regex = new Regex(str, RegexOptions.IgnorePatternWhitespace);
            Console.Write(str);
        }
Exemple #17
0
        public async Task Controller_Patch()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleRequestController(User, new ExampleModule(Context), smanager);

            await PostTestExampleRequest();

            var res = await controller.PatchAsync(1, new ExampleRequestUpdate()
            {
                Message = "test",
                Data    = new ExampleUpdate()
                {
                    Description = "This is a test",
                    Code        = new ExampleUpdate.CodeLine[]
                    {
                        new ExampleUpdate.CodeLine()
                        {
                            Data    = "int main()",
                            Comment = "Useless function"
                        },
                        new ExampleUpdate.CodeLine()
                        {
                            Data = "{"
                        },
                        new ExampleUpdate.CodeLine()
                        {
                            Data = "}"
                        }
                    }
                }
            }) as JsonResult;

            var obj = res.Value as Models.Output.Examples.ExampleRequest;

            Assert.AreEqual("test", obj.Message);
            Assert.AreEqual(1, obj.Data.SymbolId);
            Assert.AreEqual("This is a test", obj.Data.Description);
            Assert.AreEqual("int main()", obj.Data.Code[0].Data);
            Assert.AreEqual("Useless function", obj.Data.Code[0].Comment);
            User.SetPermissions(new string[] { });
            User.User.Id = "45sq6d46qsd";
            Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.PatchAsync(1, new ExampleRequestUpdate()
            {
                Message = "test"
            }));
        }
    private void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
        }

        instance = this;
        DontDestroyOnLoad(this.gameObject);

        for (int i = 0; i < InsertAnimations.Length; i++)
        {
            animations[InsertAnimationsOrdinals[i]] = InsertAnimations[i];
        }
    }
Exemple #19
0
    void UnPlace()
    {
        var           pos   = transform.position;
        List <int>    index = GetComponent <LayoutTracker>().index;
        SymbolManager sm    = GetComponentInParent <SymbolManager>();
        SpawnTarget   sp    = GetComponentInParent <SpawnTarget>();
        var           lt    = sm.RemoveAtAndReturn(index.Skip(1).ToList(), sm.GetComponentInChildren <LayoutTracker>());

        lt.transform.SetParent(GetComponentInParent <Canvas>().transform, true);
        lt.transform.SetAsLastSibling();
        lt.enabled         = false;
        transform.position = pos;
        LayoutRebuilder.MarkLayoutForRebuild(sm.GetComponent <RectTransform>());
        sp?.CheckSuccess();
    }
Exemple #20
0
        public FormCommonTools(MainForm _parent)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //

            parent = _parent;

            symbolManager = new SymbolManager();
        }
Exemple #21
0
        /// <summary>
        /// Initialize the static members of this instance. The specified args
        /// passed will re-initialize the common Options object.
        /// </summary>
        /// <param name="args">The commandline arguments.</param>
        public static void Initialize(string[] args)
        {
            Options = new AsmCommandLineOptions();

            Options.ParseArgs(args);

            Evaluator = new Evaluator(Options.CaseSensitive);

            Encoding = new AsmEncoding(Options.CaseSensitive);

            Output = new Compilation();

            Symbols = new SymbolManager();

            Log = new ErrorLog();
        }
        public void Initialize(SymbolManager manager)
        {
            _manager = manager;
            FragmentUnit unit = new FragmentUnit(this);
            TextBox      box  = unit.SetText("");

            box.Text   = "<Please input your sample>";
            unit.Label = "Symbol" + _index++;
            Symbol symbol = _manager.RegisterSymbol(unit.Label);

            symbol.CreateExpression();
            unit.Symbol  = symbol;
            Layout.Child = unit;
            //Layout.Children.Add(unit);
            SetFocus(null, unit);
        }
Exemple #23
0
        public async Task Controller_Delete()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleController(User, new ExampleModule(Context), smanager);
            var sym        = await PostTestSymbol(new Symbols.SymbolController(smanager, User));

            await PostTestExample(sym);

            await controller.DeleteAsync(1);

            Assert.AreEqual(0, Context.Examples.Count());
            User.SetPermissions(new string[] { });
            Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.DeleteAsync(1));
        }
Exemple #24
0
        public void CreateRandomSymbol_Should_Return_Symbol_AssignableFrom_ISymbol()
        {
            var symbolManager = new SymbolManager(random.Object, writer.Object);

            random.Setup(r => r.NextDouble()).Returns(0.1);

            var slotData = new List <ISymbol>()
            {
                { new Apple() },
                { new Banana() },
                { new Pineapple() },
                { new Wildcard() }
            };

            var result = symbolManager.CreateRandomSymbol(slotData);

            Assert.IsAssignableFrom <ISymbol>(result);
        }
Exemple #25
0
        public void CreateRandomSymbol_Should_Return_Correct_SymbolType()
        {
            var symbolManager = new SymbolManager(random.Object, writer.Object);

            random.Setup(r => r.NextDouble()).Returns(0.1);

            var slotData = new List <ISymbol>()
            {
                { new Apple() },
                { new Banana() },
                { new Pineapple() },
                { new Wildcard() }
            };

            var result = symbolManager.CreateRandomSymbol(slotData);

            Assert.True(result.Type == SymbolType.Apple);
        }
Exemple #26
0
        public async Task Controller_GetById()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleController(User, new ExampleModule(Context), smanager);
            var sym        = await PostTestSymbol(new Symbols.SymbolController(smanager, User));

            await PostTestExample(sym);

            var res = await controller.GetAsync(1) as JsonResult;

            var obj = res.Value as Models.Output.Examples.Example;

            Assert.AreEqual(1, obj.Id);
            Assert.AreEqual("This is a test example", obj.Description);
        }
Exemple #27
0
        public async Task Controller_GetByQuery()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleRequestController(User, new ExampleModule(Context), smanager);

            await PostTestExampleRequest();

            var res = controller.Get(new ExampleRequestController.ExampleRequestQuery()
            {
                SymbolId = 1
            }) as JsonResult;
            var obj = res.Value as PageResult <Models.Output.Examples.ExampleRequest>;

            Assert.IsFalse(obj.HasMorePages);
            Assert.AreEqual(1, obj.Count);
            Assert.AreEqual(1, obj.Page);
            Assert.AreEqual("This is a test", obj.Data.First().Message);
            var res1 = controller.Get(new ExampleRequestController.ExampleRequestQuery()
            {
                PageOptions = new PageOptions()
                {
                    Count = 1,
                    Page  = 1
                }
            }) as JsonResult;
            var obj1 = res1.Value as PageResult <Models.Output.Examples.ExampleRequest>;

            Assert.IsFalse(obj.HasMorePages);
            Assert.AreEqual(1, obj.Count);
            Assert.AreEqual(1, obj.Page);
            Assert.AreEqual("This is a test", obj.Data.First().Message);
            User.SetPermissions(new string[] { });
            Assert.Throws <Shared.Exceptions.InsuficientPermission>(() => controller.Get(new ExampleRequestController.ExampleRequestQuery()
            {
                PageOptions = new PageOptions()
                {
                    Count = 1,
                    Page  = 1
                }
            }));
        }
        void AddAnnotations(IList <NxAnnotation> annotations)
        {
            if (map == null || annotations == null || annotations.Count == 0)
            {
                return;
            }

            for (int i = 0; i < annotations.Count; i++)
            {
                switch (annotations[i])
                {
                case SymbolAnnotation symbolAnnotation:
                {
                    if (symbolManager == null)
                    {
                        symbolManager = new SymbolManager(fragment.MapView, map, mapStyle);

                        // TODO Provide values from Forms
                        symbolManager.IconAllowOverlap = Boolean.True;
                        symbolManager.TextAllowOverlap = Boolean.True;
                        symbolManager.AddClickListener(this);
                    }

                    if (symbolAnnotation.IconImage?.Source != null)
                    {
                        AddStyleImage(symbolAnnotation.IconImage);
                    }

                    var symbolOptions = symbolAnnotation.ToSymbolOptions();
                    var symbol        = Android.Runtime.Extensions.JavaCast <Symbol>(symbolManager.Create(symbolOptions));
                    symbolOptions?.Dispose();
                    symbolAnnotation.Id = symbol.Id.ToString();
                    symbol?.Dispose();
                }
                break;

                case CircleAnnotation circleAnnotation:
                {
                    // TODO Handle other type of annotation
                }
                break;
                }
            }
        }
Exemple #29
0
        public async Task Controller_GetById()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleRequestController(User, new ExampleModule(Context), smanager);

            await PostTestExampleRequest();

            var res = await controller.GetAsync(1) as JsonResult;

            var obj = res.Value as Models.Output.Examples.ExampleRequest;

            Assert.AreEqual("This is a test", obj.Message);
            User.SetPermissions(new string[] { });
            User.User.Id = "45sq6d46qsd";
            Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.GetAsync(1));
        }
    // Use this for initialization
    void Start()
    {
        symbolController   = SymbolManager.instance;
        locationController = LocationController.instance;
        uiController       = UIController.instance;

        /*
         * WebCamTexture webcamTexture = new WebCamTexture();
         * cameraRender.texture = webcamTexture;
         * cameraRender.material.mainTexture = webcamTexture;
         * webcamTexture.Play();
         */
        /*
         * locationController.currentLocation.latitude = 39.913399f;
         * locationController.currentLocation.longitude = 32.834782f;
         * locationController.currentLocation.altitude = 0.0f;
         */

        InvokeRepeating("LocateUserLocation", 0, 5);
    }
Exemple #31
0
 public void Awake()
 {
     if (instance == null) {
         instance = this;
     }
 }