Ejemplo n.º 1
0
 internal void SwitchOpenClose(bool byClick)
 {
     if (byClick && (DateTime.Now - deactivatedTime).TotalMilliseconds < 200)
     {
         //By click on notifyicon the menu gets deactivated and closed
     }
     else if (string.IsNullOrEmpty(Config.Path))
     {
         //Case when Folder Dialog open
     }
     else if (openCloseState == OpenCloseState.Opening ||
              menus[0].Visible && openCloseState == OpenCloseState.Default)
     {
         openCloseState = OpenCloseState.Closing;
         MenusFadeOut();
         StopWorker();
         if (!AsEnumerable.Any(m => m.Visible))
         {
             openCloseState = OpenCloseState.Default;
         }
     }
     else
     {
         openCloseState = OpenCloseState.Opening;
         LoadStarted(this, true);
         StartWorker();
     }
     deactivatedTime = DateTime.MinValue;
 }
Ejemplo n.º 2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is OpenCloseState))
            {
                throw new ArgumentException("invalid value");
            }
            OpenCloseState stateValue = (OpenCloseState)value;

            return(Enum.GetName(typeof(OpenCloseState), stateValue));
        }
Ejemplo n.º 3
0
        public UserProfile(UserId Uuid, string Name)
        {
            this.Uuid = Uuid;
            this.Name = Name;

            LastModifiedTimestamp = 0;

            AccountState    = OpenCloseState.Closed;
            OnlinePlayState = OpenCloseState.Closed;

            UpdateTimestamp();
        }
Ejemplo n.º 4
0
 private void MenusFadeOut()
 {
     openCloseState = OpenCloseState.Closing;
     AsList.ForEach(menu =>
     {
         if (menu.Level > 0)
         {
             menus[menu.Level] = null;
         }
         menu.HideWithFade();
     });
 }
Ejemplo n.º 5
0
        public UserProfile(UInt128 uuid, string name)
        {
            Uuid = uuid;
            Name = name;

            LastModifiedTimestamp = 0;

            AccountState    = OpenCloseState.Closed;
            OnlinePlayState = OpenCloseState.Closed;

            UpdateTimestamp();
        }
Ejemplo n.º 6
0
    void OnOpenCloseClick()
    {
        if (m_openCloseState != OpenCloseState.Moving)
        {
            if (m_openCloseState == OpenCloseState.Opened)
            {
                SetButtonsPosition(false, true);
            }
            else
            {
                SetButtonsPosition(true, true);
            }

            m_openCloseState = OpenCloseState.Moving;
        }
    }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is OpenCloseState))
            {
                throw new ArgumentException("invalid value");
            }
            OpenCloseState stateValue = (OpenCloseState)value;

            if (stateValue == OpenCloseState.CLOSE)
            {
                return(new SolidColorBrush(Colors.Red));
            }
            else
            {
                return(new SolidColorBrush(Colors.Green));
            }
        }
Ejemplo n.º 8
0
        private void MenuVisibleChanged(object sender, EventArgs e)
        {
            Menu menu = (Menu)sender;

            if (menu.IsUsable)
            {
                AdjustMenusSizeAndLocation();
                if (menu.Level == 0)
                {
                    menus[0].AdjustSizeAndLocation();
                }
            }
            if (!menu.Visible)
            {
                DisposeMenu(menu);
            }
            if (!AsEnumerable.Any(m => m.Visible))
            {
                openCloseState = OpenCloseState.Default;
            }
        }
Ejemplo n.º 9
0
 public void OnCloseComplete()
 {
     m_openCloseState = OpenCloseState.Closed;
 }
Ejemplo n.º 10
0
 public void OnOpenComplete()
 {
     m_openCloseState = OpenCloseState.Opened;
 }