当前位置: 首页>>代码示例>>C#>>正文


C# IArrangedElement类代码示例

本文整理汇总了C#中IArrangedElement的典型用法代码示例。如果您正苦于以下问题:C# IArrangedElement类的具体用法?C# IArrangedElement怎么用?C# IArrangedElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IArrangedElement类属于命名空间,在下文中一共展示了IArrangedElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetPreferredSize

        internal override Size GetPreferredSize(IArrangedElement container, Size proposedConstraints) {
#if DEBUG        
            if (CompModSwitches.FlowLayout.TraceInfo) {            
                Debug.WriteLine("FlowLayout::GetPreferredSize("
                    + "container=" + container.ToString() + ", "
                    + "proposedConstraints=" + proposedConstraints.ToString() + ")");
                Debug.Indent();
            }
#endif
            Rectangle measureBounds = new Rectangle(new Point(0, 0), proposedConstraints);
            Size prefSize = xLayout(container, measureBounds, /* measureOnly = */ true);

            if(prefSize.Width > proposedConstraints.Width || prefSize.Height> proposedConstraints.Height) {
                // Controls measured earlier than a control which couldn't be fit to constraints may
                // shift around with the new bounds.  We need to make a 2nd pass through the
                // controls using these bounds which are gauranteed to fit.
                measureBounds.Size = prefSize;
                prefSize = xLayout(container, measureBounds, /* measureOnly = */ true);
            }

#if DEBUG
            if (CompModSwitches.FlowLayout.TraceInfo) {
                Debug.Unindent();
                Debug.WriteLine("GetPreferredSize returned " + prefSize);
            }
#endif
            return prefSize;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:28,代码来源:FlowLayout.cs

示例2: ClearMaximumSize

 internal static void ClearMaximumSize(IArrangedElement element)
 {
     if (element.Properties.ContainsObject(_maximumSizeProperty))
     {
         element.Properties.RemoveObject(_maximumSizeProperty);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:CommonProperties.cs

示例3: MoveElement

 // Repositions a element in this list.
 internal void MoveElement(IArrangedElement element, int fromIndex, int toIndex) {
     int delta = toIndex - fromIndex;
 
     switch (delta) {
         case -1:
         case 1:
             // simple swap
             this.InnerList[fromIndex] = this.InnerList[toIndex];
             break;
 
         default:
             int start = 0;
             int dest = 0;
 
             // which direction are we moving?
             if (delta > 0) {
                 // shift down by the delta to open the new spot
                 start = fromIndex + 1;
                 dest = fromIndex;
             }
             else {
                 // shift up by the delta to open the new spot
                 start = toIndex;
                 dest = toIndex + 1;
 
                 // make it positive
                 delta = -delta;
             }
             Copy(this, start, this, dest, delta);
             break;
     }
     this.InnerList[toIndex] = element;
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:34,代码来源:ArrangedElementCollection.cs

示例4: PerformLayout

 public virtual void PerformLayout(IArrangedElement container, string propertyName)
 {
     if (this.suspendCount <= 0)
     {
         this.OnLayout(new LayoutEventArgs(container, propertyName));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:ArrangedElement.cs

示例5: MoveElement

        internal void MoveElement(IArrangedElement element, int fromIndex, int toIndex)
        {
            int length = toIndex - fromIndex;
            switch (length)
            {
                case -1:
                case 1:
                    this.InnerList[fromIndex] = this.InnerList[toIndex];
                    break;

                default:
                {
                    int sourceIndex = 0;
                    int destinationIndex = 0;
                    if (length > 0)
                    {
                        sourceIndex = fromIndex + 1;
                        destinationIndex = fromIndex;
                    }
                    else
                    {
                        sourceIndex = toIndex;
                        destinationIndex = toIndex + 1;
                        length = -length;
                    }
                    Copy(this, sourceIndex, this, destinationIndex, length);
                    break;
                }
            }
            this.InnerList[toIndex] = element;
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:ArrangedElementCollection.cs

示例6: EnsureOwnership

 internal void EnsureOwnership(IArrangedElement owner)
 {
     this._owner = owner;
     for (int i = 0; i < this.Count; i++)
     {
         this[i].Owner = owner;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TableLayoutStyleCollection.cs

示例7: GetAutoSizeMode

 internal static AutoSizeMode GetAutoSizeMode(IArrangedElement element)
 {
     if (GetLayoutState(element)[_autoSizeModeSection] != 0)
     {
         return AutoSizeMode.GrowAndShrink;
     }
     return AutoSizeMode.GrowOnly;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:CommonProperties.cs

示例8: SetFlowDirection

 public static void SetFlowDirection(IArrangedElement container, FlowDirection value)
 {
     if (!System.Windows.Forms.ClientUtils.IsEnumValid(value, (int) value, 0, 3))
     {
         throw new InvalidEnumArgumentException("value", (int) value, typeof(FlowDirection));
     }
     container.Properties.SetInteger(_flowDirectionProperty, (int) value);
     LayoutTransaction.DoLayout(container, container, PropertyNames.FlowDirection);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:FlowLayout.cs

示例9: CreateTransactionIf

 public static IDisposable CreateTransactionIf(bool condition, Control controlToLayout, IArrangedElement elementCausingLayout, string property)
 {
     if (condition)
     {
         return new LayoutTransaction(controlToLayout, elementCausingLayout, property);
     }
     CommonProperties.xClearPreferredSizeCache(elementCausingLayout);
     return new NullLayoutTransaction();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:LayoutTransaction.cs

示例10: GetMargin

 internal static Padding GetMargin(IArrangedElement element)
 {
     bool flag;
     Padding padding = element.Properties.GetPadding(_marginProperty, out flag);
     if (flag)
     {
         return padding;
     }
     return DefaultMargin;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:CommonProperties.cs

示例11: GetLayoutBounds

 internal static Size GetLayoutBounds(IArrangedElement element)
 {
     bool flag;
     Size size = element.Properties.GetSize(_layoutBoundsProperty, out flag);
     if (flag)
     {
         return size;
     }
     return Size.Empty;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:CommonProperties.cs

示例12: GetPreferredSize

 internal override Size GetPreferredSize(IArrangedElement container, Size proposedConstraints)
 {
     Rectangle displayRect = new Rectangle(new Point(0, 0), proposedConstraints);
     Size size = this.xLayout(container, displayRect, true);
     if ((size.Width <= proposedConstraints.Width) && (size.Height <= proposedConstraints.Height))
     {
         return size;
     }
     displayRect.Size = size;
     return this.xLayout(container, displayRect, true);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:FlowLayout.cs

示例13: DoLayout

 public static void DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, string property)
 {
     if (elementCausingLayout != null)
     {
         CommonProperties.xClearPreferredSizeCache(elementCausingLayout);
         if (elementToLayout != null)
         {
             CommonProperties.xClearPreferredSizeCache(elementToLayout);
             elementToLayout.PerformLayout(elementCausingLayout, property);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:LayoutTransaction.cs

示例14: DoLayoutIf

 public static void DoLayoutIf(bool condition, IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, string property)
 {
     if (!condition)
     {
         if (elementCausingLayout != null)
         {
             CommonProperties.xClearPreferredSizeCache(elementCausingLayout);
         }
     }
     else
     {
         DoLayout(elementToLayout, elementCausingLayout, property);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:LayoutTransaction.cs

示例15: CreateContainerProxy

        private static ContainerProxy CreateContainerProxy(IArrangedElement container, FlowDirection flowDirection) {

            switch (flowDirection) {
                case FlowDirection.RightToLeft:
                    return new RightToLeftProxy(container);
                case FlowDirection.TopDown:
                    return new TopDownProxy(container);
                case FlowDirection.BottomUp:
                    return new BottomUpProxy(container);
                case FlowDirection.LeftToRight:
                default:
                    return new ContainerProxy(container);
            }
        
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:15,代码来源:FlowLayout.cs


注:本文中的IArrangedElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。