示例#1
0
        private void ColorPalette_Load(object sender, EventArgs e)
        {
            _colorFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen", "ColorPalette.xml");

            if (File.Exists(_colorFilePath))
            {
                Load_ColorPaletteFile();
                PopulateColors();
            }
            else
            {
                //VIX-2163
                listViewColors.LargeImageList = new ImageList {
                    ColorDepth = ColorDepth.Depth32Bit, ImageSize = _imageSize
                };
            }

            _curveLibrary = ApplicationServices.Get <IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary;
            if (_curveLibrary != null)
            {
                Populate_Curves();
                _curveLibrary.CurveChanged += CurveLibrary_CurveChanged;
            }

            _colorGradientLibrary = ApplicationServices.Get <IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary;
            if (_colorGradientLibrary != null)
            {
                Populate_Gradients();
                _colorGradientLibrary.GradientChanged += GradientLibrary_GradientChanged;
            }
        }
示例#2
0
        private void ColorPalette_Load(object sender, EventArgs e)
        {
            colorFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen", "ColorPalette.xml");

            if (File.Exists(colorFilePath))
            {
                Load_ColorPaletteFile();
                PopulateColors();
            }

            _curveLibrary = ApplicationServices.Get <IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary;
            if (_curveLibrary != null)
            {
                Populate_Curves();
                _curveLibrary.CurveChanged += CurveLibrary_CurveChanged;
            }

            _colorGradientLibrary = ApplicationServices.Get <IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary;
            if (_colorGradientLibrary != null)
            {
                Populate_Gradients();
                _colorGradientLibrary.GradientChanged += GradientLibrary_GradientChanged;
            }

            comboBoxGradientHandling.SelectedIndex = 0;
        }
示例#3
0
 private void ColorPalette_Load(object sender, EventArgs e)
 {
     _colorGradientLibrary = ApplicationServices.Get <IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary;
     if (_colorGradientLibrary != null)
     {
         Populate_Gradients();
         _colorGradientLibrary.GradientChanged += GradientLibrary_GradientChanged;
     }
 }
示例#4
0
        public Form_GradientLibrary(TimelineControl timelineControl)
        {
            InitializeComponent();
            TimelineControl = timelineControl;
            Icon            = Resources.Icon_Vixen3;
            ThemeUpdateControls.UpdateControls(this);
            toolStripGradients.Renderer = new ThemeToolStripRenderer();
            int iconSize = (int)(16 * ScalingTools.GetScaleFactor());

            toolStripGradients.ImageScalingSize = new Size(iconSize, iconSize);

            toolStripButtonEditGradient.DisplayStyle    = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditGradient.Image           = Tools.GetIcon(Resources.configuration, iconSize);
            toolStripButtonNewGradient.DisplayStyle     = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewGradient.Image            = Tools.GetIcon(Resources.addItem, iconSize);
            toolStripButtonDeleteGradient.DisplayStyle  = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteGradient.Image         = Tools.GetIcon(Resources.delete_32, iconSize);
            toolStripButtonExportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonExportGradients.Image        = Tools.GetIcon(Resources.folder_go, iconSize);
            toolStripButtonImportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonImportGradients.Image        = Tools.GetIcon(Resources.folder_open, iconSize);

            listViewGradients.AllowDrop = true;

            var xml = new XMLProfileSettings();

            _gradientLibraryTextScale  = Convert.ToDouble(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/GradientLibraryTextScale", Name), "1"), CultureInfo.InvariantCulture);
            _gradientLibraryImageScale = Convert.ToDouble(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/GradientLibraryImageScale", Name), "1"), CultureInfo.InvariantCulture);

            if (_gradientLibraryTextScale < 0.2)
            {
                _gradientLibraryTextScale = 0.2;
            }
            if (_gradientLibraryImageScale < 0.1)
            {
                _gradientLibraryImageScale = 0.1;
            }
            ImageSetup();

            ThemeUpdateControls.UpdateControls(this);
            //Over-ride the auto theme listview back color
            listViewGradients.BackColor = ThemeColorTable.BackgroundColor;
            _colorGradientLibrary       = ApplicationServices.Get <IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary;
        }
示例#5
0
		private void ColorPalette_Load(object sender, EventArgs e)
		{
			_colorFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen", "ColorPalette.xml");

			if (File.Exists(_colorFilePath))
			{
				Load_ColorPaletteFile();
				PopulateColors();
			}

			_curveLibrary = ApplicationServices.Get<IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary;
			if (_curveLibrary != null)
			{
				Populate_Curves();
				_curveLibrary.CurveChanged += CurveLibrary_CurveChanged;
			}

			_colorGradientLibrary = ApplicationServices.Get<IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary;
			if (_colorGradientLibrary != null)
			{
				Populate_Gradients();
				_colorGradientLibrary.GradientChanged += GradientLibrary_GradientChanged;
			}
			
		}
示例#6
0
        private void TimedSequenceEditorForm_Load(object sender, EventArgs e)
        {
            settingsPath =
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen",
                               "TimedSequenceEditorForm.xml");
            ColorCollectionsPath =
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen",
                               "ColorCollections.xml");

            if (File.Exists(settingsPath))
            {
                dockPanel.LoadFromXml(settingsPath, new DeserializeDockContent(DockingPanels_GetContentFromPersistString));
            }
            else
            {
                GridForm.Show(dockPanel);
                ToolsForm.Show(dockPanel, DockState.DockLeft);
                MarksForm.Show(dockPanel, DockState.DockLeft);
                EffectsForm.Show(dockPanel, DockState.DockLeft);
            }

            XMLProfileSettings xml = new XMLProfileSettings();

            //Get preferences
            _autoSaveTimer.Interval = xml.GetSetting(XMLProfileSettings.SettingType.Preferences, string.Format("{0}/AutoSaveInterval", Name), 300000);

            //Restore App Settings
            dockPanel.DockLeftPortion = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockLeftPortion", Name), 150);
            dockPanel.DockRightPortion = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockRightPortion", Name), 150);
            autoSaveToolStripMenuItem.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AutoSaveEnabled", Name), true);
            toolStripButton_SnapTo.Checked = toolStripMenuItem_SnapTo.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapToSelected", Name), true);
            PopulateSnapStrength(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings,	string.Format("{0}/SnapStrength", Name), 2));
            toolStripMenuItem_ResizeIndicator.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorEnabled", Name),false);
            toolStripButton_DrawMode.Checked = TimelineControl.grid.EnableDrawMode = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DrawModeSelected", Name), false);
            toolStripButton_SelectionMode.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SelectionModeSelected", Name), true);
            ToolsForm.LinkCurves = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkCurves", Name), false);
            ToolsForm.LinkGradients = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkGradients", Name), false);
            cADStyleSelectionBoxToolStripMenuItem.Checked = TimelineControl.grid.aCadStyleSelectionBox = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CadStyleSelectionBox", Name), false);
            CheckRiColorMenuItem(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorColor", Name), "Red"));

            foreach (ToolStripItem toolStripItem in toolStripDropDownButton_SnapToStrength.DropDownItems)
            {
                var toolStripMenuItem = toolStripItem as ToolStripMenuItem;
                if (toolStripMenuItem != null)
                {
                    if(TimelineControl.grid.SnapStrength.Equals(Convert.ToInt32(toolStripMenuItem.Tag)))
                    {
                        toolStripMenuItem.PerformClick();
                        break;
                    }
                }
            }

            WindowState = FormWindowState.Normal;

            if (xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name),
                "Normal").Equals("Maximized"))
            {
                WindowState = FormWindowState.Maximized;
            }
            else
            {
                var desktopBounds = new Rectangle(new Point(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X),
                                xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y)),new Size(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width),
                            xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height)));
                if (IsVisibleOnAnyScreen(desktopBounds))
                {
                    DesktopBounds = desktopBounds;
                }
            }

            _effectNodeToElement = new Dictionary<EffectNode, Element>();
            _elementNodeToRows = new Dictionary<ElementNode, List<Row>>();

            TimelineControl.grid.RenderProgressChanged += OnRenderProgressChanged;

            TimelineControl.ElementChangedRows += ElementChangedRowsHandler;
            TimelineControl.ElementsMovedNew += timelineControl_ElementsMovedNew;
            TimelineControl.ElementDoubleClicked += ElementDoubleClickedHandler;
            TimelineControl.DataDropped += timelineControl_DataDropped;
            TimelineControl.ColorDropped += timelineControl_ColorDropped;
            TimelineControl.CurveDropped += timelineControl_CurveDropped;
            TimelineControl.GradientDropped += timelineControl_GradientDropped;

            TimelineControl.PlaybackCurrentTimeChanged += timelineControl_PlaybackCurrentTimeChanged;

            TimelineControl.RulerClicked += timelineControl_RulerClicked;
            TimelineControl.RulerBeginDragTimeRange += timelineControl_RulerBeginDragTimeRange;
            TimelineControl.RulerTimeRangeDragged += timelineControl_TimeRangeDragged;

            TimelineControl.MarkMoved += timelineControl_MarkMoved;
            TimelineControl.DeleteMark += timelineControl_DeleteMark;

            EffectsForm.EscapeDrawMode += EscapeDrawMode;

            MarksForm.MarkCollectionChecked += MarkCollection_Checked;
            MarksForm.EditMarkCollection += MarkCollection_Edit;
            MarksForm.ChangedMarkCollection += MarkCollection_Changed;

            ToolsForm.StartColorDrag += ToolPalette_ColorDrag;
            ToolsForm.StartCurveDrag += ToolPalette_CurveDrag;
            ToolsForm.StartGradientDrag += ToolPalette_GradientDrag;

            TimelineControl.SelectionChanged += TimelineControlOnSelectionChanged;
            TimelineControl.grid.MouseDown += TimelineControl_MouseDown;
            TimeLineSequenceClipboardContentsChanged += TimelineSequenceTimeLineSequenceClipboardContentsChanged;
            TimelineControl.CursorMoved += CursorMovedHandler;
            TimelineControl.ElementsSelected += timelineControl_ElementsSelected;
            TimelineControl.ContextSelected += timelineControl_ContextSelected;
            TimelineControl.SequenceLoading = false;
            TimelineControl.TimePerPixelChanged += TimelineControl_TimePerPixelChanged;
            TimelineControl.grid.SelectedElementsCloneDelegate = CloneElements;
            TimelineControl.grid.StartDrawMode += DrawElement;

            _virtualEffectLibrary =
                ApplicationServices.Get<IAppModuleInstance>(VirtualEffectLibraryDescriptor.Guid) as
                VirtualEffectLibrary;

            _curveLibrary = ApplicationServices.Get<IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary;
            if (_curveLibrary != null)
            {
                _curveLibrary.CurveChanged += CurveLibrary_CurveChanged;
            }

            _colorGradientLibrary = ApplicationServices.Get<IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary;
            if (_colorGradientLibrary != null)
            {
                _colorGradientLibrary.GradientChanged += ColorGradientLibrary_CurveChanged;
            }

            LoadAvailableEffects();
            PopulateDragBoxFilterDropDown();
            InitUndo();
            updateButtonStates();
            UpdatePasteMenuStates();
            LoadVirtualEffects();
            LoadColorCollections();

            _library = ApplicationServices.Get<IAppModuleInstance>(LipSyncMapDescriptor.ModuleID) as LipSyncMapLibrary;

            #if DEBUG
            ToolStripButton b = new ToolStripButton("[Debug Break]");
            b.Click += b_Click;
            toolStripOperations.Items.Add(b);
            #endif
        }
示例#7
0
        private void TimedSequenceEditorForm_Load(object sender, EventArgs e)
        {
            _settingsPath =
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen",
                    "TimedSequenceEditorForm.xml");
            _colorCollectionsPath =
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen",
                    "ColorCollections.xml");

            if (File.Exists(_settingsPath))
            {
                try
                {
                    //Try to load the dock settings fro ma file. Somehow users manage to corrupt this file, so if it can be used
                    //Then just reconfigure to the defaults.
                    dockPanel.LoadFromXml(_settingsPath, DockingPanels_GetContentFromPersistString);
                }
                catch (Exception ex)
                {
                    DestroyAndRecreateDockPanel(ex);
                }
            }
            else
            {
                SetDockDefaults();
            }

            if (GridForm.IsHidden)
            {
                GridForm.DockState = DockState.Document;
            }

            if (EffectEditorForm.DockState == DockState.Unknown)
            {
                EffectEditorForm.Show(dockPanel, DockState.DockRight);
            }

            if (LayerEditor.DockState == DockState.Unknown)
            {
                LayerEditor.Show(dockPanel, DockState.DockRight);
            }

            XMLProfileSettings xml = new XMLProfileSettings();

            //Get preferences
            _autoSaveTimer.Interval = xml.GetSetting(XMLProfileSettings.SettingType.Preferences, string.Format("{0}/AutoSaveInterval", Name), 300000);

            //Restore App Settings
            dockPanel.DockLeftPortion = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockLeftPortion", Name), 150);
            dockPanel.DockRightPortion = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockRightPortion", Name), 150);
            autoSaveToolStripMenuItem.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AutoSaveEnabled", Name), true);
            toolStripButton_SnapTo.Checked = toolStripMenuItem_SnapTo.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapToSelected", Name), true);
            PopulateSnapStrength(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapStrength", Name), 2));
            TimelineControl.grid.CloseGap_Threshold = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CloseGapThreshold", Name), ".100");
            AlignTo_Threshold = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AlignToThreshold", Name), ".800");
            toolStripMenuItem_ResizeIndicator.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorEnabled", Name), false);
            toolStripButton_DrawMode.Checked = TimelineControl.grid.EnableDrawMode = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DrawModeSelected", Name), false);
            toolStripButton_SelectionMode.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SelectionModeSelected", Name), true);
            ToolsForm.LinkCurves = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkCurves", Name), false);
            ToolsForm.LinkGradients = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkGradients", Name), false);
            cADStyleSelectionBoxToolStripMenuItem.Checked = TimelineControl.grid.aCadStyleSelectionBox = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CadStyleSelectionBox", Name), false);
            CheckRiColorMenuItem(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorColor", Name), "Red"));
            zoomUnderMousePositionToolStripMenuItem.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ZoomUnderMousePosition", Name), false);
            TimelineControl.waveform.Height = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WaveFormHeight", Name), 50);
            TimelineControl.ruler.Height = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/RulerHeight", Name), 50);

            foreach (ToolStripItem toolStripItem in toolStripDropDownButton_SnapToStrength.DropDownItems)
            {
                var toolStripMenuItem = toolStripItem as ToolStripMenuItem;
                if (toolStripMenuItem != null)
                {
                    if (TimelineControl.grid.SnapStrength.Equals(Convert.ToInt32(toolStripMenuItem.Tag)))
                    {
                        toolStripMenuItem.PerformClick();
                        break;
                    }
                }
            }

            foreach (ToolStripItem toolStripItem in toolStripSplitButton_CloseGaps.DropDownItems)
            {
                var toolStripMenuItem = toolStripItem as ToolStripMenuItem;
                if (toolStripMenuItem != null)
                {
                    if (TimelineControl.grid.CloseGap_Threshold.Equals(toolStripMenuItem.Tag))
                    {
                        toolStripMenuItem.PerformClick();
                        break;
                    }
                }
            }

            foreach (ToolStripItem toolStripItem in toolStripDropDownButton_AlignTo.DropDownItems)
            {
                var toolStripMenuItem = toolStripItem as ToolStripMenuItem;
                if (toolStripMenuItem != null)
                {
                    if (AlignTo_Threshold.Equals(toolStripMenuItem.ToString()))
                    {
                        toolStripMenuItem.PerformClick();
                        break;
                    }
                }
            }

            WindowState = FormWindowState.Normal;

            var desktopBounds =
                new Rectangle(
                    new Point(
                        xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X),
                        xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y)),
                    new Size(
                        xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width),
                        xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height)));

            var windowState =
                    xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name), "Normal");

            if (IsVisibleOnAnyScreen(desktopBounds))
            {
                StartPosition = FormStartPosition.Manual;
                DesktopBounds = desktopBounds;

                if (windowState.Equals("Maximized"))
                {
                    WindowState = FormWindowState.Maximized;
                }

            }
            else
            {
                // this resets the upper left corner of the window to windows standards
                StartPosition = FormStartPosition.WindowsDefaultLocation;

                if (windowState.Equals("Minimized"))
                {
                    //Somehow we were closed in a minimized state. All bets are off, so put use back in some sensible default.
                    WindowState = FormWindowState.Normal;
                    // this resets the upper left corner of the window to windows standards
                    StartPosition = FormStartPosition.WindowsDefaultLocation;
                    Size = new Size(800, 600);
                }
                else
                {
                    // we can still apply the saved size
                    Size = new Size(desktopBounds.Width, desktopBounds.Height);
                }
            }

            _effectNodeToElement = new Dictionary<EffectNode, Element>();
            _elementNodeToRows = new Dictionary<ElementNode, List<Row>>();

            TimelineControl.grid.RenderProgressChanged += OnRenderProgressChanged;

            TimelineControl.ElementChangedRows += ElementChangedRowsHandler;
            TimelineControl.ElementsMovedNew += timelineControl_ElementsMovedNew;
            TimelineControl.ElementDoubleClicked += ElementDoubleClickedHandler;
            //TimelineControl.DataDropped += timelineControl_DataDropped;

            TimelineControl.PlaybackCurrentTimeChanged += timelineControl_PlaybackCurrentTimeChanged;

            TimelineControl.RulerClicked += timelineControl_RulerClicked;
            TimelineControl.RulerBeginDragTimeRange += timelineControl_RulerBeginDragTimeRange;
            TimelineControl.RulerTimeRangeDragged += timelineControl_TimeRangeDragged;

            TimelineControl.MarkMoved += timelineControl_MarkMoved;
            TimelineControl.DeleteMark += timelineControl_DeleteMark;

            TimelineControl.SelectionChanged += TimelineControlOnSelectionChanged;
            TimelineControl.grid.MouseDown += TimelineControl_MouseDown;
            TimeLineSequenceClipboardContentsChanged += TimelineSequenceTimeLineSequenceClipboardContentsChanged;
            TimelineControl.CursorMoved += CursorMovedHandler;
            TimelineControl.ElementsSelected += timelineControl_ElementsSelected;
            TimelineControl.ContextSelected += timelineControl_ContextSelected;
            TimelineControl.SequenceLoading = false;
            TimelineControl.TimePerPixelChanged += TimelineControl_TimePerPixelChanged;
            TimelineControl.VisibleTimeStartChanged += TimelineControl_VisibleTimeStartChanged;
            TimelineControl.grid.SelectedElementsCloneDelegate = CloneElements;
            TimelineControl.grid.StartDrawMode += DrawElement;
            TimelineControl.grid.DragOver += TimelineControlGrid_DragOver;
            TimelineControl.grid.DragEnter += TimelineControlGrid_DragEnter;
            TimelineControl.grid.DragDrop += TimelineControlGrid_DragDrop;
            Row.RowHeightChanged += TimeLineControl_Row_RowHeightChanged;

            _curveLibrary = ApplicationServices.Get<IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary;
            if (_curveLibrary != null)
            {
                _curveLibrary.CurveChanged += CurveLibrary_CurveChanged;
            }

            _colorGradientLibrary =
                ApplicationServices.Get<IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary;
            if (_colorGradientLibrary != null)
            {
                _colorGradientLibrary.GradientChanged += ColorGradientLibrary_CurveChanged;
            }

            LoadAvailableEffects();
            PopulateDragBoxFilterDropDown();
            InitUndo();
            UpdateButtonStates();
            UpdatePasteMenuStates();
            LoadColorCollections();

            _library = ApplicationServices.Get<IAppModuleInstance>(LipSyncMapDescriptor.ModuleID) as LipSyncMapLibrary;
            Cursor.Current = Cursors.Default;
            if (_sequence.DefaultSplitterDistance != 0)
            {
                TimelineControl.splitContainer.SplitterDistance = _sequence.DefaultSplitterDistance;
            }
            else
            {
                TimelineControl.splitContainer.SplitterDistance = (int) (TimelineControl.DefaultSplitterDistance*_scaleFactor);
            }

            if (_sequence.DefaultPlaybackEndTime != TimeSpan.Zero)
            {
                _mPrevPlaybackStart = TimelineControl.PlaybackStartTime = _sequence.DefaultPlaybackStartTime;
                _mPrevPlaybackEnd = TimelineControl.PlaybackEndTime = _sequence.DefaultPlaybackEndTime;
            }

            #if DEBUG
            ToolStripButton b = new ToolStripButton("[Debug Break]");
            b.Click += b_Click;
            toolStripOperations.Items.Add(b);
            #endif
        }