예제 #1
0
파일: Grid.cs 프로젝트: yongweisun/paradox
        private float SumStripCurrentSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;

            foreach (var def in definitions) // do not use linq to avoid allocations
            {
                sum += def.ActualSize;
            }

            return(sum);
        }
예제 #2
0
파일: Grid.cs 프로젝트: phr00t/FocusEngine
        private static float SumStripCurrentSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;

            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var def in definitions) // do not use linq to avoid allocations
            {
                sum += def.ActualSize;
            }

            return(sum);
        }
예제 #3
0
파일: Grid.cs 프로젝트: phr00t/FocusEngine
 private static void CreateDefaultStripIfNecessary(ref StripDefinitionCollection computedCollection, StripDefinitionCollection userCollection)
 {
     if (userCollection.Count > 0)
     {
         computedCollection = userCollection;
     }
     else if (computedCollection == userCollection || computedCollection == null)
     {
         // Need to create default collection (it will be kept until user one is not empty again)
         computedCollection = new StripDefinitionCollection {
             new StripDefinition()
         };
     }
 }
예제 #4
0
파일: Grid.cs 프로젝트: phr00t/FocusEngine
        /// <summary>
        /// Set the size of all the fix-sized strips, and initialize the size of auto/star-sized strips to their minimal size.
        /// </summary>
        /// <param name="definitions">The strip definitions</param>
        private static void InitializeStripDefinitionActualSize(StripDefinitionCollection definitions)
        {
            foreach (var definition in definitions)
            {
                var stripSize = 0f;

                if (definition.Type == StripType.Fixed)
                {
                    stripSize = definition.SizeValue;
                }

                definition.ActualSize = definition.ClampSizeByMinimumMaximum(stripSize);
            }
        }
예제 #5
0
파일: Grid.cs 프로젝트: yongweisun/paradox
        private float SumStripAutoAndFixedSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;

            foreach (var def in definitions) // do not use linq to avoid allocations
            {
                if (def.Type != StripType.Star)
                {
                    sum += def.ActualSize;
                }
            }

            return(sum);
        }
예제 #6
0
파일: Grid.cs 프로젝트: Beefr/xenko-wd
        private static float SumStripAutoAndFixedSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;

            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var def in definitions) // do not use linq to avoid allocations
            {
                if (def.Type != StripType.Star)
                {
                    sum += def.ActualSize;
                }
            }

            return(sum);
        }
예제 #7
0
파일: Grid.cs 프로젝트: phr00t/FocusEngine
        private static float SumStripAutoAndFixedSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;

            // ReSharper disable once LoopCanBeConvertedToQuery
            try
            {
                foreach (var def in definitions) // do not use linq to avoid allocations
                {
                    if (def.Type != StripType.Star)
                    {
                        sum += def.ActualSize;
                    }
                }
            }
            catch (Exception e)
            {
                throw new InvalidOperationException("Grid measuring problem. Are you trying to render the same UIElement or Page 2+ times? More info: " + e.ToString());
            }

            return(sum);
        }
예제 #8
0
파일: Grid.cs 프로젝트: h78hy78yhoi8j/xenko
        private float SumStripAutoAndFixedSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;
            foreach (var def in definitions) // do not use linq to avoid allocations
                if (def.Type != StripType.Star)
                    sum += def.ActualSize;

            return sum;
        }
예제 #9
0
파일: Grid.cs 프로젝트: h78hy78yhoi8j/xenko
        private float SumStripCurrentSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;
            foreach (var def in definitions) // do not use linq to avoid allocations
                sum += def.ActualSize;

            return sum;
        }
예제 #10
0
파일: Grid.cs 프로젝트: h78hy78yhoi8j/xenko
        /// <summary>
        /// Set the size of all the fix-sized strips, and initialize the size of auto/star-sized strips to their minimal size.
        /// </summary>
        /// <param name="definitions">The strip definitions</param>
        private static void InitializeStripDefinitionActualSize(StripDefinitionCollection definitions)
        {
            foreach (var definition in definitions)
            {
                var stripSize = 0f;

                if (definition.Type == StripType.Fixed)
                    stripSize = definition.SizeValue;

                definition.ActualSize = definition.ClampSizeByMinimumMaximum(stripSize);
            }
        }
예제 #11
0
        private static float SumStripAutoAndFixedSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;
            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var def in definitions) // do not use linq to avoid allocations
                if (def.Type != StripType.Star)
                    sum += def.ActualSize;

            return sum;
        }
예제 #12
0
        private static float SumStripCurrentSize(StripDefinitionCollection definitions)
        {
            var sum = 0f;
            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var def in definitions) // do not use linq to avoid allocations
                sum += def.ActualSize;

            return sum;
        }
예제 #13
0
 private static void CreateDefaultStripIfNecessary(ref StripDefinitionCollection computedCollection, StripDefinitionCollection userCollection)
 {
     if (userCollection.Count > 0)
     {
         computedCollection = userCollection;
     }
     else if (computedCollection == userCollection || computedCollection == null)
     {
         // Need to create default collection (it will be kept until user one is not empty again)
         computedCollection = new StripDefinitionCollection { new StripDefinition() };
     }
 }
예제 #14
0
 private void TestDefinitionsDefaultState(StripDefinitionCollection definitions)
 {
     Assert.AreEqual(0, definitions.Count);
 }
예제 #15
0
 private void CreateFixedSizeDefinition(StripDefinitionCollection definitions, List<float> sizes)
 {
     definitions.Clear();
     foreach (var size in sizes)
         definitions.Add(new StripDefinition(StripType.Fixed, size));
 }
예제 #16
0
 private void CheckFixedSizeStripSize(StripDefinitionCollection definitions, List<float> sizes)
 {
     for (var i=0; i<definitions.Count; ++i)
         Assert.AreEqual(sizes[i], definitions[i].ActualSize);
 }