Exemplo n.º 1
0
 private void setProgress(ImageStates state, string information, bool external, string picture)
 {
     if (_progressUpdatedExternally && !external)
     {
         return;
     }
     if (picture == null)
     {
         picture = _progressPicture;
     }
     if (pictureBoxWorking.ImageLocation != picture)
     {
         pictureBoxWorking.ImageLocation = picture;
         pictureBoxWorking.Refresh();
     }
     pictureBoxRed.Visible     = state == ImageStates.Red;
     pictureMoose.Visible      = state == ImageStates.Green;
     pictureBoxGray.Visible    = state == ImageStates.None;
     pictureBoxWorking.Visible = state == ImageStates.Progress;
     _toolTipProvider.SetToolTip(pictureBoxWorking, information);
     if (!external)
     {
         _lastInternalState = state;
     }
 }
Exemplo n.º 2
0
 private void send(ImageStates state, string information)
 {
     _dispatch("picture-update", new {
         state       = state.ToString().ToLower(),
         information = information
     });
 }
Exemplo n.º 3
0
 /// <summary>
 /// Value copy from the provided source to ourself.
 /// </summary>
 /// <param name="source">Source instance.</param>
 public virtual void CopyFrom(ButtonSpec source)
 {
     // Copy class specific values
     Image = source.Image;
     ImageTransparentColor = source.ImageTransparentColor;
     ImageStates.CopyFrom(source.ImageStates);
     Text                  = source.Text;
     ExtraText             = source.ExtraText;
     AllowInheritImage     = source.AllowInheritImage;
     AllowInheritText      = source.AllowInheritText;
     AllowInheritExtraText = source.AllowInheritExtraText;
     ColorMap              = source.ColorMap;
     Style                 = source.Style;
     Orientation           = source.Orientation;
     Edge                  = source.Edge;
     ProtectedType         = source.ProtectedType;
 }
Exemplo n.º 4
0
        private void setProgress(ImageStates state, string information, bool external, string picture, bool force)
        {
            if (!force && _progressUpdatedExternally && !external)
            {
                return;
            }
            if (picture == null)
            {
                picture = _progressPicture;
            }

            _updatePicture(picture, state, information);

            if (!external)
            {
                _lastInternalState = state;
            }
        }
Exemplo n.º 5
0
 private void setProgress(ImageStates state, string information, bool external, string picture, bool force)
 {
     if (!force && _progressUpdatedExternally && !external)
         return;
     if (picture == null)
         picture = _progressPicture;
     if (pictureBoxWorking.ImageLocation != picture)
     {
         pictureBoxWorking.ImageLocation = picture;
         pictureBoxWorking.Refresh();
     }
     pictureBoxRed.Visible = state == ImageStates.Red;
     pictureMoose.Visible = state == ImageStates.Green;
     pictureBoxGray.Visible = state == ImageStates.None;
     pictureBoxWorking.Visible = state == ImageStates.Progress;
     _toolTipProvider.SetToolTip(pictureBoxWorking, information);
     if (!external)
         _lastInternalState = state;
 }
Exemplo n.º 6
0
 private void setProgress(ImageStates state, string information, bool external, string picture)
 {
     setProgress(state, information, external, picture, false);
 }
Exemplo n.º 7
0
 public void SetProgress(bool on, string information, ImageStates imageState)
 {
     _progressUpdatedExternally = on;
     setProgress(imageState, information, true, null);
 }
Exemplo n.º 8
0
 public void SetProgress(bool on, string information, ImageStates imageState)
 {
     _progressUpdatedExternally = on;
     var state = _lastInternalState;
     //TODO WTF this sets state and doesnt use it?
     if (on)
         state = ImageStates.Progress;
     setProgress(imageState, information, true, null);
 }
Exemplo n.º 9
0
 private void send(ImageStates state, string information) {
     _dispatch("picture-update", new {
         state = state.ToString().ToLower(),
         information = information
     });
 }
Exemplo n.º 10
0
 public void SetProgress(bool on, string information, ImageStates imageState)
 {
     _progressUpdatedExternally = on;
     setProgress(imageState, information, true, null);
 }
        private static object GetIconUriForMethod(string methodName, IShellCommand command, ImageStates imageState)
        {
            switch (methodName)
            {
                case "Save":
                    if (imageState == ImageStates.MouseOver)
                    {
                        return IconSaveLargeHover;
                    }
                    if (imageState == ImageStates.SmallMouseOver)
                    {
                        return IconSaveSmallHover;
                    }
                    if ((imageState != ImageStates.Small) && (imageState != ImageStates.SmallDisabled))
                    {
                        return IconSaveLarge;
                    }
                    return IconSaveSmall;

                case "Refresh":
                    if (imageState == ImageStates.MouseOver)
                    {
                        return IconRefreshLargeHover;
                    }
                    if (imageState == ImageStates.SmallMouseOver)
                    {
                        return IconRefreshSmallHover;
                    }
                    if ((imageState != ImageStates.Small) && (imageState != ImageStates.SmallDisabled))
                    {
                        return IconRefreshLarge;
                    }
                    return IconRefreshSmall;

                case "CustomizeScreen":
                    if (imageState == ImageStates.MouseOver)
                    {
                        return IconCustomizeLargeHover;
                    }
                    if (imageState == ImageStates.SmallMouseOver)
                    {
                        return IconCustomizeSmallHover;
                    }
                    if ((imageState != ImageStates.Small) && (imageState != ImageStates.SmallDisabled))
                    {
                        return IconCustomizeLarge;
                    }
                    return IconCustomizeSmall;
            }
            if (command.Image != null)
            {
                return command.Image;
            }
            if (imageState == ImageStates.MouseOver)
            {
                return IconPlaceholderLargeHover;
            }
            if (imageState == ImageStates.SmallMouseOver)
            {
                return IconPlaceholderSmallHover;
            }
            if ((imageState != ImageStates.Small) && (imageState != ImageStates.SmallDisabled))
            {
                return IconPlaceholderLarge;
            }
            return IconPlaceholderSmall;
        }
 private static object DetermineImageSourceForCommand(IShellCommand shellCommand, ImageStates imageState)
 {
     PlaceholderCommand command = shellCommand as PlaceholderCommand;
     if (command != null)
     {
         return GetIconUriForMethod(command.ScreenMethodName, shellCommand, imageState);
     }
     if (shellCommand == null)
     {
         return null;
     }
     IScreenCommand executableObject = shellCommand.ExecutableObject as IScreenCommand;
     if (executableObject != null)
     {
         return GetIconUriForMethod(executableObject.GetModel().Name, shellCommand, imageState);
     }
     if (shellCommand.Group == ShellCommandGroupNames.Customize)
     {
         return GetIconUriForMethod("CustomizeScreen", shellCommand, imageState);
     }
     if (shellCommand.Image == null)
     {
         return GetIconUriForMethod("Placeholder", shellCommand, imageState);
     }
     return shellCommand.Image;
 }
Exemplo n.º 13
0
 private void setProgress(ImageStates state, string information, bool external, string picture)
 {
     setProgress(state, information, external, picture, false);
 }
Exemplo n.º 14
0
        private void setProgress(ImageStates state, string information, bool external, string picture, bool force)
        {
            _imageStateChange(state, information);
            if (!force && _progressUpdatedExternally && !external)
                return;
            if (picture == null)
                picture = _progressPicture;

            _updatePicture(picture, state, information);

            if (!external)
                _lastInternalState = state;
        }