private object ViewItemBackgroundColorChangedReceiver(VideoOS.Platform.Messaging.Message message, FQID sender, FQID related)
 {
     SCToolbarPluginDefinition.ColorMessageData colorMessageData = message.Data as SCToolbarPluginDefinition.ColorMessageData;
     if (colorMessageData != null)
     {
         if (colorMessageData.ViewItemInstanceFQID.Equals(_viewItemInstance.FQID) && colorMessageData.WindowFQID.Equals(_window.FQID))
         {
             if (colorMessageData.Color == _color)
             {
                 Enabled = false;
             }
             else
             {
                 Enabled = true;
             }
         }
     }
     return(null);
 }
Exemplo n.º 2
0
        private object SetViewItemBackgroundColorReceiver(Message message, FQID sender, FQID related)
        {
            List <Item> mipViewItems     = WindowInformation.ViewAndLayoutItem.GetChildren();
            Item        viewItemInstance = mipViewItems[int.Parse(_viewItemManager.FQID.ObjectIdString)];

            SCToolbarPluginDefinition.ColorMessageData colorMessageData = message.Data as SCToolbarPluginDefinition.ColorMessageData;
            if (colorMessageData != null)
            {
                if ((colorMessageData.ViewItemInstanceFQID == null || colorMessageData.ViewItemInstanceFQID.Equals(viewItemInstance.FQID)) &&
                    (colorMessageData.WindowFQID == null || colorMessageData.WindowFQID.Equals(WindowInformation.Window.FQID)))
                {
                    BackColor = colorMessageData.Color;

                    Message changeMessage = new Message(SCToolbarPluginDefinition.ViewItemBackgroundColorChanged);
                    changeMessage.Data = new SCToolbarPluginDefinition.ColorMessageData()
                    {
                        Color = BackColor, ViewItemInstanceFQID = viewItemInstance.FQID, WindowFQID = WindowInformation.Window.FQID
                    };
                    EnvironmentManager.Instance.SendMessage(changeMessage);
                }
            }
            return(null);
        }