private static void LockWindows(BaseLayoutItem window)
 {
     if (window.Parent != null)
     {
         foreach (var item in window.Parent.Items)
         {
             if (!GetIsModal(item))
             {
                 item.AllowActivate  = false;
                 item.AllowClose     = false;
                 item.AllowDock      = false;
                 item.AllowDrag      = false;
                 item.AllowDrop      = false;
                 item.AllowFloat     = false;
                 item.AllowHide      = false;
                 item.AllowMaximize  = false;
                 item.AllowMinimize  = false;
                 item.AllowMove      = false;
                 item.AllowRestore   = false;
                 item.AllowSelection = false;
                 item.AllowSizing    = false;
                 item.Focusable      = false;
                 item.IsEnabled      = false;
             }
         }
     }
 }
コード例 #2
0
 internal void RaiseCanHideItem(BaseLayoutItem sender, CanHideItemEventArgs e)
 {
     if (CanHideItem != null)
     {
         CanHideItem(sender, e);
     }
 }
コード例 #3
0
ファイル: TapHopCP.cs プロジェクト: anhphunguyen2509/PhucHao
        void FrmMain_Shown(object sender, EventArgs e)
        {
            if (lcgTHLai == null)
            {
                lcgTHLai = lcMain.Items.FindByName("item6");
            }
            DataTable dtMaster = (_data.BsMain.DataSource as DataSet).Tables[0];

            if (dtMaster.Rows.Count > 0 && dtMaster.Rows[dtMaster.Rows.Count - 1].RowState == DataRowState.Added)     //thêm để chạy khi thêm lần đầu
            {
                dtMaster_RowChanged(dtMaster, new DataRowChangeEventArgs(dtMaster.Rows[dtMaster.Rows.Count - 1], DataRowAction.Add));
            }
            //thêm để tập hợp lại khi mở form chi tiết lần đầu
            if (_data.BsMain.Current == null)
            {
                return;
            }
            DataRow drMaster = (_data.BsMain.Current as DataRowView).Row;

            if (drMaster.RowState == DataRowState.Unchanged && !Convert.ToBoolean(drMaster["Duyet"]))
            {
                TapHop2(drMaster);
            }
            else
            {
                lciBtnTHLai.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                if (lcgTHLai != null)
                {
                    lcgTHLai.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                }
            }
        }
 private static void UnlockWindows(BaseLayoutItem window)
 {
     if (window.Parent != null)
     {
         foreach (var item in window.Parent.Items)
         {
             BaseLayoutItemState state = GetWindowState(item);
             if (state != null)
             {
                 item.AllowActivate  = state.AllowActivate;
                 item.AllowClose     = state.AllowClose;
                 item.AllowDock      = state.AllowDock;
                 item.AllowDrag      = state.AllowDrag;
                 item.AllowDrop      = state.AllowDrop;
                 item.AllowFloat     = state.AllowFloat;
                 item.AllowHide      = state.AllowHide;
                 item.AllowMaximize  = state.AllowMaximize;
                 item.AllowMinimize  = state.AllowMinimize;
                 item.AllowMove      = state.AllowMove;
                 item.AllowRestore   = state.AllowRestore;
                 item.AllowSelection = state.AllowSelection;
                 item.AllowSizing    = state.AllowSizing;
                 item.Focusable      = state.Focusable;
                 item.IsEnabled      = state.IsEnabled;
                 state = null;
             }
         }
     }
 }
コード例 #5
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            BaseLayoutItem item  = value as BaseLayoutItem;
            MainViewModel  model = parameter as MainViewModel;

            return(value.ToString());;
        }
コード例 #6
0
        private void Editor_ValueStored(object sender, EventArgs e)
        {
            PropertyEditor editor     = (PropertyEditor)sender;
            BaseLayoutItem layoutitem = editorMap[editor];

            OnHighlightGroup(layoutitem.Parent);
        }
コード例 #7
0
ファイル: MainView.xaml.cs プロジェクト: zaharvsb52/MyWmsPro
        public void MakeMaxSize(BaseLayoutItem item, bool isMax)
        {
            if (item == null)
            {
                return;
            }

            var panel = item as LayoutPanel;

            if (panel != null)
            {
                panel.ShowRestoreButton  = isMax;
                panel.ShowMaximizeButton = isMax;
            }

            if (isMax)
            {
                dockManager.DockController.Dock(item, documentGroup, DevExpress.Xpf.Layout.Core.DockType.Fill);
            }
            else
            {
                var parent        = dockManager.DockController.Float(item);
                var restoreBounds = new Rect(parent.FloatLocation, parent.FloatSize);
                var bounds        = WindowHelper.GetMaximizeBounds(dockManager, restoreBounds);
                DocumentPanel.SetRestoreBounds(parent, restoreBounds);
                parent.FloatLocation = new Point(bounds.X, bounds.Y);
                parent.FloatSize     = new Size(bounds.Width, bounds.Height);
            }
        }
コード例 #8
0
        void bClose_ItemClick(object sender, ItemClickEventArgs ea)
        {
            DockLayoutManager manager = DockLayoutManager.GetDockLayoutManager(sender as DependencyObject);
            BaseLayoutItem    item    = DockLayoutManager.GetLayoutItem(sender as DependencyObject);

            manager.DockController.Close(item);
        }
コード例 #9
0
 public void RemovePage(BaseLayoutItem page)
 {
     if (_pages.Remove(page))
     {
         TabContainer.DockController.RemoveItem(page);
     }
 }
コード例 #10
0
        GridLengthAnimation CreateAnimation(BaseLayoutItem item, DependencyProperty property, GridLength value)
        {
            GridLength to = new GridLength(0, GridUnitType.Star);

            if (maximizedItem != null)
            {
                if (maximizedItem == item || maximizedItem.Parent == item)
                {
                    to = value;
                }
            }
            else
            {
                to = value;
            }
            GridLengthAnimation a = new GridLengthAnimation
            {
                From         = (GridLength)item.GetValue(property),
                To           = to,
                Duration     = new TimeSpan(0, 0, 0, 0, 500),
                FillBehavior = System.Windows.Media.Animation.FillBehavior.Stop
            };

            return(a);
        }
コード例 #11
0
        /// <summary>
        ///     Gets the cache key for the item
        /// </summary>
        /// <param name="item">the item</param>
        /// <returns>the cache key</returns>
        public virtual string GetCacheKey(Item item)
        {
            Assert.ArgumentNotNull(item, "item");

            var            dbName         = item.Database.Name;
            BaseLayoutItem baseLayoutItem = item;
            var            idList         = new List <ID>();
            var            idSet          = new HashSet <ID>();

            while (baseLayoutItem != null)
            {
                if (idSet.Add(baseLayoutItem.ID))
                {
                    idList.Add(baseLayoutItem.ID);
                    baseLayoutItem = baseLayoutItem.BaseLayout;
                }
                else
                {
                    throw new CircularReferenceException("A circular reference was detected in the base layout chain.");
                }
            }
            idList.Reverse();

            return(dbName + ":" + string.Join("|", idList));
        }
 protected override bool CheckItem(BaseLayoutItem item, bool tabStopOnly, bool includeReadOnly)
 {
     if (focusedGroup != null && item.Parent != focusedGroup)
     {
         return(false);
     }
     return(base.CheckItem(item, tabStopOnly, includeReadOnly));
 }
        private void OnCanHideItem(object sender, CanHideItemEventArgs e)
        {
            BaseLayoutItem item = sender as BaseLayoutItem;

            if (XtraMessageBox.Show(string.Format("Do you wish to hide this item ({0})? ", item.Name), "HideItemDialog", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                e.CanHideItem = false;
            }
        }
コード例 #14
0
        IEnumerable <BaseLayoutItem> GetItemsToAnimate(BaseLayoutItem target)
        {
            LayoutGroup animationGroup = target.Parent;

            return(from item in dockManager.GetItems()
                   where (item != target && item != animationGroup) &&
                   (object.Equals(item.Parent, animationGroup) || object.Equals(item.Parent, animationGroup.Parent))
                   select item);
        }
コード例 #15
0
 BaseLayoutItem[] CreateNotePages(Note note)
 {
     BaseLayoutItem[] items = new BaseLayoutItem[note.Pages.Count];
     for (int i = 0; i < items.Length; i++)
     {
         items[i] = CreateNotePage(note.Pages[i]);
     }
     return(items);
 }
コード例 #16
0
        void BarSubItemOnItemClick(object sender, ItemClickEventArgs itemClickEventArgs)
        {
            var            control    = ((Control)_shortCuts[itemClickEventArgs.Item.ItemShortcut.Key].Control);
            var            layout     = (LayoutControl)((WinLayoutManager)(View.LayoutManager)).Container;
            BaseLayoutItem layoutItem = layout.GetItemByControl(control);

            layout.FocusHelper.PlaceItemIntoView(layoutItem);
            control.Focus();
        }
コード例 #17
0
        public static bool AllowMoving(BaseLayoutItem item, BaseLayoutItem target)
        {
            bool result = false;

            if (target == null)
            {
                return(false);
            }
            if (DragHelper.IsItemInGroup(item) && DragHelper.IsTargetInGroup(target) && (target is LayoutControlItem))
            {
                return(true);
            }
            BaseLayoutItem draggedItem = null, targetItem = null;

            if (item is LayoutControlItem)
            {
                draggedItem = item as LayoutControlItem;
                if (target is LayoutControlItem)
                {
                    targetItem = target as LayoutControlItem;
                    if (targetItem.Parent == draggedItem.Parent)
                    {
                        result = true;
                    }
                }
                if (target is LayoutGroup)
                {
                    targetItem = target as LayoutGroup;
                    if (targetItem.Parent == draggedItem.Parent)
                    {
                        result = true;
                    }
                }
            }
            if (item is LayoutGroup)
            {
                draggedItem = item as LayoutGroup;
                if (target is LayoutControlItem)
                {
                    targetItem = target as LayoutControlItem;
                    if (targetItem.Parent == draggedItem.Parent)
                    {
                        result = true;
                    }
                }
                if (target is LayoutGroup)
                {
                    targetItem = target as LayoutGroup;
                    if (targetItem.Parent == draggedItem.Parent)
                    {
                        result = true;
                    }
                }
            }
            return(result);
        }
コード例 #18
0
        protected void FillInfoToLayoutMap(ViewItem detailViewItem, IModelViewLayoutElement itemModel, BaseLayoutItem layoutItem) {
            if (detailViewItem is AdditionalViewControlsItem) {
                var id = ((AdditionalViewControlsItem)detailViewItem).Model.Rule.Id;
                if (RuleToLayoutMap.ContainsKey(id))
                    RuleToLayoutMap[id] = layoutItem;
                else
                    RuleToLayoutMap.Add(id, layoutItem);
            }

        }
 private static void CreateStates(BaseLayoutItem window)
 {
     if (window.Parent != null)
     {
         foreach (var item in window.Parent.Items)
         {
             CreateWindowState(item);
         }
     }
 }
コード例 #20
0
        void BeginAnimationToFixedValue(BaseLayoutItem layoutItem, GridLength l, DependencyProperty prop)
        {
            GridLengthAnimation a = CreateAnimation(layoutItem, prop, l);

            a.Completed += (s, e) =>
            {
                layoutItem.SetValue(prop, a.To);
            };
            layoutItem.BeginAnimation(prop, a);
        }
コード例 #21
0
        public void RemoveUserControl(string tag)
        {
            BaseLayoutItem currentItem = RootLayoutGroup.Items.FirstOrDefault(x => x.Name.Equals(tag));

            if (currentItem != null)
            {
                LayoutControlItem controlItem = currentItem as LayoutControlItem;
                RootLayoutControl.Controls.Remove(controlItem.Control);
                RootLayoutGroup.Remove(currentItem);
            }
        }
コード例 #22
0
        private void SetLayoutVisible(BaseLayoutItem item, bool visible, int rowHeight)
        {
            item.Visibility = visible
        ? DevExpress.XtraLayout.Utils.LayoutVisibility.Always
        : DevExpress.XtraLayout.Utils.LayoutVisibility.Never;

            var r   = item.OptionsTableLayoutItem.RowIndex;
            var row = layoutControlGroup3.OptionsTableLayoutGroup.GetRow(r);

            row.Height = visible ? rowHeight : 1;
        }
        public override bool CanDrop(Point point, ILayoutElement element)
        {
            DockLayoutElementDragInfo dockLayoutElementDragInfo = new DockLayoutElementDragInfo(this.View, point, element);
            BaseLayoutItem            draggedItem = dockLayoutElementDragInfo.Item;
            BaseLayoutItem            target      = dockLayoutElementDragInfo.Target;

            if (!DragHelper.IsItemInGroup(draggedItem) && !DragHelper.IsTargetInGroup(target))
            {
                return(base.CanDrop(point, element));
            }
            bool result = DragHelper.AllowMoving(draggedItem, target);

            return(result);
        }
コード例 #24
0
        string ILayoutAdapter.Resolve(DockLayoutManager owner, object item)
        {
            BaseLayoutItem panelHost = owner.GetItem("PanelHost");

            if (panelHost == null)
            {
                panelHost = new LayoutGroup()
                {
                    Name = "PanelHost", DestroyOnClosingChildren = false
                };
                owner.LayoutRoot.Add(panelHost);
            }
            return("PanelHost");
        }
コード例 #25
0
ファイル: AdvDocumentGroup.cs プロジェクト: narekye/autobase
        void AdvDocumentGroup_SelectedItemChanged(object sender, DevExpress.Xpf.Docking.Base.SelectedItemChangedEventArgs e)
        {
            WorkPlaceViewModelBase vm = null;

            if (this.SelectedTabIndex >= 0)
            {
                BaseLayoutItem item = this.Items[this.SelectedTabIndex];
                vm = item.DataContext as WorkPlaceViewModelBase;
            }

            if (SelectedItem != vm)
            {
                SelectedItem = vm;
            }
        }
コード例 #26
0
        void OnTileLayoutChanged(TileLayout value)
        {
            rootGroup.Clear();
            int rowCount    = TileLayoutExtension.GetRowCount(value);
            int columnCount = TileLayoutExtension.GetColumnsCount(value);

            BaseLayoutItem[] rows = new BaseLayoutItem[rowCount];
            panelContentList.Clear();
            for (int i = 0; i < rowCount; i++)
            {
                rows[i] = CreateRow(i, columnCount);
            }
            rootGroup.AddRange(rows);
            dockManager.Update();
        }
コード例 #27
0
        LayoutGroup CreateRow(int row, int itemsCount)
        {
            LayoutGroup group = new LayoutGroup()
            {
                AllowSplitters = false
            };

            BaseLayoutItem[] items = new BaseLayoutItem[itemsCount];
            for (int i = 0; i < itemsCount; i++)
            {
                items[i] = CreateItem(row * itemsCount + i);
            }
            group.AddRange(items);
            return(group);
        }
コード例 #28
0
ファイル: ShellViewModel.cs プロジェクト: ajni/eve-profiteer
        private async void activateTab(ModuleViewModel viewModel)
        {
            await Activate(viewModel);

            var            view = (ShellView)GetView();
            BaseLayoutItem tab  = view.ModuleHost.VisiblePages.SingleOrDefault(page => page.DataContext == viewModel);

            if (tab == null)
            {
                tab        = view.DockLayoutManager.ClosedPanels.Single(page => page.DataContext == viewModel);
                tab.Closed = false;
            }
            view.DockLayoutManager.DockController.Activate(tab);
            view.DockLayoutManager.DockItemClosed += DockLayoutManagerOnDockItemClosed;
            view.ModuleHost.SelectedItemChanged   += ModuleHost_SelectedItemChanged;
        }
コード例 #29
0
        private void FillFormats(List <ItemFormat> ItemFormats)
        {
            foreach (ItemFormat itemFmt in ItemFormats)
            {
                BaseLayoutItem bli = layoutControl1.Items.FindByName(itemFmt.ItemName);

                DesignLabel dl = bli as DesignLabel;
                if (dl != null)
                {
                    dl.Formats = itemFmt.Formats;

                    dl.Formats.默认背景色 = dl.AppearanceItemCaption.BackColor;
                    dl.Formats.默认前景色 = dl.AppearanceItemCaption.ForeColor;
                }
            }
        }
コード例 #30
0
 void DoExpand(BaseLayoutItem clickItem)
 {
     if (clickItem != null)
     {
         tileLayoutListBox.IsEnabled = isExpanded;
         var itemsToAnimate = GetItemsToAnimate(clickItem);
         foreach (BaseLayoutItem item in itemsToAnimate)
         {
             if (item != clickItem && item != clickItem.Parent)
             {
                 Animate(item, isExpanded);
             }
         }
         isExpanded = !isExpanded;
     }
 }
コード例 #31
0
ファイル: XXX.cs プロジェクト: AlexOcculate/DevExpressTEST
        public XXX()
        {
            InitializeComponent();
            //
            DataStore2 dataSource = this.createDataSource();

            {
                this.bindingSource1.DataSource = typeof(DataStore2);
                this.bindingSource1.Add(dataSource);
                //
                this.dataLayoutControl1.DataSource = bindingSource1;
                this.dataLayoutControl1.AllowGeneratingCollectionProperties = DevExpress.Utils.DefaultBoolean.True;
                this.dataLayoutControl1.RetrieveFields();
                this.dataLayoutControl1.BestFit();
                //dataLayoutControl1.AutoRetrieveFields = true;
            }
            {
                this.gridControl1.DataSource           = bindingSource1;
                this.gridControl1.UseEmbeddedNavigator = true;

                this.gridView1.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Top;
                this.gridView1.OptionsView.ShowFooter         = true;
                this.gridView1.InitNewRow += new DevExpress.XtraGrid.Views.Grid.InitNewRowEventHandler(this.gridView1_InitNewRow);
                this.gridView1.OptionsBehavior.Editable = true;
                this.gridView1.OptionsBehavior.ReadOnly = false;
            }
            this.dataLayoutControl1.SaveLayoutToXml(@"D:\TEMP\SQLite\layout");
            BaseLayoutItem baseLayoutItem = this.dataLayoutControl1.Root[0];
            {
                #region Save the object
                // Create a new XmlSerializer instance with the type of the test class
                XmlSerializer SerializerObj = new XmlSerializer(typeof(DataStore2));

                // Create a new file stream to write the serialized object to a file
                TextWriter WriteFileStream = new StreamWriter(@"D:\TEMP\SQLite\DataStore2.xml");
                SerializerObj.Serialize(WriteFileStream, dataSource);

                // Cleanup
                WriteFileStream.Close();

                #endregion
            }
            BaseView mainView = this.gc.MainView;
        }
コード例 #32
0
 private void simpleButtonEdit_Click(object sender, EventArgs e)
 {
     BrightVision.DQControl.Business.IQuestionnaire iQuestion;
     var objGroupItems = this.layoutControlGroupQuestionnaire.Items;
     foreach (BaseLayoutItem item in objGroupItems) {
         if (item.IsGroup) {
             if (item.Tag != null) {
                 iQuestion = item.Tag as BrightVision.DQControl.Business.IQuestionnaire;
                 if (iQuestion.ControlGroup.BackgroundImageVisible
                     && iQuestion.Focused) {
                         lastitem = item;
                         memoEditJSON.Text = iQuestion.Questionnaire.ToJSONString(true);
                     break;
                 }
             }
         }
     }
 }
コード例 #33
0
 private void SetEditableGroupControls(BaseLayoutItem Item, bool isEditable)
 {
     if (Item == null) return;
     var FlatList = new DevExpress.XtraLayout.Helpers.FlatItemsList();
     List<BaseLayoutItem> Items = FlatList.GetItemsList(Item);
     ILayoutControl Layout = Item.Owner;
     if (Layout != null) {
         Layout.BeginUpdate();
         BaseLayoutItem li;
         for (int i = Items.Count - 1; i >= 0; --i) {
             li = Items[i];
             if (!li.Equals(Item) && li.Name != Item.Name) {
                 if (li is LayoutControlItem) {
                     Control TempControl = (li as LayoutControlItem).Control;
                     if (TempControl is BaseEdit) {
                         (TempControl as BaseEdit).Properties.ReadOnly = !isEditable;
                         (TempControl as BaseEdit).Properties.AllowFocused = isEditable;
                     }
                 }
             }
         }
         Layout.EndUpdate();
     }
 }
コード例 #34
0
        private void SetEditableGroupControls(BaseLayoutItem Item, bool isEditable)
        {
            if (Item == null) return;
            var FlatList = new DevExpress.XtraLayout.Helpers.FlatItemsList();
            List<BaseLayoutItem> Items = FlatList.GetItemsList(Item);
            ILayoutControl Layout = Item.Owner;
            if (Layout != null)
            {
                Layout.BeginUpdate();
                BaseLayoutItem li;
                for (int i = Items.Count - 1; i >= 0; --i)
                {
                    li = Items[i];
                    if (!li.Equals(Item) && li.Name != Item.Name)
                    {
                        if (li is LayoutControlItem)
                        {
                            Control TempControl = (li as LayoutControlItem).Control;
                            if (TempControl is BaseEdit)
                            {
                                (TempControl as BaseEdit).Properties.ReadOnly = !isEditable;
                                (TempControl as BaseEdit).Properties.AllowFocused = isEditable;
                            }

                        }
                    }
                }
                simpleButtonCancel.Enabled = isEditable;
                simpleButtonSave.Enabled = isEditable;
                this.isEditable = isEditable;
                /**
                 * [@jeff 05.17.2012]: https://brightvision.jira.com/browse/PLATFORM-1415
                 * added read-only setting for the grid view.
                 */
                gridViewHistory.OptionsBehavior.ReadOnly = !isEditable;
                gridControlHistory.RefreshDataSource();
                Layout.EndUpdate();

                if (isEditable) {
                    HasChanged = false;
                }
            }
        }
コード例 #35
0
        //Note: CloseDialogEditor is obsoleted. Use this method instead
        private void DisposeGroupControls(BaseLayoutItem Item)
        {
            if (Item == null) return;
            var FlatList = new DevExpress.XtraLayout.Helpers.FlatItemsList();
            List<BaseLayoutItem> Items = FlatList.GetItemsList(Item);
            ILayoutControl Layout = Item.Owner;
            if (Layout != null)
            {
                Layout.BeginUpdate();
                BaseLayoutItem li;
                for (int i = Items.Count - 1; i >= 0; --i)
                {
                    li = Items[i];
                    if (!li.Equals(Item) && li.Name != Item.Name)
                    {
                        if (li is LayoutControlItem)
                        {
                            Control TempControl = (li as LayoutControlItem).Control;
                            if (TempControl != null)
                            {
                                TempControl.Dispose();
                            }

                            li.Dispose();
                            Items.RemoveAt(i);
                        }
                        else
                        {
                            li.Dispose();
                            Items.RemoveAt(i);
                        }
                    }
                }
                Layout.EndUpdate();
            }

            for (int cnt = 0; cnt < controlsInDialog.Count; cnt++) {
                controlsInDialog[0].Owner = null;
                controlsInDialog[cnt].Dispose();
            }
            controlsInDialog.Clear();
            var lcgItem = Item as LayoutControlGroup;
            lcgItem.Clear();
        }
コード例 #36
0
        private void SetEditableGroupControls(BaseLayoutItem Item, bool isEditable)
        {
            if (Item == null) return;
            var FlatList = new DevExpress.XtraLayout.Helpers.FlatItemsList();
            List<BaseLayoutItem> Items = FlatList.GetItemsList(Item);
            ILayoutControl Layout = Item.Owner;
            if (Layout != null) {
                Layout.BeginUpdate();
                BaseLayoutItem li;
                for (int i = Items.Count - 1; i >= 0; --i) {
                    li = Items[i];
                    if (!li.Equals(Item) && li.Name != Item.Name) {
                        if (li is LayoutControlItem) {
                            Control TempControl = (li as LayoutControlItem).Control;
                            if (TempControl is SimpleButton) {
                                if (TempControl.Name.Equals("PreviewBooking") ||
                                    TempControl.Name.Equals("DeleteMeeting") ||
                                    TempControl.Text.Equals("Add Caller") ||
                                    TempControl.Text.Equals("Add Additional") ||
                                    TempControl.Text.Equals("Delete"))
                                {

                                    if (this.lblScheduleDetails != null && this.lblScheduleDetails.Text != "" && isEditable)
                                        TempControl.Enabled = true;
                                    else
                                        TempControl.Enabled = false;

                                    /*
                                     * https://brightvision.jira.com/browse/PLATFORM-3227
                                     * DAN: Force to enable PreviewBooking button even if isEditable is false.
                                    */
                                    if (this.lblScheduleDetails != null && this.lblScheduleDetails.Text != "" && TempControl.Name.Equals("PreviewBooking"))
                                        TempControl.Enabled = true;

                                    continue;
                                }

                                if (TempControl.Enabled != isEditable)
                                    TempControl.Enabled = isEditable;

                                //if (TempControl.Name.IndexOf("PreviewDetails_simpleButton") != -1 ||
                                //    TempControl.Name.IndexOf("CreateMeeting_simpleButton") != -1 ||
                                //    TempControl.Name.IndexOf("DeleteMeeting_simpleButton") != -1) {
                                //        if (TempControl.Tag != null && TempControl.Tag.ToString() == "HasMeeting")
                                //        {
                                //            if (TempControl.Name.IndexOf("DeleteMeeting_simpleButton") != -1)
                                //            {
                                //                if (lookUpEdit2.EditValue != null)
                                //                    TempControl.Enabled = isEditable;
                                //                else
                                //                    TempControl.Enabled = false;
                                //            }
                                //            else
                                //            {
                                //                TempControl.Enabled = isEditable;
                                //            }
                                //        }
                                //        else if(TempControl.Name.IndexOf("PreviewDetails_simpleButton") != -1) {
                                //            TempControl.Enabled = isEditable;
                                //        }
                                //    //Do Nothing
                                //} else {
                                //    TempControl.Enabled = isEditable;
                                //}
                            }
                            else if (TempControl is BaseEdit) {
                                //
                                var tagData = TempControl.Tag as ScheduleData;
                                if (TempControl.Name.IndexOf("SalesPerson_lookUpEdit") != -1 ||
                                    TempControl.Name.IndexOf("ScheduleType_comboBoxEdit") != -1 ||
                                    (tagData != null && tagData.IsMeeting)) {
                                        if (tagData.Name.Equals("ListOfBookingsAvailable"))
                                        {
                                            if (m_HasSchedules) {
                                                (TempControl as BaseEdit).Properties.ReadOnly = false;
                                                (TempControl as BaseEdit).Properties.AllowFocused = true;
                                            }
                                            else {
                                                (TempControl as BaseEdit).Properties.ReadOnly = true;
                                                (TempControl as BaseEdit).Properties.AllowFocused = false;
                                            }
                                        }
                                        else {
                                            (TempControl as BaseEdit).Properties.ReadOnly = true;
                                            (TempControl as BaseEdit).Properties.AllowFocused = false;
                                        }

                                    //(TempControl as BaseEdit).Properties.ReadOnly = true;
                                    //(TempControl as BaseEdit).Properties.AllowFocused = false;
                                }
                                else if (TempControl.Tag.Equals("ListOfBookingsAvailable")) {
                                    if (m_HasSchedules) {
                                        (TempControl as BaseEdit).Properties.ReadOnly = false;
                                        (TempControl as BaseEdit).Properties.AllowFocused = true;
                                    }
                                    else {
                                        (TempControl as BaseEdit).Properties.ReadOnly = true;
                                        (TempControl as BaseEdit).Properties.AllowFocused = false;
                                    }
                                }
                                else {
                                    (TempControl as BaseEdit).Properties.ReadOnly = !isEditable;
                                    (TempControl as BaseEdit).Properties.AllowFocused = isEditable;
                                }
                            }
                        }
                    }
                }
                Layout.EndUpdate();
            }

            //this.CreateMeeting.Enabled = isEditable;
            //this.DeleteMeeting.Enabled = isEditable;
            //this.simpleButton1.Enabled = isEditable;
        }