コード例 #1
0
        internal bool ScaleUpInternal()
        {
            // If there is no previous scale index, we start at the zeroth index
            if (_lastScalingIndex == -2)
            {
                ScaleMaxInternal();
                return(true);
            }

            // We are already at the Max Scale so there is nothing to do
            if (_lastScalingIndex == -1)
            {
                return(false);
            }

            List <ScalingStep> steps = _scalingInfo.StepsInternal;

            ScalingStep step  = (ScalingStep)steps[_lastScalingIndex];
            Group       group = (Group)GetChild(step.GroupId);

            // We pass "null" for the PopupSize because we are scaling to the previous layout
            // This implies that it is not the smallest one and therefore hopefully not a popup.
            // If it is a popup, then passing in null like this will simply cause us to use
            // the default popup size for this scaling template.
            // The scenario that we are punting on here then is default popup sizes for popup
            // scale steps that are not the last one in the scaling sequence for a group.
            // This will practially never happen and even if it does, we'll just fall back
            // the the default behavior.  O14:611435
            group.SelectLayout(step.PreviousLayoutName, null);

            // Update the step that we are on
            _lastScalingIndex--;
            return(true);
        }
コード例 #2
0
 public void AddScalingStepAtIndex(ScalingStep step, int index)
 {
     if (_steps.Contains(step))
     {
         throw new InvalidOperationException("This ScalingInfo already contains this ScaleStep");
     }
     _steps.Insert(index, step);
     step.SetParent(this);
     _dirty = true;
 }
コード例 #3
0
        public void AddScalingStep(ScalingStep step)
        {
            if (CUIUtility.IsNullOrUndefined(step))
            {
                throw new ArgumentNullException("step must be definined and not null");
            }
            if (string.IsNullOrEmpty(GetGroupMaxSize(step.GroupId)))
            {
                throw new InvalidOperationException("You must set the GroupMaxSize of Group: "
                                                    + step.GroupId + " before you add ScalingSteps for it");
            }

            AddScalingStepAtIndex(step, _steps.Count);
        }
コード例 #4
0
        internal bool ScaleDownInternal()
        {
            // If there is no previous scale index, we start at the zeroth index
            if (_lastScalingIndex == -2)
            {
                ScaleMax();
                return(true);
            }

            List <ScalingStep> steps = _scalingInfo.StepsInternal;

            // If we are already at the smallest scale, then return.
            if (steps.Count <= _lastScalingIndex + 1)
            {
                return(false);
            }

            // Go down one scale smaller
            _lastScalingIndex++;
            ScalingStep step  = (ScalingStep)steps[_lastScalingIndex];
            Group       group = (Group)GetChild(step.GroupId);

#if DEBUG
            // Hack to disable these alert in Ja-Jp Pseudo builds - O14:628489
            if (!(Title.StartsWith("[") && Title.EndsWith("]")))
            {
                if (step.HasScaleWarning)
                {
                    Browser.Window.Alert("Tab Scale Warning hit for:\nTab: " + Id +
                                         "\nGroup: " + group.Id +
                                         "\nSize: " + step.LayoutName +
                                         "\nMessage: " + step.ScaleWarningMessage);
                }
            }
#endif
            group.SelectLayout(step.LayoutName, step.PopupSize);

            return(true);
        }
コード例 #5
0
 public void RemoveScalingStep(ScalingStep step)
 {
     _steps.Remove(step);
     step.SetParent(null);
     _dirty = true;
 }
コード例 #6
0
ファイル: scaling.cs プロジェクト: modulexcite/IL2JS
 public void RemoveScalingStep(ScalingStep step)
 {
     _steps.Remove(step);
     step.SetParent(null);
     _dirty = true;
 }
コード例 #7
0
ファイル: scaling.cs プロジェクト: modulexcite/IL2JS
 public void AddScalingStepAtIndex(ScalingStep step, int index)
 {
     if (_steps.Contains(step))
         throw new InvalidOperationException("This ScalingInfo already contains this ScaleStep");
     _steps.Insert(index, step);
     step.SetParent(this);
     _dirty = true;
 }
コード例 #8
0
ファイル: scaling.cs プロジェクト: modulexcite/IL2JS
        public void AddScalingStep(ScalingStep step)
        {
            if (CUIUtility.IsNullOrUndefined(step))
                throw new ArgumentNullException("step must be definined and not null");
            if (string.IsNullOrEmpty(GetGroupMaxSize(step.GroupId)))
                throw new InvalidOperationException("You must set the GroupMaxSize of Group: "
                                       + step.GroupId + " before you add ScalingSteps for it");

            AddScalingStepAtIndex(step, _steps.Count);
        }