Beispiel #1
0
    private void ShowGemPropertyView()
    {
        labPropertys.text = string.Empty;
        Dictionary <EAttr, int> propertys = AttrHelper.GetAllGemPropertysByIndex(mCurIndex);

        GTItemHelper.ShowPropertyText(labPropertys, propertys, false);
    }
Beispiel #2
0
    public void ShowInfoByPos(EPosType posType, int pos)
    {
        this.mPos     = pos;
        this.mPosType = posType;
        bool isDress = (posType == EPosType.RoleGem);

        ShowDress(isDress);
        XGem gem    = GTDataManager.Instance.GetGemDataByPos(posType, pos);
        int  itemID = gem.Id;
        DGem gemDB  = ReadCfgGem.GetDataById(itemID);

        gemLevel.text      = GTTools.Format("等级 {0}", gem.StrengthenLevel);
        gemFightValue.text = GTTools.Format("战斗力 {0}", AttrHelper.GetFightValue(gem));
        ShowBaseView(itemID);
        GTItemHelper.ShowGemPropertyText(gemPropertys, itemID, gem.StrengthenLevel);
        DGemSuit suitDB        = ReadCfgGemSuit.GetDataById(gemDB.Suit);
        int      activeSuitNum = isDress ? GemModule.Instance.GetActiveSameSuitsCountByPos(pos) : 0;
        bool     hasSuit       = ReadCfgGemSuit.ContainsKey(gemDB.Suit);

        if (hasSuit)
        {
            ShowHasSuit(gemDB);
            ShowSuitPropertysView(activeSuitNum, suitDB);
            ShowSameSuitGemsView(gemDB.Id);
        }
        else
        {
            ShowNoSuit();
        }
    }
Beispiel #3
0
    public XCharacter GetMainPartner(int id)
    {
        if (id == 0)
        {
            return(null);
        }
        XPartner data = DataDBSPartner.GetDataById(id);

        if (data == null)
        {
            return(null);
        }
        XCharacter c  = new XCharacter();
        DActor     db = ReadCfgActor.GetDataById(id);

        c.Id    = id;
        c.Level = data.Level;
        c.Sex   = 0;
        c.Title = 0;
        c.Name  = db.Name;
        c.BaseAttr.Clear();
        c.CurrAttr.Clear();
        c.BaseAttr.AddRange(AttrHelper.GetPropertys(data).Values);
        for (int i = 0; i < c.BaseAttr.Count; i++)
        {
            c.CurrAttr.Add(c.BaseAttr[i]);
        }
        return(c);
    }
Beispiel #4
0
    private void ShowPropertys()
    {
        propertyTemplate.SetActive(false);
        XCharacter role = RoleModule.Instance.GetCurPlayer();
        Dictionary <EAttr, int> propertys = AttrHelper.GetPropertys(role);

        Dictionary <EAttr, int> .Enumerator em = propertys.GetEnumerator();
        while (em.MoveNext())
        {
            EAttr e = em.Current.Key;
            if ((int)e > 10)
            {
                continue;
            }
            ItemProperty item;
            if (!mPropertyItems.ContainsKey(e))
            {
                item = new ItemProperty();
                GameObject go = NGUITools.AddChild(propertyGrid.gameObject, propertyTemplate);
                item.propertyNum  = go.transform.Find("Num").GetComponent <UILabel>();
                item.propertyName = go.transform.Find("Name").GetComponent <UILabel>();
                go.SetActive(true);
                mPropertyItems.Add(e, item);
            }
            else
            {
                item = mPropertyItems[e];
            }
            DProperty db = ReadCfgProperty.GetDataById(em.Current.Key);
            item.propertyName.text = db.Name;
            item.propertyNum.text  = db.IsPercent == false?em.Current.Value.ToString() : (em.Current.Value / 100f).ToPercent();
        }
    }
Beispiel #5
0
    public void ShowInfoByPos(EPosType posType, int pos)
    {
        this.mPos     = pos;
        this.mPosType = posType;
        ShowDress(posType == EPosType.RoleEquip);
        XEquip equip = GTDataManager.Instance.GetEquipDataByPos(mPosType, mPos);

        if (equip == null)
        {
            return;
        }
        int itemID = equip.Id;

        ShowBaseView(itemID);
        equipFightValue.text   = GTTools.Format("战斗力 {0}", AttrHelper.GetFightValue(equip));
        equipAdvanceLevel.text = EquipModule.Instance.GetEquipAdvanceNameByLevel(equip.AdvanceLevel);
        Dictionary <EAttr, int> propertys = AttrHelper.GetPropertys(equip);

        title3.text = GTTools.Format("装备星级 {0}", equip.StarLevel);
        title2.text = GTTools.Format("进阶等级 {0}", equip.AdvanceLevel);
        title1.text = GTTools.Format("强化等级 {0}", equip.StrengthenLevel);
        GTItemHelper.ShowPropertyText(this.equipPropertys, propertys, true);
        GTItemHelper.ShowEquipStrengthText(text1, itemID, equip.StrengthenLevel);
        GTItemHelper.ShowEquipAdvanceText(text2, itemID, equip.AdvanceLevel);
        GTItemHelper.ShowEquipStarText(text3, itemID, equip.StarLevel);
    }
Beispiel #6
0
    private void ShowAdvanceView()
    {
        XEquip equip = GTDataManager.Instance.GetEquipDataByPos(mPosType, mPos);

        if (equip == null)
        {
            return;
        }
        int itemID = equip.Id;

        if (EquipModule.Instance.IsFullStarLevel(equip))
        {
            return;
        }
        GTItemHelper.ShowItemTexture(mEquipAdvance.nowEquipTexture, itemID);
        GTItemHelper.ShowItemQuality(mEquipAdvance.nowEquipQuality, itemID);
        GTItemHelper.ShowItemName(mEquipAdvance.nowEquipName, itemID);

        GTItemHelper.ShowItemTexture(mEquipAdvance.nexEquipTexture, itemID);
        GTItemHelper.ShowItemQuality(mEquipAdvance.nexEquipQuality, itemID);
        GTItemHelper.ShowItemName(mEquipAdvance.nexEquipName, itemID);

        Dictionary <EAttr, int> nowPropertys = AttrHelper.GetPropertys(equip);
        XEquip nexEquip = new XEquip();

        GTTools.Copy(nexEquip, equip);
        nexEquip.AdvanceLevel++;
        Dictionary <EAttr, int> nexPropertys = AttrHelper.GetPropertys(nexEquip);

        GTItemHelper.ShowPropertyText(mEquipAdvance.nowEquipPropertys, nowPropertys, false);
        GTItemHelper.ShowPropertyText(mEquipAdvance.nexEquipPropertys, nexPropertys, false);
        mEquipAdvance.nowEquipFightValue.text = AttrHelper.GetFightValue(nowPropertys).ToString();
        mEquipAdvance.nexEquipFightValue.text = AttrHelper.GetFightValue(nexPropertys).ToString();

        DEquip            equipDB = ReadCfgEquip.GetDataById(itemID);
        DEquipAdvanceCost db      = ReadCfgEquipAdvanceCost.GetDataById(equipDB.Quality * 1000 + equip.AdvanceLevel + 1);
        int hasItemNum            = GTDataManager.Instance.GetItemCountById(db.CostItemId);

        GTItemHelper.ShowItemTexture(mEquipAdvance.costItemTexture, db.CostItemId);
        GTItemHelper.ShowPriceText(mEquipAdvance.costItemNum, hasItemNum, db.CostItemNum);
        GTItemHelper.ShowItemQuality(mEquipAdvance.costItemQuality, itemID);
        if (db.CostEquipNum > 0)
        {
            mEquipAdvance.costEquipBtn.SetActive(true);
            GTItemHelper.ShowItemTexture(mEquipAdvance.costEquipTexture, itemID);
            GTItemHelper.ShowItemQuality(mEquipAdvance.costEquipQuality, itemID);
            int hasSameEquipNum = EquipModule.Instance.GetBagSameEquipList(equip).Count;
            GTItemHelper.ShowPriceText(mEquipAdvance.costEquipNum, hasSameEquipNum, db.CostEquipNum);
        }
        else
        {
            mEquipAdvance.costEquipBtn.SetActive(false);
        }
        GTItemHelper.ShowItemTexture(mEquipAdvance.costMoneyTexture, db.CostMoneyId);
        GTItemHelper.ShowItemNum(mEquipAdvance.costMoneyNum, db.CostMoneyNum);
        GTItemHelper.ShowEquipAdvanceText(mEquipAdvance.advanceText, itemID, equip.AdvanceLevel);
    }
Beispiel #7
0
    private void ShowStrengthenView()
    {
        XEquip equip = GTDataManager.Instance.GetEquipDataByPos(mPosType, mPos);

        if (equip == null)
        {
            return;
        }
        if (EquipModule.Instance.IsFullStrengthenLevel(equip) == true)
        {
            return;
        }
        int itemID = equip.Id;

        GTItemHelper.ShowItemTexture(mEquipStrengthen.equipTexture, itemID);
        GTItemHelper.ShowItemQuality(mEquipStrengthen.equipQuality, itemID);
        GTItemHelper.ShowItemName(mEquipStrengthen.equipName, itemID);

        int costEquipNum = mStrengthenCostItems.Count;

        for (int i = 0; i < mEquipStrengthen.mStrengthenItems.Count; i++)
        {
            ItemStrengthen cell = mEquipStrengthen.mStrengthenItems[i];
            if (i < costEquipNum)
            {
                XItem mat = mStrengthenCostItems[i];
                cell.Show(true);
                int id = mStrengthenCostItems[i].Id;
                GTItemHelper.ShowItemTexture(cell.itemTexture, id);
                GTItemHelper.ShowItemQuality(cell.itemQuality, id);
                GTItemHelper.ShowItemNum(cell.itemNum, mat.Num);
            }
            else
            {
                cell.Show(false);
            }
        }
        DEquip            equipDB = ReadCfgEquip.GetDataById(itemID);
        DEquipStrengLevel levelDB = ReadCfgEquipStrengLevel.GetDataById(equipDB.Quality * 1000 + equip.StrengthenLevel + 1);
        int addExpNum             = EquipModule.Instance.GetStrengthenExpByMatList(mStrengthenCostItems);

        GTItemHelper.ShowItemTexture(mEquipStrengthen.costMoneyTexture, DEquip.EQUIP_STRENGTHEN_MONEY_ID_1);
        mEquipStrengthen.costMoneyNum.text       = addExpNum.ToString();
        mEquipStrengthen.equipStrengthLevel.text = GTTools.Format("强化等级 {0}", equip.StrengthenLevel);
        GTItemHelper.ShowProgressText(mEquipStrengthen.equipStrengthExp, equip.StrengthenExp, levelDB.RequireExp);
        GTItemHelper.ShowProgressSlider(mEquipStrengthen.equipStrengthExpBar, equip.StrengthenExp, levelDB.RequireExp);
        Dictionary <EAttr, int> propertys = AttrHelper.GetPropertys(equip);

        GTItemHelper.ShowEquipStrengthText(mEquipStrengthen.strengthText, itemID, equip.StrengthenLevel);
        GTItemHelper.ShowPropertyText(mEquipStrengthen.propertyText, propertys, true);
    }
Beispiel #8
0
        override protected IListProcessor GetListWindowForType(Type type)
        {
            IListProcessor w = null;

            if (AttrHelper.IsSameOrSubclass(typeof(BaseProxyServer), type))
            {
                w = new JProxyServerListWindow();
            }
            else
            {
                w = base.GetListWindowForType(type);
            }
            return(w);
        }
Beispiel #9
0
    private void ShowView()
    {
        XPartner data = DataDBSPartner.GetDataById(mSelectID);

        if (data == null)
        {
            data = GTDataFactory.CreatePartner(mSelectID);
        }
        partnerLevel.text      = GTTools.Format("等级 {0}", data.Level);
        partnerExp.text        = GTTools.Format("{0}/{1}", data.Exp, 2500);
        partnerExpValue.value  = 0;
        partnerFightValue.text = GTTools.Format("战斗力:{0}", AttrHelper.GetFightValue(data));
        partnerWakeLevel.text  = GTTools.Format("觉醒 {0}", data.Wake);
        DActor db = ReadCfgActor.GetDataById(mSelectID);

        GTItemHelper.ShowQualityText(partnerName, db.Name, db.Quality);
    }
Beispiel #10
0
    private void ShowView()
    {
        for (int i = 0; i < mMoneyViewList.Count; i++)
        {
            MoneyView mv = mMoneyViewList[i];
            DItem     db = ReadCfgItem.GetDataById(i + 1);
            GTItemHelper.ShowItemTexture(mv.texture, db.Id);
            mv.labNum.text = GTDataManager.Instance.GetItemCountById(db.Id).ToString();
        }

        XCharacter role        = RoleModule.Instance.GetCurPlayer();
        DRoleLevel heroLevelDB = ReadCfgRoleLevel.GetDataById(role.Level);

        heroName.text    = role.Name;
        heroLevel.text   = GTTools.Format("等级 {0}", role.Level);
        heroVIP.text     = GTTools.Format("VIP {0}", role.VipLevel);
        heroExpNum.text  = GTTools.Format("{0}/{1}", role.CurExp, heroLevelDB.RequireExp);
        heroExpBar.value = role.CurExp / (heroLevelDB.RequireExp * 1f);

        int fightValue = AttrHelper.GetFightValue(role);

        heroFightValue.text = GTTools.Format("战斗力 {0}", fightValue);
    }
Beispiel #11
0
    public XCharacter GetMainPlayer()
    {
        XCharacter c = GetCurPlayer();

        c.Equips.Clear();
        Dictionary <int, XItem> .Enumerator em1 = DataDBSDressEquip.Dict.GetEnumerator();
        while (em1.MoveNext())
        {
            XEquip it = GTDataManager.Instance.GetEquipDataByPos(EPosType.RoleEquip, em1.Current.Value.Pos);
            if (it != null)
            {
                c.Equips.Add(it);
            }
        }
        em1.Dispose();

        c.Gems.Clear();
        Dictionary <int, XItem> .Enumerator em2 = DataDBSDressGem.Dict.GetEnumerator();
        while (em2.MoveNext())
        {
            XGem it = GTDataManager.Instance.GetGemDataByPos(EPosType.RoleGem, em1.Current.Value.Pos);
            if (it != null)
            {
                c.Gems.Add(it);
            }
        }
        em2.Dispose();

        c.BaseAttr.Clear();
        c.CurrAttr.Clear();
        c.BaseAttr.AddRange(AttrHelper.GetPropertys(c).Values);
        for (int i = 0; i < c.BaseAttr.Count; i++)
        {
            c.CurrAttr.Add(c.BaseAttr[i]);
        }
        return(c);
    }
Beispiel #12
0
        static public void CreateCefBrowser(BrowserPrivateType BrowserPrivateType, object LinkedObject, string WebEntityInfoPropertyName, string FileFullPath, ref UserControl viewControl)
        {
            WebEntryInfo webEntryInfo = null;

            if (LinkedObject != null)
            {
                IList <WebEntryInfoWrap> webEntryInfos = WebEntryInfo.GetWebEntryInfosFromObject(LinkedObject);
                if (webEntryInfos.Count > 1)
                {
                    if (WebEntityInfoPropertyName == null)
                    {
                        throw new Exception("WebEntityInfoPropertyName not set, but found more than one WebEntityInfo");
                    }
                    else
                    {
                        WebEntryInfoWrap webEntryInfoWrap = webEntryInfos.Where <WebEntryInfoWrap>(s => s.Property.Name == WebEntityInfoPropertyName).FirstOrDefault();
                        if (webEntryInfoWrap == null)
                        {
                            throw new Exception("Not found WebEntityInfo with specified name: " + WebEntityInfoPropertyName);
                        }
                        else
                        {
                            webEntryInfo = webEntryInfoWrap.WebEntryInfo;
                        }
                    }
                }
                else if (webEntryInfos.Count == 1)
                {
                    webEntryInfo = webEntryInfos[0].WebEntryInfo;
                }
            }
            else
            {
                webEntryInfo = new WebEntryInfo();
            }
            //if (viewControl == null || !(viewControl is EmbeddedBrowserControl))
            //{
            webEntryInfo.BrowserPrivateType = BrowserPrivateType;
            if (BrowserPrivateType == BrowserPrivateType.PERSONAL_OLD_DISK_CACHE
                //|| BrowserPrivateType == BrowserPrivateType.PERSONAL_NEW_DISK_CACHE
                )
            {
                string path = null;

                JActor actor = null;

                if (LinkedObject != null)
                {
                    var  pl = LinkedObject.GetType().GetProperties();
                    Type at = typeof(JActor);
                    foreach (var p in pl)
                    {
                        if (p.PropertyType == at)
                        {
                            actor = AttrHelper.GetPropertyValue(LinkedObject, p) as JActor;
                            break;
                        }
                    }
                }
                //PropertyInfo actorProperty = AttrHelper.GetProperty(typeof(JActor), LinkedObject.GetType());
                //if (actorProperty != null) actor = AttrHelper.GetPropertyValue(LinkedObject, actorProperty) as JActor;
                if (actor != null)
                {
                    path = Dm.Instance.GetCacheFullPathForObjectUniqueForCompAndUser(actor);
                }
                else
                {
                    path = Dm.Instance.GetCacheFullPathForObjectUniqueForCompAndUser(LinkedObject);
                }
                webEntryInfo.CachePath = path;
            }
            else if (BrowserPrivateType == BrowserPrivateType.COMMON_CACHE)
            {
                string path = Dm.Instance.GetBrowserCommonCachePathUniqueForCompAndUser();
                webEntryInfo.CachePath = path;
            }
            viewControl = new EmbeddedBrowserControl(FileFullPath, webEntryInfo, EmbeddedBrowserHelper.MultiThreadedMessageLoop);
        }
        override public List <ToolStripItem> CreateOpenInBrowserContextMenu(WebEntryInfo webEntryInfo, IContentContainer contentContainer, object selectedObject, string webEntityInfoPropertyName = null)
        {
            string url = webEntryInfo != null ? webEntryInfo.Url : null;

            ToolStripMenuItem    menuItem = null;
            List <ToolStripItem> subs     = new List <ToolStripItem>();
            List <ToolStripItem> subs1    = new List <ToolStripItem>();
            List <ToolStripItem> subs2    = null;


            if (string.IsNullOrEmpty(url) == false)
            {
                ViewType recоmmendedViewType = webEntryInfo.RecоmmendedViewType;

                bool isFile = false;
                bool isUrl  = false;
                FileUtils.IsFilePath(url, out isFile, out isUrl);
                string oTitle = isFile ? WebAccountLibRes.Path : WebAccountLibRes.URL;

                string uri = isFile? FileUtils.FilePathWithBookmarkToFileUrl(url) : url;

                if (isFile)
                {
                    if (recоmmendedViewType == ViewType.NONE)
                    {
                        recоmmendedViewType = GetViewTypeByFilePath(url);
                    }
                }
                else
                {
                    recоmmendedViewType = ViewType.CefBrowser;
                }

                //////////////////
                //open favorit
                /////////////////

                //default
                if (FileUtils.IsHtmlFileWithBookmark(url) && AppLocator.ChromePath != null)
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_Chrome;
                    menuItem.Font   = new Font(menuItem.Font, FontStyle.Bold);
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.ChromePath, uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs.Add(menuItem);
                }
                else
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in + " " + WebAccountLibRes.In_default_external_application;
                    menuItem.Font   = new Font(menuItem.Font, FontStyle.Bold);
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.OpenFile(url);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs.Add(menuItem);
                }



                //internal
                CreateOpenInInternalBrowserContextMenu(subs, ViewType.CefBrowser, recоmmendedViewType, BrowserPrivateType.PERSONAL_OLD_DISK_CACHE,
                                                       url, webEntryInfo, contentContainer, selectedObject, webEntityInfoPropertyName);
                //external
                if (isFile)
                {
                    //open folder
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_folder;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.OpenFile(FileUtils.GetDirectorNameForPath(url));
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs.Add(menuItem);
                }
                //////////////////////////////////
                OpenOtherTools(webEntryInfo, subs);


                //////////////////////////////
                ///internal browser

                subs2 = new List <ToolStripItem>();

                CreateOpenInInternalBrowserContextMenu(subs2, ViewType.CefBrowser, recоmmendedViewType, BrowserPrivateType.COMMON_CACHE,
                                                       url, webEntryInfo, contentContainer, selectedObject, webEntityInfoPropertyName);
                CreateOpenInInternalBrowserContextMenu(subs2, ViewType.CefBrowser, recоmmendedViewType, BrowserPrivateType.PERSONAL_OLD_DISK_CACHE,
                                                       url, webEntryInfo, contentContainer, selectedObject, webEntityInfoPropertyName);
                CreateOpenInInternalBrowserContextMenu(subs2, ViewType.CefBrowser, recоmmendedViewType, BrowserPrivateType.PERSONAL_IN_MEMORY_CACHE,
                                                       url, webEntryInfo, contentContainer, selectedObject, webEntityInfoPropertyName);

                string commonCachePath = Dm.Instance.GetBrowserCommonCachePathUniqueForCompAndUser();
                string objectCachepath = Dm.Instance.GetCacheFullPathForObjectUniqueForCompAndUser(selectedObject);
                menuItem      = new ToolStripMenuItem();
                menuItem.Text = WebAccountLibRes.Clear_browser_cache_for_entity;
                if (Directory.Exists(objectCachepath) == false)
                {
                    menuItem.Enabled = false;
                }
                menuItem.Click += (s, em) =>
                {
                    try
                    {
                        if (Directory.Exists(objectCachepath))
                        {
                            FileUtils.DeleteDirectory(objectCachepath);
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.ShowError(ex);
                    }
                };
                subs2.Add(menuItem);

                JActor actor = null;
                var    pl    = selectedObject.GetType().GetProperties();
                Type   at    = typeof(JActor);
                foreach (var p in pl)
                {
                    if (p.PropertyType == at)
                    {
                        actor = AttrHelper.GetPropertyValue(selectedObject, p) as JActor;
                        break;
                    }
                }
                if (actor != null)
                {
                    string actorCachepath = Dm.Instance.GetCacheFullPathForObjectUniqueForCompAndUser(actor);
                    menuItem      = new ToolStripMenuItem();
                    menuItem.Text = WebAccountLibRes.Clear_browser_cache_for_entity_actor;
                    if (Directory.Exists(actorCachepath) == false)
                    {
                        menuItem.Enabled = false;
                    }
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (Directory.Exists(actorCachepath))
                            {
                                FileUtils.DeleteDirectory(actorCachepath);
                            }
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }

                menuItem      = new ToolStripMenuItem();
                menuItem.Text = WebAccountLibRes.Clear_common_browser_cache;
                if (Directory.Exists(commonCachePath) == false)
                {
                    menuItem.Enabled = false;
                }
                menuItem.Click += (s, em) =>
                {
                    try
                    {
                        if (Directory.Exists(commonCachePath))
                        {
                            FileUtils.DeleteDirectory(commonCachePath);
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.ShowError(ex);
                    }
                };
                subs2.Add(menuItem);
                //open folder
                if (isFile)
                {
                    CreateOpenInInternalBrowserContextMenu(subs2, ViewType.Simple, recоmmendedViewType, BrowserPrivateType.COMMON_CACHE,
                                                           url, webEntryInfo, contentContainer, selectedObject, webEntityInfoPropertyName);
                    CreateOpenInInternalBrowserContextMenu(subs2, ViewType.WORD, recоmmendedViewType, BrowserPrivateType.COMMON_CACHE,
                                                           url, webEntryInfo, contentContainer, selectedObject, webEntityInfoPropertyName);
                }

                //level 1 menu - open
                menuItem      = new ToolStripMenuItem();
                menuItem.Text = WebAccountLibRes.Open_in_embedded_browser;
                menuItem.DropDownItems.AddRange(subs2.ToArray <ToolStripItem>());
                subs1.Add(menuItem);

                /////////////////////////////////
                /////Open in external browser
                //////////////////////////////

                //open external app level 2
                subs2 = new List <ToolStripItem>();
                if (AppLocator.EdgePath != null)
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_Microsoft_Edge;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            //open local files (or local uri to file) not supported
                            //https://stackoverflow.com/questions/34798285/how-can-i-open-a-local-html-file-in-microsoft-edge-browser
                            ProcessUtils.ExecuteProgram("cmd.exe", "/c start microsoft-edge:" + url);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }
                if (AppLocator.InternetExplorerPath != null)
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_IE__deprecated_;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.InternetExplorerPath, uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);

                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_IE__deprecated_ + " (" + WebAccountLibRes.private_mode + ")";
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            //InPrivate Browsing helps prevent your browsing history, temporary Internet files, form data, cookies, and user names and passwords from being retained by the browser. You can start InPrivate Browsing from the Safety menu, by pressing Ctrl+Shift+P, or from the New Tab page. Internet Explorer will launch a new browser session that won’t keep any information about webpages you visit or searches you perform. Closing the browser window will end your InPrivate Browsing session.
                            ProcessUtils.ExecuteProgram(AppLocator.InternetExplorerPath, "-private " + uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }
                if (AppLocator.ChromePath != null)
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_Chrome;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.ChromePath, uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_Chrome + " (" + WebAccountLibRes.private_mode + ")";
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.ChromePath, "-incognito " + uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }
                if (AppLocator.FirefoxPath != null)
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_FireFox;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.FirefoxPath, uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }
                if (AppLocator.FirefoxProtablePath != null && File.Exists(AppLocator.FirefoxProtablePath))
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_FireFox + " " + WebAccountLibRes.Portable;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.FirefoxProtablePath, uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }
                if (AppLocator.ChromeProtablePath != null && File.Exists(AppLocator.ChromeProtablePath))
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_Chrome + " " + WebAccountLibRes.Portable;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.ChromeProtablePath, uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }
                if (AppLocator.OperaPath != null)
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_Opera;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.OperaPath, uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }
                if (AppLocator.SafariPath != null)
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_Safary;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;
                            ProcessUtils.ExecuteProgram(AppLocator.SafariPath, uri);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }
                if (webEntryInfo.Url != null && webEntryInfo.Login != null)
                {
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Open_in_IE__KeeForm__and_try_to_autocomplate_web_form__ + webEntryInfo.Login;
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            if (CheckIfWeNeedVPN(webEntryInfo) == false)
                            {
                                return;
                            }
                            AppManager.Instance.CurrentWebEntryInfo = webEntryInfo;

                            StringBuilder args = new StringBuilder();
                            args.Append(webEntryInfo.Url);
                            args.Append(" ");
                            args.Append(webEntryInfo.Login);
                            args.Append(" ");
                            args.Append(webEntryInfo.Password != null ? webEntryInfo.Password : "******");
                            if (webEntryInfo.Password != null)
                            {
                                args.Append(" ");
                                //args.Append("{TAB}{TAB}{ENTERFORM}");
                                args.Append("{ENTERFORM}");
                            }
                            Console.WriteLine("Args: " + args.ToString());
                            ProcessUtils.ExecuteProgram("KeeForm.exe", args.ToString());
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs2.Add(menuItem);
                }

                //level 1 menu - open
                menuItem      = new ToolStripMenuItem();
                menuItem.Text = WebAccountLibRes.Open_in_external + "...";
                menuItem.DropDownItems.AddRange(subs2.ToArray <ToolStripItem>());
                subs1.Add(menuItem);

                OpenInOtherBrowsers(webEntryInfo, uri, subs1);


                //level 0 menu - open
                menuItem      = new ToolStripMenuItem();
                menuItem.Text = WebAccountLibRes.Open_in + "...";
                menuItem.DropDownItems.AddRange(subs1.ToArray <ToolStripItem>());
                subs.Add(menuItem);

                //copy url
                menuItem        = new ToolStripMenuItem();
                menuItem.Text   = WebAccountLibRes.Copy + " " + oTitle + " " + WebAccountLibRes.to_clipboard + ": " + (url.Length <= 50 ? url : (url.Substring(0, 50) + "..."));
                menuItem.Click += (s, em) =>
                {
                    try
                    {
                        Clipboard.Clear();
                        Clipboard.SetText(url, TextDataFormat.Text);
                    }
                    catch (Exception ex)
                    {
                        Log.ShowError(ex);
                    }
                };
                subs.Add(menuItem);
                if (url.Equals(uri) == false)
                {
                    //copy uri
                    menuItem        = new ToolStripMenuItem();
                    menuItem.Text   = WebAccountLibRes.Copy + " " + oTitle + " " + WebAccountLibRes.to_clipboard + ": " + (uri.Length <= 50 ? uri : (uri.Substring(0, 50) + "..."));
                    menuItem.Click += (s, em) =>
                    {
                        try
                        {
                            Clipboard.Clear();
                            Clipboard.SetText(uri, TextDataFormat.Text);
                        }
                        catch (Exception ex)
                        {
                            Log.ShowError(ex);
                        }
                    };
                    subs.Add(menuItem);
                }
            }

            //////////////login password
            if (webEntryInfo != null && webEntryInfo.Login != null)
            {
                menuItem         = new ToolStripMenuItem();
                menuItem.Text    = WebAccountLibRes.Copy_login_to_clipboard + ": " + webEntryInfo.Login;
                menuItem.Enabled = !string.IsNullOrEmpty(webEntryInfo.Login);
                menuItem.Click  += (s, em) =>
                {
                    try
                    {
                        Clipboard.Clear();
                        Clipboard.SetText(webEntryInfo.Login, TextDataFormat.Text);
                    }
                    catch (Exception ex)
                    {
                        Log.ShowError(ex);
                    }
                };
                subs.Add(menuItem);
            }

            if (webEntryInfo != null && webEntryInfo.Password != null)
            {
                menuItem         = new ToolStripMenuItem();
                menuItem.Text    = WebAccountLibRes.Copy_password_to_clipboard;
                menuItem.Enabled = !string.IsNullOrEmpty(webEntryInfo.Password);
                menuItem.Click  += (s, em) =>
                {
                    try
                    {
                        Clipboard.Clear();
                        Clipboard.SetText(webEntryInfo.Password, TextDataFormat.Text);
                    }
                    catch (Exception ex)
                    {
                        Log.ShowError(ex);
                    }
                };
                subs.Add(menuItem);
            }

            return(subs);
        }