Beispiel #1
0
 public void NotifyServerMessage(NotifyCode code, string msg)
 {
     if (code == NotifyCode.ERROR)
     {
         this.LogManager.AddLog(LogType.ERROR, msg, new object[0]);
         return;
     }
     this.LogManager.AddLog(LogType.INFO, msg, new object[0]);
 }
Beispiel #2
0
        public override void Notify(NotifyCode code)
        {
            switch (code)
            {
            case NotifyCode.ImageListChanging:
                // Are we using the group level imagelist?
                if (_tabbedGroups.ImageList == _tabControl.ImageList)
                {
                    // Then remove its use
                    _tabControl.ImageList = null;
                }
                break;

            case NotifyCode.ImageListChanged:
                // If no imagelist defined
                if (_tabControl.ImageList == null)
                {
                    // Then use the group level one
                    _tabControl.ImageList = _tabbedGroups.ImageList;
                }
                break;

            case NotifyCode.StyleChanged:
                // Update tab control with new style
                _tabControl.Style = _tabbedGroups.Style;
                break;

            case NotifyCode.DisplayTabMode:
                // Apply the latest mode
                switch (_tabbedGroups.DisplayTabMode)
                {
                case Crownwood.Magic.Controls.TabbedGroups.DisplayTabModes.ShowAll:
                    _tabControl.HideTabsMode = Magic.Controls.TabControl.HideTabsModes.ShowAlways;
                    break;

                case Crownwood.Magic.Controls.TabbedGroups.DisplayTabModes.HideAll:
                    _tabControl.HideTabsMode = Magic.Controls.TabControl.HideTabsModes.HideAlways;
                    break;

                case Crownwood.Magic.Controls.TabbedGroups.DisplayTabModes.ShowActiveLeaf:
                    _tabControl.HideTabsMode = (_tabbedGroups.ActiveLeaf == this ? Magic.Controls.TabControl.HideTabsModes.ShowAlways :
                                                Magic.Controls.TabControl.HideTabsModes.HideAlways);
                    break;

                case Crownwood.Magic.Controls.TabbedGroups.DisplayTabModes.ShowMouseOver:
                    _tabControl.HideTabsMode = Magic.Controls.TabControl.HideTabsModes.HideWithoutMouse;
                    break;

                case Crownwood.Magic.Controls.TabbedGroups.DisplayTabModes.ShowActiveAndMouseOver:
                    _tabControl.HideTabsMode = (_tabbedGroups.ActiveLeaf == this ? Magic.Controls.TabControl.HideTabsModes.ShowAlways :
                                                Magic.Controls.TabControl.HideTabsModes.HideWithoutMouse);
                    break;
                }
                break;
            }
        }
Beispiel #3
0
        public override void Notify(NotifyCode code)
        {
            // Handle codes of interest
            switch (code)
            {
            case NotifyCode.ProminentChanged:
            case NotifyCode.MinimumSizeChanged:
                // Must reposition to take account of change
                RepositionChildren();
                break;

            case NotifyCode.StyleChanged:
                // Inform each resize bar of change in style
                foreach (Control c in _control.Controls)
                {
                    if (c is ResizeBar)
                    {
                        (c as ResizeBar).Style = _tabbedGroups.Style;
                    }
                }

                // Reposition the children based on new resize bar size
                RepositionChildren();
                break;

            case NotifyCode.ResizeBarVectorChanged:
                // Recalculate layout of childreen
                RepositionChildren();
                break;

            case NotifyCode.ResizeBarColorChanged:
                // If we are showing at least one resize bar
                if (_children.Count > 1)
                {
                    // Then must repaint in new color
                    _control.Invalidate();
                }
                break;
            }

            // Pass notification to children
            foreach (TabGroupBase child in _children)
            {
                child.Notify(code);
            }
        }
Beispiel #4
0
 // Common methods not implemented
 public abstract void Notify(NotifyCode code);
Beispiel #5
0
 public override void Notify(NotifyCode code)
 {
     switch(code)
     {
         case NotifyCode.ImageListChanging:
             // Are we using the group level imagelist?
             if (_tabbedGroups.ImageList == _tabControl.ImageList)
             {
                 // Then remove its use
                 _tabControl.ImageList = null;
             }
             break;
         case NotifyCode.ImageListChanged:
             // If no imagelist defined
             if (_tabControl.ImageList == null)
             {
                 // Then use the group level one
                 _tabControl.ImageList = _tabbedGroups.ImageList;
             }
             break;
         case NotifyCode.StyleChanged:
             // Update tab control with new style
             _tabControl.Style = _tabbedGroups.Style;
             break;
         case NotifyCode.DisplayTabMode:
             // Apply the latest mode
             switch(_tabbedGroups.DisplayTabMode)
             {
                 case SharpClient.UI.Controls.TabbedGroups.DisplayTabModes.ShowAll:
                     _tabControl.HideTabsMode = SharpClient.UI.Controls.TabControl.HideTabsModes.ShowAlways;
                     break;
                 case SharpClient.UI.Controls.TabbedGroups.DisplayTabModes.HideAll:
                     _tabControl.HideTabsMode = SharpClient.UI.Controls.TabControl.HideTabsModes.HideAlways;
                     break;
                 case SharpClient.UI.Controls.TabbedGroups.DisplayTabModes.ShowActiveLeaf:
                     _tabControl.HideTabsMode = (_tabbedGroups.ActiveLeaf == this ? SharpClient.UI.Controls.TabControl.HideTabsModes.ShowAlways :
                                                                                    SharpClient.UI.Controls.TabControl.HideTabsModes.HideAlways);
                     break;
                 case SharpClient.UI.Controls.TabbedGroups.DisplayTabModes.ShowMouseOver:
                     _tabControl.HideTabsMode = SharpClient.UI.Controls.TabControl.HideTabsModes.HideWithoutMouse;
                     break;
                 case SharpClient.UI.Controls.TabbedGroups.DisplayTabModes.ShowActiveAndMouseOver:
                     _tabControl.HideTabsMode = (_tabbedGroups.ActiveLeaf == this ? SharpClient.UI.Controls.TabControl.HideTabsModes.ShowAlways :
                                                                                    SharpClient.UI.Controls.TabControl.HideTabsModes.HideWithoutMouse);
                     break;
             }
             break;
     }
 }
Beispiel #6
0
        public override void Notify(NotifyCode code)
        {
            // Handle codes of interest
            switch(code)
            {
                case NotifyCode.ProminentChanged:
                case NotifyCode.MinimumSizeChanged:
                    // Must reposition to take account of change
                    RepositionChildren();
                    break;
                case NotifyCode.StyleChanged:
                    // Inform each resize bar of change in style
                    foreach(Control c in _control.Controls)
                        if (c is ResizeBar)
                            (c as ResizeBar).Style = _tabbedGroups.Style;

                    // Reposition the children based on new resize bar size
                    RepositionChildren();
                    break;
                case NotifyCode.ResizeBarVectorChanged:
                    // Recalculate layout of childreen
                    RepositionChildren();
                    break;
                case NotifyCode.ResizeBarColorChanged:
                    // If we are showing at least one resize bar
                    if (_children.Count > 1)
                    {
                        // Then must repaint in new color
                        _control.Invalidate();
                    }
                    break;
            }

            // Pass notification to children
            foreach(TabGroupBase child in _children)
                child.Notify(code);
        }
Beispiel #7
0
 // Common methods not implemented
 public abstract void Notify(NotifyCode code);
 /// <summary>
 /// Set Notify Message
 /// </summary>
 /// <param name="moduleId">modelid</param>
 /// <param name="msgcode">message code to pick in resx</param>
 /// <param name="result">result code</param>
 /// <param name="resxpath">resx folder path of the message</param>
 public static void SetNotfiyMessage(int moduleId, String msgcode, NotifyCode result, String resxpath = "")
 {
     if (resxpath == "") resxpath = StoreSettings.NBrightBuyPath() + "/App_LocalResources/Notification.ascx.resx";
     if (msgcode != "")
     {
         var sessionkey = "NBrightBuyNotify*" + moduleId.ToString("");
         HttpContext.Current.Session[sessionkey] = msgcode + "_" + result;
         sessionkey = "NBrightBuyNotify*" + moduleId.ToString("") + "*resxpath";
         HttpContext.Current.Session[sessionkey] = resxpath;
     }
 }
Beispiel #9
0
 public AdminReportNotifyMessage(NotifyCode code, string msg)
 {
     this.Code    = code;
     this.Message = msg;
 }