Exemple #1
0
        public virtual IControlAdapter GetControlAdapter(MobileControl control)
        {
            IControlAdapter adapter = RequestingDeviceConfig.NewControlAdapter(control.GetType());

            adapter.Control = control;
            return(adapter);
        }
Exemple #2
0
        private static void Dispose(IControlAdapter adapter)
        {
            IDisposable disposable = adapter as IDisposable;

            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        // Given a control's type, create a control adapter for it.

        internal virtual IControlAdapter NewControlAdapter(Type originalControlType)
        {
            IWebObjectFactory factory = GetAdapterFactory(originalControlType);

            // Should return non-null, or throw an exception.
            Debug.Assert(factory != null);

            IControlAdapter a = (IControlAdapter)factory.CreateInstance();

            return(a);
        }
Exemple #4
0
        /// <summary>
        /// Create workbook instance
        /// </summary>
        /// <param name="adapter">Control instance adapter</param>
        public Workbook(IControlAdapter adapter)
        {
#if DEBUG
            Stopwatch sw = Stopwatch.StartNew();
            Debug.WriteLine("start creating workbook...");
#endif // DEBUG

            if (adapter != null)
            {
                this.controlAdapter = adapter;

                this.AttachSheetTabControl(this.controlAdapter.SheetTabControl);
            }

            // default control styles
            //SetControlStyle(ControlAppearanceStyle.DefaultControlStyle);

#if DEBUG
            sw.Stop();
            long ms = sw.ElapsedMilliseconds;
            Debug.WriteLine("creating workbook done: " + ms + " ms.");
#endif
        }
 internal WorksheetCollection(Workbook workbook)
 {
     this.adapter  = workbook.controlAdapter;
     this.workbook = workbook;
 }