private static void ComputerCritical(LayerControl layerControl, EffectSplitterControl ctlsplit) { //computer critical value if (ctlsplit.Name == "splitter1") { if (layerControl.ctlEmphasis.Width < Constance.Effect.UnitWidth) { layerControl.plLeft.Width -= Constance.Effect.UnitWidth; } } else if (ctlsplit.Name == "splitter4") { if (layerControl.ctlEmphasis.Width < Constance.Effect.UnitWidth) { layerControl.plRight.Width -= Constance.Effect.UnitWidth; } } else if (ctlsplit.Name == "splitter2") { if (layerControl.ctlEntryEffect.Width < Constance.Effect.SplitterWidth) { layerControl.ctlEntryEffect.Width = Constance.Effect.SplitterWidth; } if (layerControl.ctlEmphasis.Width < Constance.Effect.UnitWidth) { layerControl.ctlEntryEffect.Width -= Constance.Effect.UnitWidth; } } else if (ctlsplit.Name == "splitter3") { if (layerControl.ctlExitEffect.Visible) { if (layerControl.ctlExitEffect.Width < Constance.Effect.SplitterWidth) { layerControl.ctlExitEffect.Width = Constance.Effect.SplitterWidth; } if (layerControl.ctlEmphasis.Width < Constance.Effect.UnitWidth) { layerControl.ctlExitEffect.Width -= Constance.Effect.UnitWidth; } } else { if (layerControl.ctlEmphasis.Width < Constance.Effect.UnitWidth) { layerControl.plRight.Width -= Constance.Effect.UnitWidth; } } } }
//Update effect control private static void ComputeEffectWidth(LayerControl layerControl, EffectSplitterControl ctlsplit) { int errorWidth = ctlsplit.OffSet % Constance.Effect.UnitWidth; if (ctlsplit.OffSet < Constance.Effect.UnitWidth) { errorWidth = ctlsplit.OffSet; } bool isRight = ctlsplit.IsRight; if (ctlsplit.Name == "splitter1") { if (isRight) { layerControl.plLeft.Width -= errorWidth; } else { layerControl.plLeft.Width += errorWidth; } } else if (ctlsplit.Name == "splitter4") { if (isRight) { layerControl.plRight.Width += errorWidth; } else { layerControl.plRight.Width -= errorWidth; } } else if (ctlsplit.Name == "splitter2") { if (isRight) { layerControl.ctlEntryEffect.Width -= errorWidth; } else { layerControl.ctlEntryEffect.Width += errorWidth; } } else if (ctlsplit.Name == "splitter3") { if (layerControl.ctlExitEffect.Visible) { if (isRight) { layerControl.ctlExitEffect.Width += errorWidth; } else { layerControl.ctlExitEffect.Width -= errorWidth; } } else { if (isRight) { layerControl.plRight.Width += errorWidth; } else { layerControl.plRight.Width -= errorWidth; } } } }