public MtProductService(ICacheManager cacheManager,
     IRepository<Product> productRepository,
     IRepository<RelatedProduct> relatedProductRepository,
     IRepository<CrossSellProduct> crossSellProductRepository,
     IRepository<TierPrice> tierPriceRepository,
     IRepository<ProductPicture> productPictureRepository,
     IRepository<LocalizedProperty> localizedPropertyRepository,
     IRepository<AclRecord> aclRepository,
     IRepository<StoreMapping> storeMappingRepository,
     IRepository<ProductSpecificationAttribute> productSpecificationAttributeRepository,
     IRepository<ProductReview> productReviewRepository,
     IRepository<ProductWarehouseInventory> productWarehouseInventoryRepository,
     IProductAttributeService productAttributeService,
     IProductAttributeParser productAttributeParser,
     ILanguageService languageService,
     IWorkflowMessageService workflowMessageService,
     IDataProvider dataProvider,
     IDbContext dbContext,
     IWorkContext workContext,
     IStoreContext storeContext,
     LocalizationSettings localizationSettings,
     CommonSettings commonSettings,
     CatalogSettings catalogSettings,
     IEventPublisher eventPublisher,
     IAclService aclService,
     IStoreMappingService storeMappingService)
 {
     this._cacheManager = cacheManager;
     this._productRepository = productRepository;
     this._relatedProductRepository = relatedProductRepository;
     this._crossSellProductRepository = crossSellProductRepository;
     this._tierPriceRepository = tierPriceRepository;
     this._productPictureRepository = productPictureRepository;
     this._localizedPropertyRepository = localizedPropertyRepository;
     this._aclRepository = aclRepository;
     this._storeMappingRepository = storeMappingRepository;
     this._productSpecificationAttributeRepository = productSpecificationAttributeRepository;
     this._productReviewRepository = productReviewRepository;
     this._productWarehouseInventoryRepository = productWarehouseInventoryRepository;
     this._productAttributeService = productAttributeService;
     this._productAttributeParser = productAttributeParser;
     this._languageService = languageService;
     this._workflowMessageService = workflowMessageService;
     this._dataProvider = dataProvider;
     this._dbContext = dbContext;
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._localizationSettings = localizationSettings;
     this._commonSettings = commonSettings;
     this._catalogSettings = catalogSettings;
     this._eventPublisher = eventPublisher;
     this._aclService = aclService;
     this._storeMappingService = storeMappingService;
 }
        /// <summary>
        /// Maps a common settings
        /// </summary>
        /// <param name="commonParserSettings">Common parser settings</param>
        /// <param name="commonMinifierSettings">Common minifier settings</param>
        protected static void MapCommonSettings(CommonSettings commonParserSettings,
			MsAjaxCommonMinificationSettingsBase commonMinifierSettings)
        {
            commonParserSettings.BlocksStartOnSameLine = Utils.GetEnumFromOtherEnum<WmmBlockStart, MsBlockStart>(
                commonMinifierSettings.BlocksStartOnSameLine);
            commonParserSettings.IgnoreAllErrors = commonMinifierSettings.IgnoreAllErrors;
            commonParserSettings.IgnoreErrorList = commonMinifierSettings.IgnoreErrorList;
            commonParserSettings.IndentSize = commonMinifierSettings.IndentSize;
            commonParserSettings.LineBreakThreshold = commonMinifierSettings.LineBreakThreshold;
            commonParserSettings.OutputMode = Utils.GetEnumFromOtherEnum<WmmOutputMode, MsOutputMode>(
                commonMinifierSettings.OutputMode);
            commonParserSettings.PreprocessorDefineList = commonMinifierSettings.PreprocessorDefineList;
            commonParserSettings.TermSemicolons = commonMinifierSettings.TermSemicolons;
        }
        /// <summary>
        /// Maps a common minifier settings
        /// </summary>
        /// <param name="originalSettings">Original common minifier settings</param>
        /// <param name="settings">Common minifier settings</param>
        protected static void MapCommonSettings(CommonSettings originalSettings,
			NUglifyCommonMinificationSettingsBase settings)
        {
            originalSettings.BlocksStartOnSameLine = Utils.GetEnumFromOtherEnum<WmmBlockStart, NuBlockStart>(
                settings.BlocksStartOnSameLine);
            originalSettings.IgnoreAllErrors = settings.IgnoreAllErrors;
            originalSettings.IgnoreErrorList = settings.IgnoreErrorList;
            originalSettings.IndentSize = settings.IndentSize;
            originalSettings.LineBreakThreshold = settings.LineBreakThreshold;
            originalSettings.OutputMode = Utils.GetEnumFromOtherEnum<WmmOutputMode, NuOutputMode>(
                settings.OutputMode);
            originalSettings.PreprocessorDefineList = settings.PreprocessorDefineList;
            originalSettings.TermSemicolons = settings.TermSemicolons;
            originalSettings.WarningLevel = 2;
        }
 public CommonModelFactory(ICategoryService categoryService,
                           IProductService productService,
                           IManufacturerService manufacturerService,
                           ITopicService topicService,
                           ILanguageService languageService,
                           ICurrencyService currencyService,
                           ILocalizationService localizationService,
                           IWorkContext workContext,
                           IStoreContext storeContext,
                           ISitemapGenerator sitemapGenerator,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IWebHelper webHelper,
                           IPermissionService permissionService,
                           IStaticCacheManager cacheManager,
                           IPageHeadBuilder pageHeadBuilder,
                           IPictureService pictureService,
                           IHostingEnvironment hostingEnvironment,
                           IUrlHelperFactory urlHelperFactory,
                           IActionContextAccessor actionContextAccessor,
                           CatalogSettings catalogSettings,
                           StoreInformationSettings storeInformationSettings,
                           CommonSettings commonSettings,
                           BlogSettings blogSettings,
                           NewsSettings newsSettings,
                           ForumSettings forumSettings,
                           LocalizationSettings localizationSettings,
                           CaptchaSettings captchaSettings,
                           VendorSettings vendorSettings,
                           IProductTagService productTagService,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           INopFileProvider fileProvider)
 {
     this._categoryService         = categoryService;
     this._productService          = productService;
     this._manufacturerService     = manufacturerService;
     this._topicService            = topicService;
     this._languageService         = languageService;
     this._currencyService         = currencyService;
     this._localizationService     = localizationService;
     this._workContext             = workContext;
     this._storeContext            = storeContext;
     this._sitemapGenerator        = sitemapGenerator;
     this._themeContext            = themeContext;
     this._themeProvider           = themeProvider;
     this._forumservice            = forumService;
     this._genericAttributeService = genericAttributeService;
     this._webHelper                        = webHelper;
     this._permissionService                = permissionService;
     this._cacheManager                     = cacheManager;
     this._pageHeadBuilder                  = pageHeadBuilder;
     this._pictureService                   = pictureService;
     this._hostingEnvironment               = hostingEnvironment;
     this._urlHelperFactory                 = urlHelperFactory;
     this._actionContextAccessor            = actionContextAccessor;
     this._catalogSettings                  = catalogSettings;
     this._storeInformationSettings         = storeInformationSettings;
     this._commonSettings                   = commonSettings;
     this._blogSettings                     = blogSettings;
     this._newsSettings                     = newsSettings;
     this._forumSettings                    = forumSettings;
     this._localizationSettings             = localizationSettings;
     this._captchaSettings                  = captchaSettings;
     this._vendorSettings                   = vendorSettings;
     this._productTagService                = productTagService;
     this._displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     this._fileProvider                     = fileProvider;
 }
Beispiel #5
0
 public HomeController(ICommonServices services, CommonSettings commonSettings, Lazy <IUserAgent> userAgent)
 {
     this._commonSettings = commonSettings;
     this._services       = services;
     this._userAgent      = userAgent;
 }
Beispiel #6
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            Config        = new Menu("Marksman", "Marksman", true).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
            ChampionClass = new Champion();
            CommonGeometry.Init();
            var baseType = ChampionClass.GetType();

            igniteSlot = ObjectManager.Player.GetSpellSlot("summonerdot");

            /* Update this with Activator.CreateInstance or Invoke
             * http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string
             * For now stays cancer.
             */
            var championName = ObjectManager.Player.ChampionName.ToLowerInvariant();

            switch (championName)
            {
            case "ashe":
                ChampionClass = new Ashe();
                break;

            case "caitlyn":
                ChampionClass = new Caitlyn();
                break;

            case "corki":
                ChampionClass = new Corki();
                break;

            case "draven":
                ChampionClass = new Draven();
                break;

            case "ezreal":
                ChampionClass = new Ezreal();
                break;

            case "graves":
                ChampionClass = new Graves();
                break;

            case "gnar":
                ChampionClass = new Gnar();
                break;

            case "jhin":
                ChampionClass = new Jhin();
                break;

            case "jinx":
                ChampionClass = new Jinx();
                break;

            case "kalista":
                ChampionClass = new Kalista();
                break;

            case "kindred":
                ChampionClass = new Kindred();
                break;

            case "kogmaw":
                ChampionClass = new Kogmaw();
                break;

            case "lucian":
                ChampionClass = new Lucian();
                break;

            case "missfortune":
                ChampionClass = new MissFortune();
                break;

            case "quinn":
                ChampionClass = new Quinn();
                break;

            case "sivir":
                ChampionClass = new Sivir();
                break;

            case "teemo":
                ChampionClass = new Teemo();
                break;

            case "tristana":
                ChampionClass = new Tristana();
                break;

            case "twitch":
                ChampionClass = new Twitch();
                break;

            case "urgot":
                ChampionClass = new Urgot();
                break;

            case "vayne":
                ChampionClass = new Vayne();
                break;

            case "varus":
                ChampionClass = new Varus();
                break;

            default:
                Game.PrintChat(ObjectManager.Player.CharData.BaseSkinName + " Doesn't support from Marksman!");
                break;
            }
            //Config.DisplayName = "Marksman Lite | " + CultureInfo.CurrentCulture.TextInfo.ToTitleCase(championName);
            Config.DisplayName = "Marksman II - " + ObjectManager.Player.ChampionName;

            ChampionClass.Id         = ObjectManager.Player.CharData.BaseSkinName;
            ChampionClass.Config     = Config;
            ChampionClass.MenuLane   = MenuLane;
            ChampionClass.MenuJungle = MenuJungle;

            MenuExtraTools = new Menu("Marksman II - Tools", "ExtraTools", true).SetFontStyle(FontStyle.Regular,
                                                                                              SharpDX.Color.GreenYellow);
            {
                var nMenuExtraToolsPackets = new Menu("Available Tools", "MenuExtraTools.Available");
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Orbwalker", "Orbwalker:")).SetValue(new StringList(new[] { "LeagueSharp Common", "Marksman Orbwalker (With Attack Speed Limiter)" })).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Prediction", "Prediction:")).SetValue(new StringList(new[] { "LeagueSharp Common", "SPrediction (Synx)" })).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoLevel", "Auto Leveller:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoBush", "Auto Bush Ward:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoPink", "Auto Pink Ward:")).SetValue(true).SetTooltip("For rengar / vayne / shaco etc.");
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.WarningSpells", "Warning Spells [NEW]:")).SetValue(true).SetTooltip("For Rengar R / Shaco Q etc.").SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Skin", "Skin Manager:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Emote", "Emote:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AllySupport", "Ally Support:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.BuffTimer", "Buff Time Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Potition", "Potition Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Summoners", "Summoner Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Tracker", "Tracker:")).SetValue(false).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);

                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Reload", "Press F5 for Load Extra Tools!")).SetFontStyle(FontStyle.Bold, SharpDX.Color.GreenYellow);

                MenuExtraTools.AddSubMenu(nMenuExtraToolsPackets);

                MenuExtraToolsActivePackets = new Menu("Installed Tools", "MenuExtraTools.Installed").SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);

                MenuExtraTools.AddSubMenu(MenuExtraToolsActivePackets);
            }

            CommonSettings.Init(Config);

            OrbWalking = Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
            ChampionClass.Orbwalker = new Orbwalking.Orbwalker(OrbWalking);

            MenuActivator = new Menu("Activator", "Activator").SetFontStyle(FontStyle.Regular, SharpDX.Color.Aqua);
            {
                if (MenuExtraTools.Item("ExtraTools.AutoLevel").GetValue <bool>())
                {
                    CommonAutoLevel.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.AutoPink").GetValue <bool>())
                {
                    CommonAutoPink.Initialize(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.WarningSpells").GetValue <bool>())
                {
                    CommonWarningSpelss.Initialize(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.AutoBush").GetValue <bool>())
                {
                    CommonAutoBush.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.Skin").GetValue <bool>())
                {
                    CommonSkinManager.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.Emote").GetValue <bool>())
                {
                    CommonEmote.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.AllySupport").GetValue <bool>())
                {
                    CommonAlly.Init(MenuExtraToolsActivePackets);
                }

                /* Menu Items */
                var items = MenuActivator.AddSubMenu(new Menu("Items", "Items"));
                items.AddItem(new MenuItem("BOTRK", "BOTRK").SetValue(true));
                items.AddItem(new MenuItem("GHOSTBLADE", "Ghostblade").SetValue(true));
                items.AddItem(new MenuItem("SWORD", "Sword of the Divine").SetValue(true));
                items.AddItem(new MenuItem("MURAMANA", "Muramana").SetValue(true));
                items.AddItem(new MenuItem("UseItemsMode", "Use items on").SetValue(new StringList(new[] { "No", "Mixed mode", "Combo mode", "Both" }, 2)));
            }
            Config.AddSubMenu(MenuActivator);

            // If Champion is supported draw the extra menus
            if (baseType != ChampionClass.GetType())
            {
                SetSmiteSlot();

                var combo = new Menu("Combo", "Combo").SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
                if (ChampionClass.ComboMenu(combo))
                {
                    if (SmiteSlot != SpellSlot.Unknown)
                    {
                        combo.AddItem(new MenuItem("ComboSmite", "Use Smite").SetValue(true));
                    }

                    Config.AddSubMenu(combo);
                }

                var harass = new Menu("Harass", "Harass");
                if (ChampionClass.HarassMenu(harass))
                {
                    harass.AddItem(new MenuItem("HarassMana", "Min. Mana Percent").SetValue(new Slider(50, 100, 0)));
                    Config.AddSubMenu(harass);
                }

                var menuClear = new Menu("Farm / Jungle", "Mode.Clear");
                {
                    MenuLane = new Menu("Lane", "Mode.Lane");
                    {
                        if (ChampionClass.LaneClearMenu(MenuLane))
                        {
                            MenuLane.AddItem(new MenuItem("Lane.Min.Mana", ":: Min. Mana %:").SetValue(new Slider(60, 100, 0)));
                        }
                        menuClear.AddSubMenu(MenuLane);
                    }

                    MenuJungle = new Menu("Jungle", "Mode.Jungle");
                    {
                        if (ChampionClass.JungleClearMenu(MenuJungle))
                        {
                            MenuJungle.AddItem(new MenuItem("Jungle.Min.Mana", ":: Min. Mana %:").SetValue(new Slider(30, 100, 0)));
                            MenuJungle.AddItem(new MenuItem("Jungle.Items", ":: Use Items:").SetValue(new StringList(new[] { "Off", "Use for Baron", "Use for Baron", "Both" }, 3)));
                            menuClear.AddSubMenu(MenuJungle);
                        }
                    }

                    menuClear.AddItem(new MenuItem("Farm.Active", ":: Farm Active!").SetValue(new KeyBind("J".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marksman | Farm", SharpDX.Color.Aqua);
                    menuClear.AddItem(new MenuItem("Farm.Min.Mana.Control", ":: Min. Mana Control!").SetValue(new KeyBind("M".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marksman | Farm Min. Mana Control", SharpDX.Color.Aqua);
                    Config.AddSubMenu(menuClear);
                }


                //var laneclear = new Menu("Lane Mode", "LaneClear");
                //if (ChampionClass.LaneClearMenu(laneclear))
                //{
                //    laneclear.AddItem(new MenuItem("Lane.Enabled", ":: Enable Lane Farm!").SetValue(new KeyBind("L".ToCharArray()[0],KeyBindType.Toggle, true))).Permashow(true, "Marksman | Enable Lane Farm", SharpDX.Color.Aqua);

                //    var minManaMenu = new Menu("Min. Mana Settings", "Lane.MinMana.Title");
                //    {
                //        minManaMenu.AddItem(new MenuItem("LaneMana.Alone", "If I'm Alone %:").SetValue(new Slider(30, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.LightSkyBlue);
                //        minManaMenu.AddItem(new MenuItem("LaneMana.Enemy", "If Enemy Close %:").SetValue(new Slider(60, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.IndianRed);
                //        laneclear.AddSubMenu(minManaMenu);
                //    }
                //    Config.AddSubMenu(laneclear);
                //}

                //var jungleClear = new Menu("Jungle Mode", "JungleClear");
                //if (ChampionClass.JungleClearMenu(jungleClear))
                //{
                //    var minManaMenu = new Menu("Min. Mana Settings", "Jungle.MinMana.Title");
                //    {
                //        minManaMenu.AddItem(new MenuItem("Jungle.Mana.Ally", "Ally Mobs %:").SetValue(new Slider(50, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.LightSkyBlue);
                //        minManaMenu.AddItem(new MenuItem("Jungle.Mana.Enemy", "Enemy Mobs %:").SetValue(new Slider(30, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.IndianRed);
                //        minManaMenu.AddItem(new MenuItem("Jungle.Mana.BigBoys", "Baron/Dragon %:").SetValue(new Slider(70, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.HotPink);
                //        jungleClear.AddSubMenu(minManaMenu);
                //    }
                //    jungleClear.AddItem(new MenuItem("Jungle.Items", ":: Use Items:").SetValue(new StringList(new[] {"Off", "Use for Baron", "Use for Baron", "Both"}, 3)));
                //    jungleClear.AddItem(new MenuItem("Jungle.Enabled", ":: Enable Jungle Farm!").SetValue(new KeyBind("J".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marksman | Enable Jungle Farm", SharpDX.Color.Aqua);
                //    Config.AddSubMenu(jungleClear);
                //}

                /*----------------------------------------------------------------------------------------------------------*/
                //Obj_AI_Base ally = (from aAllies in HeroManager.Allies
                //    from aSupportedChampions in
                //        new[]
                //        {
                //            "janna", "tahm", "leona", "lulu", "lux", "nami", "shen", "sona", "braum", "bard"
                //        }
                //    where aSupportedChampions == aAllies.ChampionName.ToLower()
                //    select aAllies).FirstOrDefault();

                //if (ally != null)
                //{
                //    var menuAllies = new Menu("Ally Combo", "Ally.Combo").SetFontStyle(FontStyle.Regular, Color.Crimson);
                //    {
                //        Obj_AI_Hero leona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "leona");
                //        if (leona != null)
                //        {
                //            var menuLeona = new Menu("Leona", "Leona");
                //            menuLeona.AddItem(new MenuItem("Leona.ComboBuff", "Force Focus Marked Enemy for Bonus Damage").SetValue(true));
                //            menuAllies.AddSubMenu(menuLeona);
                //        }

                //        Obj_AI_Hero Lux = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "lux");
                //        if (Lux != null)
                //        {
                //            var menuLux = new Menu("Lux", "Lux");
                //            menuLux.AddItem(new MenuItem("Lux.ComboBuff", "Force Focus Marked Enemy for Bonus Damage").SetValue(true));
                //            menuAllies.AddSubMenu(menuLux);
                //        }

                //        Obj_AI_Hero Shen = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "shen");
                //        if (Shen != null)
                //        {
                //            var menuShen = new Menu("Shen", "Shen");
                //            menuShen.AddItem(new MenuItem("Shen.ComboBuff", "Force Focus Q Marked Enemy Objects for Heal").SetValue(true));
                //            menuShen.AddItem(new MenuItem("Shen.ComboBuff", "Minimum Heal:").SetValue(new Slider(80)));
                //            menuAllies.AddSubMenu(menuShen);
                //        }

                //        Obj_AI_Hero Tahm = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Tahm");
                //        if (Tahm != null)
                //        {
                //            var menuTahm = new Menu("Tahm", "Tahm");
                //            menuTahm.AddItem(new MenuItem("Tahm.ComboBuff", "Force Focus Marked Enemy for Stun").SetValue(true));
                //            menuAllies.AddSubMenu(menuTahm);
                //        }

                //        Obj_AI_Hero Sona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Sona");
                //        if (Sona != null)
                //        {
                //            var menuSona = new Menu("Sona", "Sona");
                //            menuSona.AddItem(new MenuItem("Sona.ComboBuff", "Force Focus to Marked Enemy").SetValue(true));
                //            menuAllies.AddSubMenu(menuSona);
                //        }

                //        Obj_AI_Hero Lulu = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Lulu");
                //        if (Lulu != null)
                //        {
                //            var menuLulu = new Menu("Lulu", "Lulu");
                //            menuLulu.AddItem(new MenuItem("Lulu.ComboBuff", "Force Focus to Enemy If I have E buff").SetValue(true));
                //            menuAllies.AddSubMenu(menuLulu);
                //        }

                //        Obj_AI_Hero Nami = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "nami");
                //        if (Nami != null)
                //        {
                //            var menuNami = new Menu("Nami", "Nami");
                //            menuNami.AddItem(new MenuItem("Nami.ComboBuff", "Force Focus to Enemy If I have E Buff").SetValue(true));
                //            menuAllies.AddSubMenu(menuNami);
                //        }
                //    }
                //    Config.AddSubMenu(menuAllies);
                //}
                /*----------------------------------------------------------------------------------------------------------*/

                var misc = new Menu("Misc", "Misc").SetFontStyle(FontStyle.Regular, SharpDX.Color.DarkOrange);
                if (ChampionClass.MiscMenu(misc))
                {
                    misc.AddItem(new MenuItem("Misc.SaveManaForUltimate", "Save Mana for Ultimate").SetValue(false));
                    Config.AddSubMenu(misc);
                }

                /*
                 *              var extras = new Menu("Extras", "Extras");
                 *              if (ChampionClass.ExtrasMenu(extras))
                 *              {
                 *                  Config.AddSubMenu(extras);
                 *              }
                 */

                var marksmanDrawings = new Menu("Drawings", "MDrawings");
                Config.AddSubMenu(marksmanDrawings);

                var drawing = new Menu(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(championName), "Drawings").SetFontStyle(FontStyle.Regular, SharpDX.Color.Aquamarine);
                if (ChampionClass.DrawingMenu(drawing))
                {
                    marksmanDrawings.AddSubMenu(drawing);
                }

                var globalDrawings = new Menu("Global", "GDrawings");
                {
                    marksmanDrawings.AddItem(new MenuItem("Draw.TurnOff", "Drawings").SetValue(new StringList(new[] { "Disable", "Enable", "Disable on Combo Mode", "Disable on Lane/Jungle Mode", "Both" }, 1)));
                    globalDrawings.AddItem(new MenuItem("Draw.MinionLastHit", "Minion Last Hit").SetValue(new StringList(new[] { "Off", "On", "Just Out of AA Range Minions" }, 2)));
                    globalDrawings.AddItem(new MenuItem("Draw.KillableEnemy", "Killable Enemy Text").SetValue(false));
                    //GlobalDrawings.AddItem(new MenuItem("Draw.JunglePosition", "Jungle Farm Position").SetValue(new StringList(new[] { "Off", "If I'm Close to Mobs", "If Jungle Clear Active" }, 2)));
                    marksmanDrawings.AddSubMenu(globalDrawings);
                }

                //CreateButtons();
            }

            ChampionClass.MainMenu(Config);
            ChampionClass.ToolsMenu(MenuExtraTools);

            //Evade.Evade.Initiliaze();
            //Config.AddSubMenu(Evade.Config.Menu);
            //var y = new Common.CommonObjectDetector();
            Config.AddToMainMenu();
            MenuExtraTools.AddToMainMenu();

            foreach (var i in Config.Children.SelectMany(GetChildirens))
            {
                i.DisplayName = ":: " + i.DisplayName;
            }

            foreach (var i in MenuExtraTools.Children.SelectMany(GetChildirens))
            {
                i.DisplayName = ":: " + i.DisplayName;
            }


            //CheckAutoWindUp();

            Drawing.OnDraw     += Drawing_OnDraw;
            Drawing.OnEndScene += eventArgs =>
            {
                //DrawButtons();
                if (Config.Item("Draw.KillableEnemy").GetValue <bool>())
                {
                    foreach (var e in HeroManager.Enemies.Where(e => e.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) * 2)))
                    {
                        var x = (int)Math.Ceiling(e.Health / ObjectManager.Player.GetAutoAttackDamage(e));
                        //Utils.Utils.DrawText(CommonGeometry.Text, $"{x} x AA = Kill", (int)e.HPBarPosition.X + 20, (int)e.HPBarPosition.Y + 17, SharpDX.Color.White);
                        CommonGeometry.Text.DrawTextLeft(string.Format("{0} x AA Kill", x), (int)e.HPBarPosition.X + 5, (int)e.HPBarPosition.Y + 25, SharpDX.Color.White);
                    }
                    //var t = KillableEnemyAa;
                    //if (t.Key != null && t.Key.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 1000) &&
                    //    t.Value > 0)
                    //{
                    //    Utils.Utils.DrawText(CommonGeometry.Text, string.Format("{0} x AA Damage = Kill", t.Value), (int)t.Key.HPBarPosition.X + 30, (int)t.Key.HPBarPosition.Y + 5, SharpDX.Color.White);


                    //}
                }
            };
            Game.OnUpdate += GameOnUpdate;
            Game.OnUpdate += delegate(EventArgs eventArgs) { ChampionClass.GameOnUpdate(eventArgs); };

            Game.OnUpdate += eventArgs =>
            {
                if (ChampionClass.ComboActive)
                {
                    ChampionClass.ExecuteCombo();
                }
                if (ChampionClass.LaneClearActive)
                {
                    ChampionClass.ExecuteLane();
                }
                if (ChampionClass.JungleClearActive)
                {
                    ChampionClass.ExecuteJungle();
                }
                ChampionClass.PermaActive();
            };

            Orbwalking.OnAttack += (unit, target) =>
            {//
             // if (unit.IsMe)
             //   Game.PrintChat("Attack");
            };
            Orbwalking.AfterAttack  += (unit, target) => { ChampionClass.Orbwalking_AfterAttack(unit, target); };
            Orbwalking.BeforeAttack += (eventArgs) => { ChampionClass.Orbwalking_BeforeAttack(eventArgs); };


            GameObject.OnCreate += (sender, eventArgs) => { ChampionClass.OnCreateObject(sender, args); };
            GameObject.OnDelete += (sender, eventArgs) => { ChampionClass.OnDeleteObject(sender, args); };

            Drawing.OnEndScene += eventArgs => { ChampionClass.DrawingOnEndScene(eventArgs); };

            Obj_AI_Base.OnBuffAdd          += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnBuffAdd(sender, eventArgs); };
            Obj_AI_Base.OnBuffRemove       += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnBuffRemove(sender, eventArgs); };
            Obj_AI_Base.OnProcessSpellCast += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnProcessSpellCast(sender, eventArgs); };
            Obj_AI_Base.OnPlayAnimation    += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnPlayAnimation(sender, eventArgs); };

            AntiGapcloser.OnEnemyGapcloser += (gapcloser) => { ChampionClass.AntiGapcloser_OnEnemyGapcloser(gapcloser); };

            Spellbook.OnCastSpell += (sender, eventArgs) => { ChampionClass.Spellbook_OnCastSpell(sender, eventArgs); };

            Interrupter2.OnInterruptableTarget += (sender, eventArgs) => { ChampionClass.Interrupter2_OnInterruptableTarget(sender, eventArgs); };

            Obj_AI_Base.OnPlayAnimation += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnPlayAnimation(sender, eventArgs); };

            Console.Clear();
        }
        public CommonModelFactory(ICategoryService categoryService,
                                  IProductService productService,
                                  IManufacturerService manufacturerService,
                                  ITopicService topicService,
                                  ILanguageService languageService,
                                  ICurrencyService currencyService,
                                  ILocalizationService localizationService,
                                  IWorkContext workContext,
                                  IStoreContext storeContext,
                                  ISitemapGenerator sitemapGenerator,
                                  IThemeContext themeContext,
                                  IThemeProvider themeProvider,
                                  IForumService forumService,
                                  IGenericAttributeService genericAttributeService,
                                  IWebHelper webHelper,
                                  IPermissionService permissionService,
                                  ICacheManager cacheManager,
                                  IPageHeadBuilder pageHeadBuilder,
                                  IPictureService pictureService,
                                  HttpContextBase httpContext,
                                  CatalogSettings catalogSettings,
                                  StoreInformationSettings storeInformationSettings,
                                  CommonSettings commonSettings,
                                  BlogSettings blogSettings,
                                  NewsSettings newsSettings,
                                  ForumSettings forumSettings,
                                  LocalizationSettings localizationSettings,
                                  CaptchaSettings captchaSettings,
                                  VendorSettings vendorSettings)
        {
            this._categoryService         = categoryService;
            this._productService          = productService;
            this._manufacturerService     = manufacturerService;
            this._topicService            = topicService;
            this._languageService         = languageService;
            this._currencyService         = currencyService;
            this._localizationService     = localizationService;
            this._workContext             = workContext;
            this._storeContext            = storeContext;
            this._sitemapGenerator        = sitemapGenerator;
            this._themeContext            = themeContext;
            this._themeProvider           = themeProvider;
            this._forumservice            = forumService;
            this._genericAttributeService = genericAttributeService;
            this._webHelper         = webHelper;
            this._permissionService = permissionService;
            this._cacheManager      = cacheManager;
            this._pageHeadBuilder   = pageHeadBuilder;
            this._pictureService    = pictureService;
            this._httpContext       = httpContext;

            this._catalogSettings          = catalogSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._commonSettings           = commonSettings;
            this._blogSettings             = blogSettings;
            this._newsSettings             = newsSettings;
            this._forumSettings            = forumSettings;
            this._localizationSettings     = localizationSettings;
            this._captchaSettings          = captchaSettings;
            this._vendorSettings           = vendorSettings;
        }
Beispiel #8
0
 public DropDbContext(CommonSettings settings)
 {
     _settings = settings;
 }
 public NotificationService(IDbService dbService, IOptions <CommonSettings> options)
 {
     _dbService = dbService;
     _options   = options.Value;
 }
Beispiel #10
0
        public CommonController(
            ICommonServices services,
            ITopicService topicService,
            Lazy <ILanguageService> languageService,
            Lazy <ICurrencyService> currencyService,
            IThemeContext themeContext,
            Lazy <IThemeRegistry> themeRegistry,
            Lazy <IForumService> forumService,
            Lazy <IGenericAttributeService> genericAttributeService,
            Lazy <IMobileDeviceHelper> mobileDeviceHelper,
            Lazy <ICompareProductsService> compareProductsService,
            Lazy <IUrlRecordService> urlRecordService,
            Lazy <ICatalogSearchService> catalogSearchService,
            StoreInformationSettings storeInfoSettings,
            CustomerSettings customerSettings,
            TaxSettings taxSettings,
            CatalogSettings catalogSettings,
            ShoppingCartSettings shoppingCartSettings,
            EmailAccountSettings emailAccountSettings,
            CommonSettings commonSettings,
            NewsSettings newsSettings,
            BlogSettings blogSettings,
            ForumSettings forumSettings,
            LocalizationSettings localizationSettings,
            Lazy <SecuritySettings> securitySettings,
            Lazy <SocialSettings> socialSettings,
            Lazy <MediaSettings> mediaSettings,
            Lazy <SearchSettings> searchSettings,
            IOrderTotalCalculationService orderTotalCalculationService,
            IPriceFormatter priceFormatter,
            ThemeSettings themeSettings,
            IPageAssetsBuilder pageAssetsBuilder,
            Lazy <IPictureService> pictureService,
            Lazy <IManufacturerService> manufacturerService,
            Lazy <ICategoryService> categoryService,
            Lazy <IProductService> productService,
            Lazy <IShoppingCartService> shoppingCartService,
            IBreadcrumb breadcrumb)
        {
            _services                = services;
            _topicService            = topicService;
            _languageService         = languageService;
            _currencyService         = currencyService;
            _themeContext            = themeContext;
            _themeRegistry           = themeRegistry;
            _forumservice            = forumService;
            _genericAttributeService = genericAttributeService;
            _compareProductsService  = compareProductsService;
            _urlRecordService        = urlRecordService;
            _catalogSearchService    = catalogSearchService;

            _storeInfoSettings    = storeInfoSettings;
            _customerSettings     = customerSettings;
            _taxSettings          = taxSettings;
            _catalogSettings      = catalogSettings;
            _shoppingCartSettings = shoppingCartSettings;
            _commonSettings       = commonSettings;
            _newsSettings         = newsSettings;
            _blogSettings         = blogSettings;
            _forumSettings        = forumSettings;
            _localizationSettings = localizationSettings;
            _securitySettings     = securitySettings;
            _socialSettings       = socialSettings;
            _mediaSettings        = mediaSettings;
            _searchSettings       = searchSettings;

            _orderTotalCalculationService = orderTotalCalculationService;
            _priceFormatter = priceFormatter;

            _themeSettings       = themeSettings;
            _pageAssetsBuilder   = pageAssetsBuilder;
            _pictureService      = pictureService;
            _manufacturerService = manufacturerService;
            _categoryService     = categoryService;
            _productService      = productService;
            _shoppingCartService = shoppingCartService;

            _breadcrumb = breadcrumb;
        }
        public void TestInitialize()
        {
            _securitySettings = new SecuritySettings
            {
                EncryptionKey = "273ece6f97dd844d97dd8f4d"
            };
            _rewardPointsSettings = new RewardPointsSettings
            {
                Enabled = false,
            };

            _encryptionService = new EncryptionService(_securitySettings);

            var customer1 = new Customer
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Hashed,
                Active         = true
            };

            string saltKey  = _encryptionService.CreateSaltKey(5);
            string password = _encryptionService.CreatePasswordHash("password", saltKey);

            customer1.PasswordSalt = saltKey;
            customer1.Password     = password;
            AddCustomerToRegisteredRole(customer1);

            var customer2 = new Customer
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                Active         = true
            };

            AddCustomerToRegisteredRole(customer2);

            var customer3 = new Customer
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Encrypted,
                Password       = _encryptionService.EncryptText("password"),
                Active         = true
            };

            AddCustomerToRegisteredRole(customer3);

            var customer4 = new Customer
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                Active         = true
            };

            AddCustomerToRegisteredRole(customer4);

            var customer5 = new Customer
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                Active         = true
            };

            //trying to recreate

            var eventPublisher = new Mock <IMediator>();

            //eventPublisher.Setup(x => x.PublishAsync(new object()));
            _eventPublisher = eventPublisher.Object;

            _storeService = new Mock <IStoreService>().Object;

            _customerRepo = new Grand.Services.Tests.MongoDBRepositoryTest <Customer>();
            _customerRepo.Insert(customer1);
            _customerRepo.Insert(customer2);
            _customerRepo.Insert(customer3);
            _customerRepo.Insert(customer4);
            _customerRepo.Insert(customer5);

            _customerRoleRepo         = new Mock <IRepository <CustomerRole> >().Object;
            _orderRepo                = new Mock <IRepository <Order> >().Object;
            _forumPostRepo            = new Mock <IRepository <ForumPost> >().Object;
            _forumTopicRepo           = new Mock <IRepository <ForumTopic> >().Object;
            _customerProductPriceRepo = new Mock <IRepository <CustomerProductPrice> >().Object;
            _customerProductRepo      = new Mock <IRepository <CustomerProduct> >().Object;
            _customerHistoryRepo      = new Mock <IRepository <CustomerHistoryPassword> >().Object;
            _customerNoteRepo         = new Mock <IRepository <CustomerNote> >().Object;

            _genericAttributeService       = new Mock <IGenericAttributeService>().Object;
            _newsLetterSubscriptionService = new Mock <INewsLetterSubscriptionService>().Object;
            _localizationService           = new Mock <ILocalizationService>().Object;
            _rewardPointsService           = new Mock <IRewardPointsService>().Object;
            _customerRoleProductRepo       = new Mock <IRepository <CustomerRoleProduct> >().Object;
            _serviceProvider  = new Mock <IServiceProvider>().Object;
            _customerSettings = new CustomerSettings();
            _commonSettings   = new CommonSettings();
            _customerService  = new CustomerService(new TestMemoryCacheManager(new Mock <IMemoryCache>().Object), _customerRepo, _customerRoleRepo, _customerProductRepo, _customerProductPriceRepo,
                                                    _customerHistoryRepo, _customerRoleProductRepo, _customerNoteRepo, _orderRepo, _forumPostRepo, _forumTopicRepo, null, null, _genericAttributeService,
                                                    _eventPublisher, _serviceProvider);

            _customerRegistrationService = new CustomerRegistrationService(
                _customerService,
                _encryptionService,
                _newsLetterSubscriptionService,
                _localizationService,
                _storeService,
                _eventPublisher,
                _rewardPointsSettings,
                _customerSettings,
                _rewardPointsService);
        }
Beispiel #12
0
        /// <summary>
        /// 画标尺刻度
        /// </summary>
        /// <param name="g"></param>
        private void DrawScale(Graphics g)
        {
            design_width  = designer1.Width;
            design_height = designer1.Height;

            int    width_mm = (int)CommonSettings.PixelConvertMillimeter(design_width);
            int    heigth_mm = (int)CommonSettings.PixelConvertMillimeter(design_height);
            float  percent = design_width / width_mm;
            PointF ps, pe;
            int    scale;

            for (int i = 0; i < width_mm; i++)
            {
                if (i % 10 == 0)
                {
                    string x        = (i / 10).ToString();
                    SizeF  fontSize = g.MeasureString(x, scaleLabel);
                    scale = 15;
                    PointF pf = new PointF(designer1.Location.X + i * percent - fontSize.Width / 2, designer1.Location.Y - scale - fontSize.Height);
                    g.DrawString(x, scaleLabel, Brushes.Blue, pf);
                    pf = new PointF(designer1.Location.X + i * percent - fontSize.Width / 2, designer1.Location.Y + scale + designer1.Height);
                    g.DrawString(x, scaleLabel, Brushes.Blue, pf);
                }
                else if (i % 5 == 0)
                {
                    scale = 10;
                }
                else
                {
                    scale = 5;
                }

                ps = new PointF(designer1.Location.X + i * percent, designer1.Location.Y);
                pe = new PointF(designer1.Location.X + i * percent, designer1.Location.Y - scale);
                g.DrawLine(Pens.Blue, ps, pe);
                ps = new PointF(designer1.Location.X + i * percent, designer1.Location.Y + designer1.Height);
                pe = new PointF(designer1.Location.X + i * percent, designer1.Location.Y + designer1.Height + scale);
                g.DrawLine(Pens.Blue, ps, pe);
            }

            for (int j = 0; j < heigth_mm; j++)
            {
                if (j % 10 == 0)
                {
                    string x = (j / 10).ToString();
                    scale = 15;
                    SizeF fontSize = g.MeasureString(x, scaleLabel);
                    g.DrawString(x, scaleLabel, Brushes.Blue, designer1.Location.X - fontSize.Width - scale, designer1.Location.Y + j * percent - fontSize.Height / 2);
                    g.DrawString(x, scaleLabel, Brushes.Blue, designer1.Location.X + designer1.Width + scale, designer1.Location.Y + j * percent - fontSize.Height / 2);
                }
                else if (j % 5 == 0)
                {
                    scale = 10;
                }
                else
                {
                    scale = 5;
                }

                ps = new PointF(designer1.Location.X, designer1.Location.Y + j * percent);
                pe = new PointF(designer1.Location.X - scale, designer1.Location.Y + j * percent);
                g.DrawLine(Pens.Blue, ps, pe);
                ps = new PointF(designer1.Location.X, designer1.Location.Y + j * percent);
                pe = new PointF(designer1.Location.X + designer1.Width + scale, designer1.Location.Y + j * percent);
                g.DrawLine(Pens.Blue, ps, pe);
            }
            //if (mouseLocationXs != null)
            //{
            //    g.DrawLine(Pens.Blue, mouseLocationXs, mouseLocationXe);
            //}
        }
Beispiel #13
0
 /// <summary>
 /// 设置行高
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void numRowHeight_ValueChanged(object sender, EventArgs e)
 {
     designer1.RowHeight = CommonSettings.MillimeterConvertPixel((float)numRowHeight.Value);
 }
Beispiel #14
0
 private void numHeight_ValueChanged(object sender, EventArgs e)
 {
     //改变设计器的尺寸并重绘标尺
     designer1.Height = CommonSettings.MillimeterConvertPixel((float)numHeight.Value);
     panel1.Refresh();
 }
Beispiel #15
0
        /// <summary>
        /// 将图片画到佛定位置
        /// </summary>
        /// <param name="g"></param>
        public override void Draw(Graphics g)
        {
            if (Selected)
            {
                //如果是选中状态画出虚线框
                using (Pen pen = new Pen(Color.SkyBlue))
                {
                    pen.DashStyle   = System.Drawing.Drawing2D.DashStyle.Dash;
                    pen.DashPattern = new float[] { 3.0f, 3.0f };

                    g.DrawRectangle(pen, this.Rectangle);
                    g.DrawLine(pen, 0, Rectangle.Y, Rectangle.X, Rectangle.Y);
                    g.DrawLine(pen, Rectangle.X, 0, Rectangle.X, Rectangle.Y);
                    Point xyNotice;
                    int   fontHeight = new Font("Verdana", 7).Height;
                    if (Rectangle.Y < fontHeight)
                    {
                        xyNotice = new Point(Rectangle.X, Rectangle.Y + Rectangle.Height + 2);
                    }
                    else
                    {
                        xyNotice = new Point(Rectangle.X + 2, Rectangle.Y - fontHeight - 2);
                    }
                    g.DrawString(string.Format("[X:{0} Y:{1}][W:{2} H:{3}]", (int)CommonSettings.PixelConvertMillimeter(Rectangle.X), (int)CommonSettings.PixelConvertMillimeter(Rectangle.Y), (int)CommonSettings.PixelConvertMillimeter(Rectangle.Width), (int)CommonSettings.PixelConvertMillimeter(Rectangle.Height)), new Font("Verdana", 7), Brushes.Blue, xyNotice);
                }
            }
            else
            {
                //如果没有选中,但是没有图片
                //则画出虚线框
                if (image == null)
                {
                    using (Pen pen = new Pen(Color.SkyBlue))
                    {
                        pen.DashStyle   = System.Drawing.Drawing2D.DashStyle.Dash;
                        pen.DashPattern = new float[] { 3.0f, 3.0f };

                        g.DrawRectangle(pen, this.Rectangle);
                    }
                }
            }
            if (image != null)
            {
                //有图片则画出图片
                g.DrawImage(image, this.Rectangle);
            }
            else
            {
                //没有图片在指定的区域画出提示信息
                GraphicsState state = g.Save();
                g.SetClip(this.Rectangle); //提示信息不能超出图片所在的区域
                g.DrawString("请选择图片!", new Font("Verdana", 9), Brushes.DarkRed, this.Rectangle.X + 8, this.Rectangle.Y + 8);
                g.Restore(state);          //恢复做图区域
            }
        }
Beispiel #16
0
 internal void SaveCommon(CommonSettings commonSettings)
 {
     applicationConfiguration.SaveCommonSettings(commonSettings);
 }
 public FakeProductService(CatalogSettings catalogSettings                                                 = null,
                           CommonSettings commonSettings                                                   = null,
                           IAclService aclService                                                          = null,
                           ICacheKeyService cacheKeyService                                                = null,
                           ICustomerService customerService                                                = null,
                           INopDataProvider dataProvider                                                   = null,
                           IDateRangeService dateRangeService                                              = null,
                           IEventPublisher eventPublisher                                                  = null,
                           ILanguageService languageService                                                = null,
                           ILocalizationService localizationService                                        = null,
                           IProductAttributeParser productAttributeParser                                  = null,
                           IProductAttributeService productAttributeService                                = null,
                           IRepository <AclRecord> aclRepository                                           = null,
                           IRepository <CrossSellProduct> crossSellProductRepository                       = null,
                           IRepository <DiscountProductMapping> discountProductMappingRepository           = null,
                           IRepository <Product> productRepository                                         = null,
                           IRepository <ProductAttributeCombination> productAttributeCombinationRepository = null,
                           IRepository <ProductAttributeMapping> productAttributeMappingRepository         = null,
                           IRepository <ProductCategory> productCategoryRepository                         = null,
                           IRepository <ProductPicture> productPictureRepository                           = null,
                           IRepository <ProductReview> productReviewRepository                             = null,
                           IRepository <ProductReviewHelpfulness> productReviewHelpfulnessRepository       = null,
                           IRepository <ProductWarehouseInventory> productWarehouseInventoryRepository     = null,
                           IRepository <RelatedProduct> relatedProductRepository                           = null,
                           IRepository <Shipment> shipmentRepository                                       = null,
                           IRepository <StockQuantityHistory> stockQuantityHistoryRepository               = null,
                           IRepository <StoreMapping> storeMappingRepository                               = null,
                           IRepository <TierPrice> tierPriceRepository                                     = null,
                           IRepository <Warehouse> warehouseRepository                                     = null,
                           IStaticCacheManager staticCacheManager                                          = null,
                           IStoreService storeService                                                      = null,
                           IStoreMappingService storeMappingService                                        = null,
                           IWorkContext workContext                                                        = null,
                           LocalizationSettings localizationSettings                                       = null) : base(
         catalogSettings ?? new CatalogSettings(),
         commonSettings ?? new CommonSettings(),
         aclService ?? new Mock <IAclService>().Object,
         cacheKeyService ?? new FakeCacheKeyService(),
         customerService ?? new Mock <ICustomerService>().Object,
         dataProvider ?? new Mock <INopDataProvider>().Object,
         dateRangeService ?? new Mock <IDateRangeService>().Object,
         eventPublisher ?? new Mock <IEventPublisher>().Object,
         languageService ?? new Mock <ILanguageService>().Object,
         localizationService ?? new Mock <ILocalizationService>().Object,
         productAttributeParser ?? new Mock <IProductAttributeParser>().Object,
         productAttributeService ?? new Mock <IProductAttributeService>().Object,
         aclRepository.FakeRepoNullPropagation(),
         crossSellProductRepository.FakeRepoNullPropagation(),
         discountProductMappingRepository.FakeRepoNullPropagation(),
         productRepository.FakeRepoNullPropagation(),
         productAttributeCombinationRepository.FakeRepoNullPropagation(),
         productAttributeMappingRepository.FakeRepoNullPropagation(),
         productCategoryRepository.FakeRepoNullPropagation(),
         productPictureRepository.FakeRepoNullPropagation(),
         productReviewRepository.FakeRepoNullPropagation(),
         productReviewHelpfulnessRepository.FakeRepoNullPropagation(),
         productWarehouseInventoryRepository.FakeRepoNullPropagation(),
         relatedProductRepository.FakeRepoNullPropagation(),
         shipmentRepository.FakeRepoNullPropagation(),
         stockQuantityHistoryRepository.FakeRepoNullPropagation(),
         storeMappingRepository.FakeRepoNullPropagation(),
         tierPriceRepository.FakeRepoNullPropagation(),
         warehouseRepository.FakeRepoNullPropagation(),
         staticCacheManager ?? new TestCacheManager(),
         storeService ?? new Mock <IStoreService>().Object,
         storeMappingService ?? new Mock <IStoreMappingService>().Object,
         workContext ?? new Mock <IWorkContext>().Object,
         localizationSettings ?? new LocalizationSettings())
 {
 }
        public ProductValidator(
            IEnumerable <IValidatorConsumer <ProductDto> > validators,
            ILocalizationService localizationService, IProductService productService, IProductTemplateService productTemplateService, IVendorService vendorService, CommonSettings commonSettings)
            : base(validators)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.Name.Required"));
            RuleFor(x => x.ProductType).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.ProductType.Required"));
            RuleFor(x => x.BackorderMode).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.BackorderMode.Required"));
            RuleFor(x => x.DownloadActivationType).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.DownloadActivationType.Required"));
            RuleFor(x => x.IntervalUnitType).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.IntervalUnitType.Required"));
            RuleFor(x => x.GiftCardType).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.GiftCardType.Required"));
            RuleFor(x => x.LowStockActivity).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.LowStockActivity.Required"));
            RuleFor(x => x.ManageInventoryMethod).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.ManageInventoryMethod.Required"));
            RuleFor(x => x.RecurringCyclePeriod).IsInEnum().WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.RecurringCyclePeriod.Required"));

            if (!commonSettings.AllowEditProductEndedAuction)
            {
                RuleFor(x => x.AuctionEnded && x.ProductType == ProductType.Auction).Equal(false).WithMessage(localizationService.GetResource("Api.Catalog.Products.Cannoteditauction"));
            }

            RuleFor(x => x.ProductType == ProductType.Auction && !x.AvailableEndDateTimeUtc.HasValue).Equal(false).WithMessage(localizationService.GetResource("Api.Catalog.Products.Fields.AvailableEndDateTime.Required"));

            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.ParentGroupedProductId))
                {
                    var product = await productService.GetProductById(x.ParentGroupedProductId);
                    if (product == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.ParentGroupedProductId.NotExists"));

            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.ProductTemplateId))
                {
                    var template = await productTemplateService.GetProductTemplateById(x.ProductTemplateId);
                    if (template == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.ProductTemplateId.NotExists"));

            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.VendorId))
                {
                    var vendor = await vendorService.GetVendorById(x.VendorId);
                    if (vendor == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.VendorId.NotExists"));


            RuleFor(x => x).MustAsync(async(x, y, context) =>
            {
                if (!string.IsNullOrEmpty(x.Id))
                {
                    var product = await productService.GetProductById(x.Id);
                    if (product == null)
                    {
                        return(false);
                    }
                }
                return(true);
            }).WithMessage(localizationService.GetResource("Api.Catalog.Product.Fields.Id.NotExists"));
        }
 public ConsoleLogger(CommonSettings settings)
 {
     _settings   = settings;
     _loggerName = typeof(T).FullName;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="knowledgebaseCategoryRepository"></param>
 /// <param name="knowledgebaseArticleRepository"></param>
 /// <param name="mediator">Mediator</param>
 public KnowledgebaseService(IRepository <KnowledgebaseCategory> knowledgebaseCategoryRepository,
                             IRepository <KnowledgebaseArticle> knowledgebaseArticleRepository, IMediator mediator, CommonSettings commonSettings,
                             CatalogSettings catalogSettings, IWorkContext workContext, ICacheManager cacheManager, IStoreContext storeContext,
                             IRepository <KnowledgebaseArticleComment> articleCommentRepository)
 {
     _knowledgebaseCategoryRepository = knowledgebaseCategoryRepository;
     _knowledgebaseArticleRepository  = knowledgebaseArticleRepository;
     _mediator                 = mediator;
     _commonSettings           = commonSettings;
     _catalogSettings          = catalogSettings;
     _workContext              = workContext;
     _cacheManager             = cacheManager;
     _storeContext             = storeContext;
     _articleCommentRepository = articleCommentRepository;
 }
Beispiel #21
0
        public CommonController(ICategoryService categoryService,
                                IProductService productService,
                                IManufacturerService manufacturerService,
                                ITopicService topicService,
                                ILanguageService languageService,
                                ICurrencyService currencyService,
                                ILocalizationService localizationService,
                                IWorkContext workContext,
                                IStoreContext storeContext,
                                IQueuedEmailService queuedEmailService,
                                IEmailAccountService emailAccountService,
                                ISitemapGenerator sitemapGenerator,
                                IThemeContext themeContext,
                                IThemeProvider themeProvider,
                                IForumService forumService,
                                IGenericAttributeService genericAttributeService,
                                IWebHelper webHelper,
                                IPermissionService permissionService,
                                ICacheManager cacheManager,
                                ICustomerActivityService customerActivityService,
                                IVendorService vendorService,
                                IPageHeadBuilder pageHeadBuilder,
                                IPictureService pictureService,
                                CustomerSettings customerSettings,
                                TaxSettings taxSettings,
                                CatalogSettings catalogSettings,
                                StoreInformationSettings storeInformationSettings,
                                EmailAccountSettings emailAccountSettings,
                                CommonSettings commonSettings,
                                BlogSettings blogSettings,
                                NewsSettings newsSettings,
                                ForumSettings forumSettings,
                                LocalizationSettings localizationSettings,
                                CaptchaSettings captchaSettings,
                                VendorSettings vendorSettings)
        {
            this._categoryService         = categoryService;
            this._productService          = productService;
            this._manufacturerService     = manufacturerService;
            this._topicService            = topicService;
            this._languageService         = languageService;
            this._currencyService         = currencyService;
            this._localizationService     = localizationService;
            this._workContext             = workContext;
            this._storeContext            = storeContext;
            this._queuedEmailService      = queuedEmailService;
            this._emailAccountService     = emailAccountService;
            this._sitemapGenerator        = sitemapGenerator;
            this._themeContext            = themeContext;
            this._themeProvider           = themeProvider;
            this._forumservice            = forumService;
            this._genericAttributeService = genericAttributeService;
            this._webHelper               = webHelper;
            this._permissionService       = permissionService;
            this._cacheManager            = cacheManager;
            this._customerActivityService = customerActivityService;
            this._vendorService           = vendorService;
            this._pageHeadBuilder         = pageHeadBuilder;
            this._pictureService          = pictureService;


            this._customerSettings         = customerSettings;
            this._taxSettings              = taxSettings;
            this._catalogSettings          = catalogSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._emailAccountSettings     = emailAccountSettings;
            this._commonSettings           = commonSettings;
            this._blogSettings             = blogSettings;
            this._newsSettings             = newsSettings;
            this._forumSettings            = forumSettings;
            this._localizationSettings     = localizationSettings;
            this._captchaSettings          = captchaSettings;
            this._vendorSettings           = vendorSettings;
        }
 public DeleteGuestsScheduleTask(ICustomerService customerService, CommonSettings commonSettings)
 {
     this._customerService = customerService;
     this._commonSettings  = commonSettings;
 }
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           IBlogService blogService,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INewsService newsService,
                           INopFileProvider fileProvider,
                           IPageHeadBuilder pageHeadBuilder,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           IShoppingCartService shoppingCartService,
                           ISitemapGenerator sitemapGenerator,
                           IStaticCacheManager cacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           MediaSettings mediaSettings,
                           NewsSettings newsSettings,
                           SitemapSettings sitemapSettings,
                           SitemapXmlSettings sitemapXmlSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     _blogSettings     = blogSettings;
     _captchaSettings  = captchaSettings;
     _catalogSettings  = catalogSettings;
     _commonSettings   = commonSettings;
     _customerSettings = customerSettings;
     _displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     _forumSettings           = forumSettings;
     _actionContextAccessor   = actionContextAccessor;
     _blogService             = blogService;
     _categoryService         = categoryService;
     _currencyService         = currencyService;
     _customerService         = customerService;
     _forumService            = forumService;
     _genericAttributeService = genericAttributeService;
     _httpContextAccessor     = httpContextAccessor;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _manufacturerService     = manufacturerService;
     _newsService             = newsService;
     _fileProvider            = fileProvider;
     _pageHeadBuilder         = pageHeadBuilder;
     _permissionService       = permissionService;
     _pictureService          = pictureService;
     _productService          = productService;
     _productTagService       = productTagService;
     _shoppingCartService     = shoppingCartService;
     _sitemapGenerator        = sitemapGenerator;
     _cacheManager            = cacheManager;
     _storeContext            = storeContext;
     _themeContext            = themeContext;
     _themeProvider           = themeProvider;
     _topicService            = topicService;
     _urlHelperFactory        = urlHelperFactory;
     _urlRecordService        = urlRecordService;
     _webHelper                = webHelper;
     _workContext              = workContext;
     _mediaSettings            = mediaSettings;
     _localizationSettings     = localizationSettings;
     _newsSettings             = newsSettings;
     _sitemapSettings          = sitemapSettings;
     _sitemapXmlSettings       = sitemapXmlSettings;
     _storeInformationSettings = storeInformationSettings;
     _vendorSettings           = vendorSettings;
 }
 public new void Setup()
 {
     _commonSettings = new CommonSettings();
     _validator      = new ContactVendorValidator(_localizationService, _commonSettings);
 }
 public CustomerModelFactory(IAddressModelFactory addressModelFactory,
                             IDateTimeHelper dateTimeHelper,
                             DateTimeSettings dateTimeSettings,
                             TaxSettings taxSettings,
                             ILocalizationService localizationService,
                             IWorkContext workContext,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             ICustomerAttributeParser customerAttributeParser,
                             ICustomerAttributeService customerAttributeService,
                             IGenericAttributeService genericAttributeService,
                             RewardPointsSettings rewardPointsSettings,
                             CommonSettings commonSettings,
                             CustomerSettings customerSettings,
                             AddressSettings addressSettings,
                             ForumSettings forumSettings,
                             OrderSettings orderSettings,
                             ICountryService countryService,
                             IStateProvinceService stateProvinceService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IExternalAuthenticationService externalAuthenticationService,
                             IDownloadService downloadService,
                             IReturnRequestService returnRequestService,
                             MediaSettings mediaSettings,
                             CaptchaSettings captchaSettings,
                             SecuritySettings securitySettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             CatalogSettings catalogSettings,
                             VendorSettings vendorSettings)
 {
     this._addressModelFactory            = addressModelFactory;
     this._dateTimeHelper                 = dateTimeHelper;
     this._dateTimeSettings               = dateTimeSettings;
     this._taxSettings                    = taxSettings;
     this._localizationService            = localizationService;
     this._workContext                    = workContext;
     this._storeContext                   = storeContext;
     this._storeMappingService            = storeMappingService;
     this._customerAttributeParser        = customerAttributeParser;
     this._customerAttributeService       = customerAttributeService;
     this._genericAttributeService        = genericAttributeService;
     this._rewardPointsSettings           = rewardPointsSettings;
     this._commonSettings                 = commonSettings;
     this._customerSettings               = customerSettings;
     this._addressSettings                = addressSettings;
     this._forumSettings                  = forumSettings;
     this._orderSettings                  = orderSettings;
     this._countryService                 = countryService;
     this._stateProvinceService           = stateProvinceService;
     this._orderService                   = orderService;
     this._pictureService                 = pictureService;
     this._newsLetterSubscriptionService  = newsLetterSubscriptionService;
     this._externalAuthenticationService  = externalAuthenticationService;
     this._downloadService                = downloadService;
     this._returnRequestService           = returnRequestService;
     this._mediaSettings                  = mediaSettings;
     this._captchaSettings                = captchaSettings;
     this._securitySettings               = securitySettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._catalogSettings                = catalogSettings;
     this._vendorSettings                 = vendorSettings;
 }
Beispiel #26
0
        public override void Draw(Graphics g)
        {
            g.SmoothingMode = this.DrawSmoothingMode;
            if (Selected)
            {
                //选中画出矩形框
                using (Pen pen = new Pen(Color.SkyBlue))
                {
                    pen.DashStyle   = System.Drawing.Drawing2D.DashStyle.Dash;
                    pen.DashPattern = new float[] { 3.0f, 3.0f };
                    g.DrawRectangle(pen, this.Rectangle);
                }

                //如果是选中状态画出虚线框
                using (Pen pen = new Pen(Color.SkyBlue))
                {
                    pen.DashStyle   = System.Drawing.Drawing2D.DashStyle.Dash;
                    pen.DashPattern = new float[] { 3.0f, 3.0f };

                    g.DrawRectangle(pen, this.Rectangle);
                    g.DrawLine(pen, 0, Rectangle.Y, Rectangle.X, Rectangle.Y);
                    g.DrawLine(pen, Rectangle.X, 0, Rectangle.X, Rectangle.Y);

                    Point xyNotice;
                    int   fontHeight = new Font("Verdana", 7).Height;
                    if (Rectangle.Y < fontHeight)
                    {
                        xyNotice = new Point(Rectangle.X, Rectangle.Y + Rectangle.Height + 2);
                    }
                    else
                    {
                        xyNotice = new Point(Rectangle.X + 2, Rectangle.Y - fontHeight - 2);
                    }
                    g.DrawString(string.Format("[X:{0} Y:{1}][W:{2} H:{3}]", (int)CommonSettings.PixelConvertMillimeter(Rectangle.X), (int)CommonSettings.PixelConvertMillimeter(Rectangle.Y), (int)CommonSettings.PixelConvertMillimeter(Rectangle.Width), (int)CommonSettings.PixelConvertMillimeter(Rectangle.Height)), new Font("Verdana", 7), Brushes.Blue, xyNotice);
                }

                //如果选 中则半透明填充
                using (SolidBrush sb = new SolidBrush(Color.FromArgb(60, Color.SkyBlue)))
                {
                    g.FillEllipse(sb, this.Rectangle);
                }
            }

            //如果不是透明则填充
            if (FillColor != Color.Transparent)
            {
                using (SolidBrush sb = new SolidBrush(FillColor))
                {
                    g.FillEllipse(sb, this.Rectangle);
                }
            }
            using (Pen dpen = new Pen(LineColor, LineWidth))
            {
                g.DrawEllipse(dpen, this.Rectangle);
            }
        }
 public SqlServerIntegration(CommonSettings commonSettings, IDataChangeDiscoverer[] changeDiscoverers)
 {
     _commonSettings    = commonSettings;
     _changeDiscoverers = changeDiscoverers;
 }
Beispiel #28
0
 public QueuedMessagesClearTask(SmartDbContext db, CommonSettings commonSettings)
 {
     _db             = db;
     _commonSettings = commonSettings;
 }
Beispiel #29
0
 public ContactUsCommandHandler(IContactAttributeService contactAttributeService, CommonSettings commonSettings, CaptchaSettings captchaSettings)
 {
     _contactAttributeService = contactAttributeService;
     _commonSettings          = commonSettings;
     _captchaSettings         = captchaSettings;
 }
Beispiel #30
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="cacheManager">Cache manager</param>
 /// <param name="activityLogRepository">Activity log repository</param>
 /// <param name="activityLogTypeRepository">Activity log type repository</param>
 /// <param name="workContext">Work context</param>
 /// <param name="dbContext">DB context</param>>
 /// <param name="dataProvider">WeData provider</param>
 /// <param name="commonSettings">Common settings</param>
 public CustomerActivityService(ICacheManager cacheManager,
                                IRepository <ActivityLog> activityLogRepository,
                                IRepository <ActivityLogType> activityLogTypeRepository,
                                IWorkContext workContext,
                                IDbContext dbContext, IDataProvider dataProvider, CommonSettings commonSettings)
 {
     this._cacheManager              = cacheManager;
     this._activityLogRepository     = activityLogRepository;
     this._activityLogTypeRepository = activityLogTypeRepository;
     this._workContext    = workContext;
     this._dbContext      = dbContext;
     this._dataProvider   = dataProvider;
     this._commonSettings = commonSettings;
 }
        public CommonWebService(ICacheManager cacheManager,
                                IStoreContext storeContext,
                                IStoreService storeService,
                                IThemeContext themeContext,
                                IPictureService pictureService,
                                IWebHelper webHelper,
                                ILanguageService languageService,
                                IWorkContext workContext,
                                ICurrencyService currencyService,
                                IPermissionService permissionService,
                                IPageHeadBuilder pageHeadBuilder,
                                ITopicService topicService,
                                IWorkflowMessageService workflowMessageService,
                                ILocalizationService localizationService,
                                ICategoryService categoryService,
                                IManufacturerService manufacturerService,
                                IProductService productService,
                                ISitemapGenerator sitemapGenerator,
                                IThemeProvider themeProvider,
                                IForumService forumservice,
                                IHostingEnvironment hostingEnvironment,
                                StoreInformationSettings storeInformationSettings,
                                LocalizationSettings localizationSettings,
                                TaxSettings taxSettings,
                                CustomerSettings customerSettings,
                                ForumSettings forumSettings,
                                CatalogSettings catalogSettings,
                                BlogSettings blogSettings,
                                NewsSettings newsSettings,
                                VendorSettings vendorSettings,
                                CommonSettings commonSettings,
                                CaptchaSettings captchaSettings
                                )
        {
            this._cacheManager           = cacheManager;
            this._storeContext           = storeContext;
            this._storeService           = storeService;
            this._themeContext           = themeContext;
            this._pictureService         = pictureService;
            this._webHelper              = webHelper;
            this._languageService        = languageService;
            this._workContext            = workContext;
            this._currencyService        = currencyService;
            this._permissionService      = permissionService;
            this._pageHeadBuilder        = pageHeadBuilder;
            this._topicService           = topicService;
            this._workflowMessageService = workflowMessageService;
            this._localizationService    = localizationService;
            this._categoryService        = categoryService;
            this._manufacturerService    = manufacturerService;
            this._productService         = productService;
            this._sitemapGenerator       = sitemapGenerator;
            this._themeProvider          = themeProvider;
            this._forumservice           = forumservice;
            this._hostingEnvironment     = hostingEnvironment;

            this._storeInformationSettings = storeInformationSettings;
            this._localizationSettings     = localizationSettings;
            this._taxSettings      = taxSettings;
            this._customerSettings = customerSettings;
            this._forumSettings    = forumSettings;
            this._catalogSettings  = catalogSettings;
            this._blogSettings     = blogSettings;
            this._newsSettings     = newsSettings;
            this._vendorSettings   = vendorSettings;
            this._commonSettings   = commonSettings;
            this._captchaSettings  = captchaSettings;
        }
Beispiel #32
0
 public GetShoppingCartHandler(
     ICacheManager cacheManager,
     IPaymentService paymentService,
     IProductService productService,
     IPictureService pictureService,
     IProductAttributeParser productAttributeParser,
     ILocalizationService localizationService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     IOrderProcessingService orderProcessingService,
     ICurrencyService currencyService,
     IDiscountService discountService,
     IShoppingCartService shoppingCartService,
     ICheckoutAttributeService checkoutAttributeService,
     IPermissionService permissionService,
     ITaxService taxService,
     IPriceFormatter priceFormatter,
     ICheckoutAttributeParser checkoutAttributeParser,
     IDownloadService downloadService,
     ICountryService countryService,
     IShippingService shippingService,
     IProductAttributeFormatter productAttributeFormatter,
     IPriceCalculationService priceCalculationService,
     IDateTimeHelper dateTimeHelper,
     IVendorService vendorService,
     IMediator mediator,
     MediaSettings mediaSettings,
     OrderSettings orderSettings,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings,
     ShippingSettings shippingSettings,
     CommonSettings commonSettings)
 {
     _cacheManager               = cacheManager;
     _paymentService             = paymentService;
     _productService             = productService;
     _pictureService             = pictureService;
     _productAttributeParser     = productAttributeParser;
     _localizationService        = localizationService;
     _checkoutAttributeFormatter = checkoutAttributeFormatter;
     _orderProcessingService     = orderProcessingService;
     _currencyService            = currencyService;
     _discountService            = discountService;
     _shoppingCartService        = shoppingCartService;
     _checkoutAttributeService   = checkoutAttributeService;
     _permissionService          = permissionService;
     _taxService                = taxService;
     _priceFormatter            = priceFormatter;
     _checkoutAttributeParser   = checkoutAttributeParser;
     _downloadService           = downloadService;
     _countryService            = countryService;
     _shippingService           = shippingService;
     _productAttributeFormatter = productAttributeFormatter;
     _priceCalculationService   = priceCalculationService;
     _dateTimeHelper            = dateTimeHelper;
     _vendorService             = vendorService;
     _mediator             = mediator;
     _mediaSettings        = mediaSettings;
     _orderSettings        = orderSettings;
     _shoppingCartSettings = shoppingCartSettings;
     _catalogSettings      = catalogSettings;
     _shippingSettings     = shippingSettings;
     _commonSettings       = commonSettings;
 }
Beispiel #33
0
        public ECommerceUnitTests()
        {
            int.TryParse(ConfigurationManager.AppSettings["TwoFactorAuthTimeSpan"], out _twoFactorAuthTimeSpan);
            int.TryParse(ConfigurationManager.AppSettings["TwoFactorTimeOut"], out _twoFactorTimeOut);
            bool.TryParse(ConfigurationManager.AppSettings["TwoFactorEnabled"], out _twoFactorEnabled);
            _twoFactorAuthCookie    = ConfigurationManager.AppSettings["TwoFactorAuthCookie"];
            _twoFactorAuthSmtpHost  = ConfigurationManager.AppSettings["TwoFactorAuthSmtpHost"];
            _twoFactorAuthFromEmail = ConfigurationManager.AppSettings["TwoFactorAuthFromEmail"];
            _twoFactorAuthFromPhone = ConfigurationManager.AppSettings["TwoFactorAuthFromPhone"];
            _emailPassword          = ConfigurationManager.AppSettings["EmailPassword"];
            _authToken  = ConfigurationManager.AppSettings["TwilioAuthToken"];
            _accountSID = ConfigurationManager.AppSettings["TwilioAccountSID"];

            //Get payfabric configs
            _payfabricDeviceId       = ConfigurationManager.AppSettings["PayfabricDeviceId"];
            _payfabricDevicePassword = ConfigurationManager.AppSettings["PayfabricDevicePassword"];
            _payfabricDeviceUrl      = ConfigurationManager.AppSettings["PayfabricDeviceUrl"];


            var smsConfigs = new InitTwoFactor()
            {
                TwoFactorAuthTimeSpan  = _twoFactorAuthTimeSpan,
                TwoFactorAuthCookie    = _twoFactorAuthCookie,
                TwoFactorAuthSmtpHost  = _twoFactorAuthSmtpHost,
                TwoFactorAuthFromEmail = _twoFactorAuthFromEmail,
                TwoFactorAuthFromPhone = _twoFactorAuthFromPhone,
                AuthToken        = _authToken,
                AccountSID       = _accountSID,
                TwoFactorEnabled = _twoFactorEnabled,
                EmailPassword    = _emailPassword
            };

            _twoFactorAuth = new TwoFactorAuth(smsConfigs);

            //repositories
            var catalogSettings        = new CatalogSettings();
            var commonSettings         = new CommonSettings();
            var categoryRepository     = new CategoryRepository(connectionString);
            var productRepository      = new ProductRepository(connectionString);
            var productCategory        = new ProductCategoryMappingRepository(connectionString);
            var shoppingCartRepository = new ShoppingCartItemRepository(connectionString);

            var _pictureBinaryRepository = new PictureBinaryRepository(connectionString);
            var _pictureRepository       = new PictureRepository(connectionString);
            var _productAttributeCombinationRepository          = new ProductAttributeCombinationRepository(connectionString);
            var _productAttributeRepository                     = new ProductAttributeRepository(connectionString);
            var _productAttributeValueRepository                = new ProductAttributeValueRepository(connectionString);
            var _productAvailabilityRangeRepository             = new ProductAvailabilityRangeRepository(connectionString);
            var _productCategoryMappingRepository               = new ProductCategoryMappingRepository(connectionString);
            var _productProductAttributeMappingRepository       = new ProductProductAttributeMappingRepository(connectionString);
            var _productProductTagMappingRepository             = new ProductTagMappingRepository(connectionString);
            var _productSpecificationAttributeMappingRepository = new ProductSpecificationAttributeRepository(connectionString);
            var _specificationAttributeOptionRepository         = new SpecificationAttributeOptionRepository(connectionString);
            var _specificationAttributeRepository               = new SpecificationAttributeRepository(connectionString);
            var _productRepository = new ProductRepository(connectionString);
            var _productManufacturerMappingRepository = new ProductManufacturerMappingRepository(connectionString);
            var _productPictureRepository             = new ProductPictureRepository(connectionString);
            var _productReviewsRepository             = new ProductReviewsRepository(connectionString);
            var _tierPricesRepository                = new TierPricesRepository(connectionString);
            var _discountProductMappingRepository    = new DiscountProductMappingRepository(connectionString);
            var _productWarehouseInventoryRepository = new ProductWarehouseInventoryRepository(connectionString);
            var _customerRepository = new CustomerRepository(connectionString);

            //services
            _categoryService = new CategoryService(catalogSettings, commonSettings, categoryRepository, productRepository, productCategory);

            _menuService    = new MenuService(_categoryService);
            _cartService    = new CartService(commonSettings, shoppingCartRepository);
            _productService = new ProductService(
                _pictureBinaryRepository,
                _pictureRepository,
                _productAttributeCombinationRepository,
                _productAttributeRepository,
                _productAttributeValueRepository,
                _productAvailabilityRangeRepository,
                _productCategoryMappingRepository,
                _productProductAttributeMappingRepository,
                _productProductTagMappingRepository,
                _productSpecificationAttributeMappingRepository,
                _specificationAttributeOptionRepository,
                _specificationAttributeRepository,
                _productRepository,
                _productManufacturerMappingRepository,
                _productPictureRepository,
                _productReviewsRepository,
                _tierPricesRepository,
                _discountProductMappingRepository,
                _productWarehouseInventoryRepository
                );
            _customerService = new CustomerService(_customerRepository);
        }