Example #1
0
        static T ExpectControl <T>(IControl parent, string name) where T : class, IControl
        {
            var result = parent.FindControl <T>(name);

            Debug.Assert(result != null, name + " not found");
            return(result);
        }
        public static bool TryGetCellCollection(this IControl control, out ICellCollection cellCollection)
        {
            var selectRange = (SelectionRange)control.FindControl(c => c is SelectionRange);

            if (selectRange != null)
            {
                return(control.MyAskMeAnything.TryGetCellCollection((selectRange).CurrentSelection, out cellCollection));
            }

            cellCollection = null;
            return(false);
        }
        public static bool TryGetMaterialModel(this IControl control, out IMaterialModel materialModel)
        {
            var selectMatMod = (SelectionMaterialModel)control.FindControl(c => c is SelectionMaterialModel);

            if (selectMatMod != null)
            {
                return(selectMatMod.MyAskMeAnything.AskPlugin.TryGetMaterialModel(selectMatMod.CurrentSelection, out materialModel));
            }

            materialModel = null;
            return(false);
        }
Example #4
0
 public static void RegisterControl <TControl>(this IControl parent, out TControl control, string name)
     where TControl : class, IControl
 {
     control = parent.FindControl <TControl>(name);
 }