/// <summary>
        /// Resolves first parent which is IBoundedContainer and returns its DataSource
        /// </summary>
        /// <param name="aAdaptor">
        /// Control adaptor to use <see cref="ControlAdaptor"/>
        /// </param>
        /// <param name="aControl">
        /// Control which parent is to be resolved <see cref="System.Object"/>
        /// </param>
        /// <returns>
        /// Object of parent controls datasource or null <see cref="System.Object"/>
        /// </returns>
        public static object ResolveBoundaryDataSourceFromParent(ControlAdaptor aAdaptor, object aControl)
        {
            if (aControl == null)
            {
                return(null);
            }
            object ctrl = aAdaptor.GetParentOfControl(aControl);

            while (ctrl != null)
            {
                if (ctrl is IBoundedContainer)
                {
                    if ((ctrl as IBoundedContainer).InheritedBoundaryDataSource == false)
                    {
                        return((ctrl as IBoundedContainer).BoundaryDataSource);
                    }
                }
                ctrl = aAdaptor.GetParentOfControl(ctrl);
            }
            return(null);
        }
        /// <summary>
        /// Resolves DaraSource from parent control
        /// </summary>
        /// <param name="aAdaptor">
        /// Control adaptor to use <see cref="ControlAdaptor"/>
        /// </param>
        /// <param name="aControl">
        /// Control which parent is to be resolved <see cref="System.Object"/>
        /// </param>
        /// <returns>
        /// Object of parent controls datasource adaptor or null <see cref="System.Object"/>
        /// </returns>
        public static object ResolveDataSourceFromParent(ControlAdaptor aAdaptor, object aControl)
        {
            if ((aControl == null) || (aAdaptor == null))
            {
                return(null);
            }
            object ctrl = aAdaptor.GetParentOfControl(aControl);

            if (aAdaptor.ControlIsWindow(aControl) == true)
            {
                return(null);
            }

            while (ctrl != null)
            {
                if (ctrl is IAdaptableContainer)
                {
                    return((ctrl as IAdaptableContainer).Adaptor.Adaptor);
                }
                ctrl = aAdaptor.GetParentOfControl(ctrl);
            }
            return(null);
        }
Example #3
0
 /// <summary>
 /// Throws Exception
 /// </summary>
 /// <param name="aAdaptor">
 /// Adaptor <see cref="ControlAdaptor"/>
 /// </param>
 /// <param name="aWidget">
 /// Control <see cref="System.Object"/>
 /// </param>
 public ExceptionControlAdaptorConnectedWithWrongWidgetType(ControlAdaptor aAdaptor, object aWidget)
     : base("Adaptor " + aAdaptor + " was created with wrong widget type (" + aWidget + ")")
 {
 }
 /// <summary>
 /// Creates GtkListAdaptor
 /// </summary>
 /// <param name="aIsBoundary">
 /// Defines if this is boundary adapter <see cref="System.Boolean"/>
 /// </param>
 /// <param name="aControlAdaptor">
 /// ControlAdapter to which this one is connected <see cref="ControlAdaptor"/>
 /// </param>
 /// <param name="aControl">
 /// Control connected to this adaptor <see cref="System.Object"/>
 /// </param>
 /// <param name="aSingleMappingOnly">
 /// Adaptor supports single mapping only <see cref="System.Boolean"/>
 /// </param>
 public GtkListAdaptor(bool aIsBoundary, ControlAdaptor aControlAdaptor, object aControl, bool aSingleMappingOnly)
     : base(aIsBoundary, aControlAdaptor, aControl, aSingleMappingOnly)
 {
 }