public void Init(IBlogPostImageDataContext dataContext) { _imageDataContext = dataContext; // initialization constants const int TOP_INSET = 2; imageTabPageImage = new ImageTabPageImageControl() ; imageTabPageLayout = new ImageTabPageLayoutControl() ; imageTabPageEffects = new ImageTabPageEffectsControl() ; imageTabPageUpload = new ImageTabPageUploadControl() ; _tabPages = new ImageEditingTabPageControl[]{imageTabPageLayout, imageTabPageImage, imageTabPageEffects, imageTabPageUpload}; for(int i=0; i<_tabPages.Length; i++) { ImageEditingTabPageControl tabPage = _tabPages[i]; tabPage.DecoratorsManager = dataContext.DecoratorsManager; tabPage.TabStop = false ; tabPage.TabIndex = i ; Controls.Add( tabPage ) ; tabLightweightControl.SetTab( i, tabPage ) ; } // initial appearance of editor tabLightweightControl.SelectedTabNumber = 0 ; InitializeCommands(); InitializeToolbar(); _imageDataContext.DecoratorsManager.GetImageDecorator(BrightnessDecorator.Id).Command.StateChanged += new EventHandler(Command_StateChanged); // configure primary workspace // configure primary workspace SuspendLayout() ; TopLayoutMargin = TOP_INSET; LeftColumn.UpperPane.LightweightControl = tabLightweightControl; CenterColumn.Visible = false; RightColumn.Visible = false; ResumeLayout() ; }
public void Init(IBlogPostImageDataContext dataContext) { _imageDataContext = dataContext; // initialization constants const int TOP_INSET = 2; imageTabPageImage = new ImageTabPageImageControl(); imageTabPageLayout = new ImageTabPageLayoutControl(); imageTabPageEffects = new ImageTabPageEffectsControl(); imageTabPageUpload = new ImageTabPageUploadControl(); _tabPages = new ImageEditingTabPageControl[] { imageTabPageLayout, imageTabPageImage, imageTabPageEffects, imageTabPageUpload }; for (int i = 0; i < _tabPages.Length; i++) { ImageEditingTabPageControl tabPage = _tabPages[i]; tabPage.DecoratorsManager = dataContext.DecoratorsManager; tabPage.TabStop = false; tabPage.TabIndex = i; Controls.Add(tabPage); tabLightweightControl.SetTab(i, tabPage); } // initial appearance of editor tabLightweightControl.SelectedTabNumber = 0; InitializeCommands(); InitializeToolbar(); _imageDataContext.DecoratorsManager.GetImageDecorator(BrightnessDecorator.Id).Command.StateChanged += new EventHandler(Command_StateChanged); // configure primary workspace // configure primary workspace SuspendLayout(); TopLayoutMargin = TOP_INSET; LeftColumn.UpperPane.LightweightControl = tabLightweightControl; CenterColumn.Visible = false; RightColumn.Visible = false; ResumeLayout(); }