private void SavePaymentMethod() { try { // update provider settings IPluginProperties ctlSettings = (IPluginProperties)FindControl(CTL_CC_PROVIDER); // int result = StorehouseHelper.SetPluginProperties(ExtractProvId(ddlAcceptPlugins.SelectedValue), ctlSettings.Properties); // if (result < 0) { ShowResultMessage(result); // return; } // update payment method result = StorehouseHelper.SetPaymentMethod(PaymentMethod.CREDIT_CARD, txtDisplayName.Text.Trim(), ExtractProvId(ddlAcceptPlugins.SelectedValue)); // if (result < 0) { ShowResultMessage(result); // return; } // RedirectToBrowsePage(); } catch (Exception ex) { ShowErrorMessage("SAVE_PAYMENT_METHOD", ex); } }
public StandalonePluginProvision(Type pluginType, IPluginProperties pluginProperties) { var attribute = pluginType.GetCustomAttribute <PluginAttribute>(); if (attribute == null) { throw new InvalidOperationException("Plugin is not marked with an attribute"); } this.Name = attribute.PluginName; this.Author = attribute.Author; this.Description = attribute.Description; this.Version = attribute.Version; this.Properties = pluginProperties; this.ConfigurationStore = EmptyPluginConfigurationStore.EmptyConfigurationStore; }
public PluginProvision(ILogger logger, IPluginProperties pluginProperties, IPluginConfigurationStore configurationStore, string name, string author, string description, Version version, DirectoryInfo contentDirectory, DirectoryInfo commonResourceDirectory, DirectoryInfo resourceDirectory) { this.Logger = logger; this.Properties = pluginProperties; this.Name = name; this.Author = author; this.Description = description; this.Version = version; this.ConfigurationStore = configurationStore; this.ContentDirectory = contentDirectory; this.ResourceDirectory = resourceDirectory; this.CommonResourceDirectory = commonResourceDirectory; }
private void LoadProviderProperties(string pluginName) { if (String.IsNullOrEmpty(pluginName)) { return; } Control ctlLoaded = LoadControl("SupportedPlugins/" + ExtractProvName(pluginName) + "_Settings.ascx"); // ctlLoaded.ID = CTL_CC_PROVIDER; // cntCcProvSettings.Controls.Clear(); // cntCcProvSettings.Controls.Add(ctlLoaded); // IPluginProperties ctlSettings = (IPluginProperties)ctlLoaded; // ctlSettings.Properties = StorehouseHelper.GetPluginProperties(ExtractProvId(pluginName)); }
public override void Initialize() { if (WasInitialized) return; battleCount = 0; _petLua = PetLua.Instance; _pluginSettings = new PluginSettings(); _pluginProperties = _pluginSettings as IPluginProperties; _petJournal = new PetJournal(_pluginProperties, _petLua); _petChooser = new PetChooser(_pluginProperties, _petLua, _petJournal); _petLoader = new PetLoader(_petLua); _petReport = new PetReport(); _zoneTable = new ZoneList(); _lastEnemyLevel = 0; CurrentProfileLevel = 0; MyPets.updateMyPets(); // some healing behavior may need to know the current state Moved = false; Selected = false; AnimationActive = false; LoadSuccess = true; // no failures detected yet rand = new Random(); ReactionTime = rand.NextDouble() * 1000 + 500; Logger.Write(string.Format("Reaction time set about {0:F1} msec" , ReactionTime)); numPetsOwnedOnStart = _petLua.GetNumPetsOwned(); isSlotAvailableOnStart = ! _petLua.IsSlotLocked(1); Logger.WriteDebug("Owned on start: " + numPetsOwnedOnStart + ", slot available: " + isSlotAvailableOnStart); if( !string.IsNullOrEmpty(PluginSettings.Instance.LastProfile) ) LoadProfile(PluginSettings.Instance.LastProfile); // will fight everything. Is "nothing" better? WasInitialized = true; }
public PetJournal(IPluginProperties pluginProperties, IPetLua petLua) { _petLua = petLua; _pluginProperties = pluginProperties; Instance = this; }
public PetChooser(IPluginProperties pluginProperties, IPetLua petLua, IPetJournal petJournal) { _petLua = petLua; _pluginProperties = pluginProperties; _petJournal = petJournal; }