Ejemplo n.º 1
0
            public static void WorkModeMenuItem_Click(object sender, bool bySoft)
            {
                var it       = sender as ToolStripMenuItem;
                var parentIt = it.OwnerItem as ToolStripMenuItem;
                var mode     = (WorkModeEnum)it.Tag;
                var nick     = parentIt.Tag.ToString();

                if (bySoft)
                {
                    WorkModeMenuItemHelper.SetWorkMode(it, parentIt, mode, nick);
                }
                else
                {
                    var premode = WorkModeHelper.GetWorkMode(nick);
                    Util.Assert(premode > WorkModeEnum.Unknown);
                    if (premode != mode)
                    {
                        if (premode == WorkModeEnum.NoUse)
                        {
                            WorkModeMenuItemHelper.SetWorkMode(it, parentIt, mode, nick);
                        }
                        else
                        {
                            WorkModeMenuItemHelper.CloseWorkMode(premode, nick);
                            WorkModeMenuItemHelper.SetWorkMode(it, parentIt, mode, nick);
                        }
                    }
                }
            }
Ejemplo n.º 2
0
        public static void Create(CtlNotifyIcon ctlNotifyIcon, string nick)
        {
            var it = ctlNotifyIcon.CreateItem(nick, null, null, true, nick);

            ctlNotifyIcon.InsertItem(2, it);
            var workMode = WorkModeHelper.GetWorkMode(nick);

            CreateMenuItem(ctlNotifyIcon, it, nick, workMode);
        }
Ejemplo n.º 3
0
        private static void DealLoginReturn(LoginDownloadEntity loginInfo, List <string> nicks)
        {
            var nickDatas = loginInfo.NickDatas;

            for (int k = 0; k < nickDatas.Count; k++)
            {
                var nick = nickDatas[k];
                Util.Assert(!string.IsNullOrEmpty(nick));
                var workMode = WorkModeHelper.GetWorkMode(nick);
                if (workMode == WorkModeEnum.Assist)
                {
                    ReadDataFromDb(nick); //init data
                }
            }
            //从服务器同步数据
            DbSyner.Syn();

            WndNotifyIcon.Inst.AddSellerMenuItem(loginInfo.NickDatas); // create icon menu

            if (loginInfo.UpdateEntity != null)
            {
                ClientUpdater.UpdateForTip(loginInfo.UpdateEntity);
            }
        }