public void TestFindNamespacesInClassNames()
        {
            var names = new string[] { "myns.company.MyClass", "another.company.MyClass", "myns.company.Someclass", "myns.company.gg", "myns.company.cc", "another.company.ggggg" };
            var nss   = NameFunc.FindNamespacesInClassNames(names);

            Assert.Equal(2, nss.Length);
        }
        public void TestFindNamespacesInClassNames2()
        {
            var names = new string[] { "c1", "c3", "c9" };
            var nss   = NameFunc.FindNamespacesInClassNames(names);

            Assert.Empty(nss);
        }
예제 #3
0
 internal SimpleText(NameFunc nameFunc,Vector2 position, PosOnScreen pos, SpriteFont font, Color colorNormal, Color colorSelected, bool isDrawable = true)
     : base(CreateRectangle(position, font, nameFunc.Invoke()), pos, isDrawable)
 {
     Font = font;
     _nameFunc = nameFunc;
     ColorNormal = colorNormal;
     ColorSelected = colorSelected;
 }
예제 #4
0
 public Cell(NameFunc text, EventSelect onClick, SpriteFont font, Color colorNormal, Color colorSelected)
 {
     OnClick = onClick ?? (( a, b,c) => true);
     Text = text;
     Font = font;
     ColorNormal = colorNormal;
     ColorSelected = colorSelected;
     _oldMilliSeconds = -1;
 }
예제 #5
0
 internal MenuButton(string id, Vector2 pos, StatusMenuButton status, bool abstractPos, NameFunc text, TextureFunc image,
     RatioFunc ratioFunc, SpriteFont font, Color normal, Color selected, Event onClick, bool normalSelect = true,
     PosOnScreen posOnScreen = PosOnScreen.TopLeft, bool isDrawable = true)
     : base(new Rectangle((int)pos.X, (int)pos.Y, 0, 0),posOnScreen,isDrawable)
 {
     Id = id;
     MiddlePos = (abstractPos) ? Position : pos;
     Status = status;
     AbstractPos = abstractPos;
     Text = text;
     Image = image;
     Ratio = ratioFunc;
     Font = font;
     ColorNormal = normal;
     ColorSelected = selected;
     OnClick = onClick;
     NormalSelect = normalSelect;
     UpdateRectangles();
 }
        public void TestGetNamespaces2()
        {
            var ns = NameFunc.GetNamespaceOfClassName("MyClass");

            Assert.Null(ns);
        }
        public void TestGetNamespaces()
        {
            var ns = NameFunc.GetNamespaceOfClassName("myns.company.MyClass");

            Assert.Equal("myns.company", ns);
        }
예제 #8
0
 public SimpleText(NameFunc text, Vector2 position, PosOnScreen pos, SpriteFont font, Color colorNormal, bool isDrawable = true)
     : this(text,position, pos, font, colorNormal, colorNormal,isDrawable)
 {
 }