示例#1
0
        /// <summary>
        /// アイテムを作成
        /// </summary>
        /// <param name="itemNum">アイテムの数</param>
        /// <param name="callbackCreateItem">アイテムが作成されるときに呼ばれるコールバック</param>
        public void CreateItems(int itemNum, System.Action <GameObject, int> callbackCreateItem)
        {
            Content.anchoredPosition = Vector2.zero;
            ScrollRect.velocity      = Vector2.zero;
            ClearItems();
            for (int i = 0; i < itemNum; ++i)
            {
                GameObject go = UtageToolKit.AddChildPrefab(Content, ItemPrefab.gameObject);
                items.Add(go);
                if (null != callbackCreateItem)
                {
                    callbackCreateItem(go, i);
                }
            }
            PositionGroup.Reposition();
            bool isStopScrool = IsContentInnerScrollRect() && IsStopScroolWithAllInnner;

            switch (ScrollType)
            {
            case Type.Horizontal:
                ScrollRect.horizontal = !isStopScrool;
                ScrollRect.vertical   = false;
                break;

            case Type.Vertical:
                ScrollRect.horizontal = false;
                ScrollRect.vertical   = !isStopScrool;
                break;
            }
        }
示例#2
0
文件: Group.cs 项目: pz11u2/decanat
 // Специальность (5.080405)
 //String specialization{get;set;}
 //год поступления
 //Int32 year{get;set;}
 //ICollection<IDiscipline> getDisciplineToCurrentSemestr{get;set;} // select * from dis where dis.semestr==(semestr)
 public Group(Int32 countStudents,
     String nameGroup,
     PositionGroup valuePositionGroup,
     String educationForm,
     Byte course)
 {
     CountStudents = countStudents;
     NameGpoup = nameGroup;
     ValuePositionGroup = valuePositionGroup;
     EducationForm = educationForm;
     Course = course;
 }
示例#3
0
 public void InsertOrUpdate(PositionGroup PositionGroup)
 {
     if (PositionGroup.Id == default(int))
     {
         // New entity
         _context.PositionGroups.Add(PositionGroup);
     }
     else
     {
         // Existing entity
         _context.Entry(PositionGroup).State = EntityState.Modified;
     }
 }
示例#4
0
        public void Reposition()
        {
            Content.anchoredPosition = Vector2.zero;
            ScrollRect.velocity      = Vector2.zero;
            if (PositionGroup != null)
            {
                PositionGroup.Reposition();
            }
            bool isStopScrool = IsContentInnerScrollRect() && IsStopScroolWithAllInnner;

            switch (ScrollType)
            {
            case Type.Horizontal:
                ScrollRect.horizontal = !isStopScrool;
                ScrollRect.vertical   = false;
                if (isAutoCenteringOnRepostion)
                {
                    if (isStopScrool)
                    {
                        float offset = (this.ScrollRectTransform.sizeDelta.x - Content.sizeDelta.x) / 2;
                        Content.anchoredPosition = new Vector3(offset, 0, 0);
                    }
                    else
                    {
                        ScrollRect.horizontalNormalizedPosition = 0.5f;
                    }
                }
                break;

            case Type.Vertical:
                ScrollRect.horizontal = false;
                ScrollRect.vertical   = !isStopScrool;
                if (isAutoCenteringOnRepostion)
                {
                    if (isStopScrool)
                    {
                        float offset = -(this.ScrollRectTransform.sizeDelta.y - Content.sizeDelta.y) / 2;
                        Content.anchoredPosition = new Vector3(0, offset, 0);
                    }
                    else
                    {
                        ScrollRect.verticalNormalizedPosition = 0.5f;
                    }
                }
                break;
            }
            ScrollRect.enabled = !isStopScrool;
        }
        public void AddDifferentQuantity()
        {
            var collection = PositionGroupCollection.Empty;

            var positions     = new IPosition[] { new Position(Symbols.SPY, 10, 1) };
            var group         = new PositionGroup(new PositionGroupKey(new SecurityPositionGroupBuyingPowerModel(), positions), positions);
            var newCollection = collection.Add(group);

            var positions2 = new IPosition[] { new Position(Symbols.SPY, 20, 1) };
            var group2     = new PositionGroup(new PositionGroupKey(new SecurityPositionGroupBuyingPowerModel(), positions2), positions2);
            var result     = newCollection.Add(group2);

            Assert.AreEqual(1, result.Count);
            Assert.IsTrue(result.IsOnlyDefaultGroups);
            Assert.IsTrue(result.Contains(group.Key));
        }
        public void AddTwice()
        {
            var collection = PositionGroupCollection.Empty;

            var positions     = new IPosition[] { new Position(Symbols.SPY, 10, 1) };
            var group         = new PositionGroup(new PositionGroupKey(new SecurityPositionGroupBuyingPowerModel(), positions), positions);
            var newCollection = collection.Add(group);
            var result        = newCollection.Add(group);

            Assert.AreEqual(1, result.Count);
            Assert.IsTrue(result.IsOnlyDefaultGroups);
            Assert.IsTrue(result.Contains(group.Key));

            IReadOnlyCollection <IPositionGroup> resultingGroups;

            Assert.IsTrue(result.TryGetGroups(Symbols.SPY, out resultingGroups));
            Assert.AreEqual(1, resultingGroups.Count);
            Assert.AreEqual(10, resultingGroups.Single().Positions.Single().Quantity);
        }
示例#7
0
 public StackerGroup()
 {
     Picker1Position = new PositionGroup();
     Picker2Position = new PositionGroup();
 }
示例#8
0
 public TransferModuleJobInfo()
 {
     Items = new ObservableCollection<TransferModulePickJobItem>();
     Picker1ToLine1Position1 = new PositionGroup();
     Picker1ToLine1 = new PositionGroup();
     Picker1ToLine2Position1 = new PositionGroup();
     Picker1ToLine2 = new PositionGroup();
     Picker2ToLine1Position1 = new PositionGroup();
     Picker2ToLine1 = new PositionGroup();
     Picker2ToLine2Position1 = new PositionGroup();
     Picker2ToLine2 = new PositionGroup();
     Stacker1TrayPick = new PositionGroup();
     Stacker2TrayPick = new PositionGroup();
     TrayPlace = new PositionGroup();
 }
示例#9
0
 public void CopyTo(PositionGroup obj)
 {
     this.XPosition.CopyTo(obj.XPosition);
     this.YPosition.CopyTo(obj.YPosition);
     this.ZPosition.CopyTo(obj.ZPosition);
 }