Exemplo n.º 1
0
        /// <summary>
        /// Sets the screen up (UI components, multimedia content, etc.)
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            // TODO: Replace these comments with your own poetry, and enjoy!
            StoreConfiguration conf = new StoreConfiguration();
            conf.Android.Enabled = true;
            conf.IOS.Enabled = true;
            //conf.WindowsPhone.Enabled = true;

            List<InAppProduct> productList = new List<InAppProduct>();

            myProduct = new InAppProduct("com.syderis.cellsdk.myProduct", InAppProductType.NonConsumable);
            productList.Add(myProduct);

            conf.ProductList = productList;

            InAppStore.OnUpdateTransaction += HandleInAppStoreOnUpdateTransaction;

            InAppStore.Initialize(conf);

            Button buy = new Button("Buy!");
            buy.Released += new Component.ComponentEventHandler(buy_Released);
            AddComponent(buy, 100, 100);
        }
Exemplo n.º 2
0
 public UserManager(StoreConfiguration <TUser, TClaim, TLogin> storeCollection,
                    ValidationConfiguration <TUser> validationConfiguration, ILogger logger)
 {
     if (storeCollection == null)
     {
         throw new ArgumentNullException(nameof(storeCollection));
     }
     if (storeCollection.Validate() != null)
     {
         throw new ArgumentNullException(storeCollection.Validate());
     }
     if (validationConfiguration == null)
     {
         throw new ArgumentNullException(nameof(validationConfiguration));
     }
     if (validationConfiguration.Validate() != null)
     {
         throw new ArgumentNullException(validationConfiguration.Validate());
     }
     UserStore               = storeCollection.UserStore;
     PasswordStore           = storeCollection.PasswordStore;
     EmailStore              = storeCollection.EmailStore;
     ClaimStore              = storeCollection.ClaimStore;
     TokenStore              = storeCollection.TokenStore;
     LockoutStore            = storeCollection.LockoutStore;
     ValidationConfiguration = validationConfiguration;
     Logger = logger;
 }
Exemplo n.º 3
0
    protected void EditButton_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }

        try
        {
            StoreConfiguration.UpdateValue(ConfigurationKey.StoreName, StoreName.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.StoreURL, StoreURL.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.SalesTeamEmail, SalesTeamEmail.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.NewOrdersEmail, NewOrdersEmail.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.ContactEmail, ContactEmail.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.PayPalAPIUsername, PayPalAPIUsername.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.PayPalAPIPassword, PayPalAPIPassword.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.PayPalAPISignature, PayPalAPISignature.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.GoogleCheckoutEnabled, GoogleCheckoutEnabled.Checked.ToString().ToLower());
            StoreConfiguration.UpdateValue(ConfigurationKey.GoogleMerchantID, GoogleMerchantID.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.GoogleMerchantkey, GoogleMerchantkey.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.GoogleImageButtonURL, GoogleImageButtonURL.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.GoogleCheckoutURL, GoogleCheckoutURL.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.AuthorizeNetTestMode, AuthorizeNetTestMode.Checked.ToString().ToLower());
            StoreConfiguration.UpdateValue(ConfigurationKey.AuthorizeNetAPILoginID, AuthorizeNetAPILoginID.Text);
            StoreConfiguration.UpdateValue(ConfigurationKey.AuthorizeNetTransactionKey, AuthorizeNetTransactionKey.Text);

            StoreConfigurations.SaveAll();
            ErrorLiteral.Text = "Configuration Saved";
        }
        catch (Exception ex)
        {
            ErrorLiteral.Text = "ERROR Saving configuration: " + ex.Message;
        }
    }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         GoogleImageButton.ImageUrl = String.Format(StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleImageButtonURL), StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantID));
     }
 }
Exemplo n.º 5
0
        public static int Main()
        {
            CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();

            try
            {
                AppState initialState = new AppState();

                IStore <AppState> store = new StoreConfiguration <AppState>()
                                          .UseReduxDevTools(options => options.ClientName = "RestSharp.WPF")
                                          .UseMiddleware <LoggerMiddleware>()
                                          .UseReducer <AboutReducer, About>(state => state.About)
                                          .UseReducer <UserReducer, UserInfo>(state => state.User)
                                          .UseReducer <ViewReducer, ViewState>(state => state.View)
                                          .UseInitialState(initialState)
                                          .UseDefaultActivator()
                                          .UseDefaultLogger(options => options.MinimumLogLevel = LogLevel.Verbose)
                                          .CreateStore <WPFStore <AppState> >();

                App app = new App(store);
                app.Run();
            }
            catch
            {
                return(-1);
            }

            return(0);
        }
Exemplo n.º 6
0
    protected void EmailButton_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }
        SaveButton_Click(sender, e);
        string cartID = GetLoggedUserName();

        if (string.IsNullOrEmpty(cartID))
        {
            cartID = Request.AnonymousID;
        }

        string cartLink = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreURL) + "/ShoppingCart.aspx?CartID=" + cartID;

        try
        {
            EmailManager.EmailCart(cartLink, EmailTextBox.Text);
            MessageLiteral.Text = "Your cart has been emailed";
        }
        catch (Exception ex)
        {
            MessageLiteral.Text = ex.Message;
        }
    }
Exemplo n.º 7
0
        public void TestCreateNewMaster()
        {
            var pm      = new FilePersistenceManager();
            var dirName = "TestCreateNewMaster1";

            pm.CreateDirectory(dirName);
            var storeConfig = new StoreConfiguration {
                PersistenceType = PersistenceType.AppendOnly
            };
            var storeSetId = Guid.NewGuid();
            var mf         = MasterFile.Create(pm, dirName, storeConfig, storeSetId);
            var storeId    = mf.StoreId;

            mf = MasterFile.Open(pm, dirName);
            Assert.AreEqual(storeId, mf.StoreId);
            Assert.AreEqual(storeSetId, mf.StoreSetId);
            Assert.AreEqual(StoreType.Standard, mf.StoreType);
            Assert.AreEqual(PersistenceType.AppendOnly, mf.PersistenceType);

            dirName = "TestCreateNewMaster2";
            pm.CreateDirectory(dirName);
            storeConfig.PersistenceType = PersistenceType.Rewrite;
            storeSetId = Guid.NewGuid();
            mf         = MasterFile.Create(pm, dirName, storeConfig, storeSetId);
            storeId    = mf.StoreId;
            mf         = MasterFile.Open(pm, dirName);
            Assert.AreEqual(storeId, mf.StoreId);
            Assert.AreEqual(storeSetId, mf.StoreSetId);
            Assert.AreEqual(StoreType.Standard, mf.StoreType);
            Assert.AreEqual(PersistenceType.Rewrite, mf.PersistenceType);

            // Enumerating commit points of a new master file should not throw an error
            Assert.AreEqual(0, mf.GetCommitPoints().Count());
        }
Exemplo n.º 8
0
        public void TestCorruptCommitPoint()
        {
            var pm      = new FilePersistenceManager();
            var dirName = "TestCorruptCommitPoint";

            pm.CreateDirectory(dirName);
            var storeConfig = new StoreConfiguration {
                PersistenceType = PersistenceType.AppendOnly
            };
            var      storeSetId   = Guid.NewGuid();
            var      mf           = MasterFile.Create(pm, dirName, storeConfig, storeSetId);
            DateTime commit1Time  = DateTime.UtcNow;
            Guid     commit1JobId = Guid.NewGuid();

            mf = MasterFile.Open(pm, dirName);
            mf.AppendCommitPoint(new CommitPoint(1ul, 1ul, commit1Time, commit1JobId));
            DateTime commit2Time  = DateTime.UtcNow;
            Guid     commit2JobId = Guid.NewGuid();

            mf = MasterFile.Open(pm, dirName);
            mf.AppendCommitPoint(new CommitPoint(2ul, 2ul, commit2Time, commit2JobId));

            mf = MasterFile.Open(pm, dirName);
            var allCommits = mf.GetCommitPoints().ToList();

            Assert.AreEqual(2, allCommits.Count);

            using (var fs = pm.GetOutputStream(Path.Combine(dirName, MasterFile.MasterFileName), FileMode.Open))
            {
                fs.Seek(-250, SeekOrigin.End);
                fs.WriteByte(255);
            }
            // Error in one half of commit point should not cause a problem
            mf = MasterFile.Open(pm, dirName);
            var lastCommit = mf.GetLatestCommitPoint();

            allCommits = mf.GetCommitPoints().ToList();
            Assert.AreEqual(2, allCommits.Count);
            Assert.AreEqual(2ul, lastCommit.CommitNumber);
            Assert.AreEqual(2ul, lastCommit.LocationOffset);
            Assert.AreEqual(commit2JobId, lastCommit.JobId);
            Assert.AreEqual(commit2Time.Ticks, lastCommit.CommitTime.Ticks);

            using (var fs = pm.GetOutputStream(Path.Combine(dirName, MasterFile.MasterFileName), FileMode.Open))
            {
                fs.Seek(-120, SeekOrigin.End);
                fs.WriteByte(255);
            }
            // Error in both halves of commit point should force a rewind to previous commit point
            mf         = MasterFile.Open(pm, dirName);
            lastCommit = mf.GetLatestCommitPoint();
            allCommits = mf.GetCommitPoints().ToList();
            Assert.AreEqual(1, allCommits.Count);

            Assert.AreEqual(1ul, lastCommit.CommitNumber);
            Assert.AreEqual(1ul, lastCommit.LocationOffset);
            Assert.AreEqual(commit1JobId, lastCommit.JobId);
            Assert.AreEqual(commit1Time.Ticks, lastCommit.CommitTime.Ticks);
        }
Exemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         BindProducts();
         Page.Title = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
     }
 }
Exemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (StoreConfiguration.GetConfigurationValue(ConfigurationKey.SetupRan) == "true")
     {
         Utils.IS_CONFIGURED = true;
         Response.Redirect("../Default.aspx");
     }
 }
        private static void SaveConfig(AppStore enabled)
        {
            var configToSave = new StoreConfiguration(enabled);

            File.WriteAllText(ModePath, StoreConfiguration.Serialize(configToSave));
            AssetDatabase.ImportAsset(ModePath);
            config = configToSave;
        }
Exemplo n.º 12
0
        public DicomInstanceEntryReaderForSinglePartRequest(ISeekableStreamConverter seekableStreamConverter, IOptions <StoreConfiguration> storeConfiguration)
        {
            EnsureArg.IsNotNull(seekableStreamConverter, nameof(seekableStreamConverter));
            EnsureArg.IsNotNull(storeConfiguration, nameof(storeConfiguration));
            EnsureArg.IsNotNull(storeConfiguration?.Value, nameof(storeConfiguration));


            _seekableStreamConverter = seekableStreamConverter;
            _storeConfiguration      = storeConfiguration.Value;
        }
Exemplo n.º 13
0
    public void SetBasicConfiguration()
    {
        StoreConfiguration.UpdateValue(ConfigurationKey.StoreName, ((TextBox)CreateUserWizard1.WizardSteps[1].Controls[0].FindControl("StoreName")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.StoreURL, ((TextBox)CreateUserWizard1.WizardSteps[1].Controls[0].FindControl("StoreURL")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.SalesTeamEmail, ((TextBox)CreateUserWizard1.WizardSteps[1].Controls[0].FindControl("SalesTeamEmail")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.NewOrdersEmail, ((TextBox)CreateUserWizard1.WizardSteps[1].Controls[0].FindControl("NewOrdersEmail")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.ContactEmail, ((TextBox)CreateUserWizard1.WizardSteps[1].Controls[0].FindControl("ContactEmail")).Text);

        StoreConfigurations.SaveAll();
    }
Exemplo n.º 14
0
        public ServerCore(string baseLocation, ICache queryCache, PersistenceType persistenceType)
        {
            Logging.LogInfo("ServerCore Initialised {0}", baseLocation);
            _baseLocation = baseLocation;
            _stores       = new Dictionary <string, StoreWorker>();
            var configuration = new StoreConfiguration {
                PersistenceType = persistenceType
            };

            _storeManager = StoreManagerFactory.GetStoreManager(configuration);
            _queryCache   = queryCache;
        }
Exemplo n.º 15
0
 private static void OnPostProcessScene()
 {
     if (File.Exists(ModePath))
     {
         try {
             config = StoreConfiguration.Deserialize(File.ReadAllText(ModePath));
             ConfigureProject(config.androidStore);
         } catch (Exception e) {
             Debug.LogError("Unity IAP unable to strip undesired Android stores from build, use menu (e.g. " + GooglePlayMenuItem + ") and check file: " + ModePath);
             Debug.LogError(e);
         }
     }
 }
    public static void SetStoreConfiguration(this DbContext db, string key, object value)
    {
        var sc = db.Set <StoreConfiguration>().Find(key);

        if (sc == null)
        {
            sc = new StoreConfiguration {
                Key = key
            };
            db.Set <StoreConfiguration>().Add(sc);
        }
        sc.Value = value == null ? null : value.ToString();
    }
Exemplo n.º 17
0
        public NetoResourceBase(StoreConfiguration storeConfiguration, string resourceEndpoint, IRestClient restClient)
        {
            if (storeConfiguration == null)
            {
                throw new ArgumentNullException("Must provide a store configuration.");
            }

            this._storeConfiguration = storeConfiguration;

            if (restClient == null)
            {
                _restClient = new RestClient(null, BuildURI(resourceEndpoint), storeConfiguration.APIkey, storeConfiguration.Username);
            }
        }
Exemplo n.º 18
0
        private static void OpenSession()
        {
            var storeConfiguration = new StoreConfiguration();
            var configuration      = Fluently.Configure()
                                     .Database(MsSqlCeConfiguration.Standard.ShowSql().ConnectionString("Data Source=CustomerImport.sdf"))
                                     .Mappings(m => m.AutoMappings.Add(AutoMap
                                                                       .AssemblyOf <Customer>(storeConfiguration)
                                                                       .Override <Customer>(map => map.HasMany(x => x.Addresses).Cascade.All())));

            var sessionFactory = configuration.BuildSessionFactory();

            new SchemaExport(configuration.BuildConfiguration()).Execute(true, true, false);
            session = sessionFactory.OpenSession();
        }
Exemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["CartID"]))
            {
                LoadCart(Request.QueryString["CartID"]);
            }

            BindCart();
            GoogleCheckoutControl1.Visible = Convert.ToBoolean(StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleCheckoutEnabled));
            Page.Title = "My Cart - " + StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
        }
    }
Exemplo n.º 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     RelatedProductsControl1.ProductID = CartProduct.ProductID.ToString();
     ProductOptionsControl1.ProductID  = CartProduct.ProductID;
     CustomFieldsControl1.ProductID    = CartProduct.ProductID;
     if (ProductBreadcrumbControl1 != null)
     {
         ProductBreadcrumbControl1.ProductID = CartProduct.ProductID;
     }
     if (!Page.IsPostBack)
     {
         Page.Title = CartProduct.ProductName + " - " + StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
         CheckProductInventory();
     }
 }
Exemplo n.º 21
0
    public void SetPaymentConfiguration()
    {
        StoreConfiguration.UpdateValue(ConfigurationKey.PayPalAPIUsername, ((TextBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("PayPalAPIUsername")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.PayPalAPIPassword, ((TextBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("PayPalAPIPassword")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.PayPalAPISignature, ((TextBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("PayPalAPISignature")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.GoogleCheckoutEnabled, ((CheckBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("GoogleCheckoutEnabled")).Checked.ToString().ToLower());
        StoreConfiguration.UpdateValue(ConfigurationKey.GoogleMerchantID, ((TextBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("GoogleMerchantID")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.GoogleMerchantkey, ((TextBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("GoogleMerchantkey")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.GoogleImageButtonURL, ((TextBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("GoogleImageButtonURL")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.AuthorizeNetTestMode, ((CheckBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("AuthorizeNetTestMode")).Checked.ToString().ToLower());
        StoreConfiguration.UpdateValue(ConfigurationKey.AuthorizeNetAPILoginID, ((TextBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("AuthorizeNetAPILoginID")).Text);
        StoreConfiguration.UpdateValue(ConfigurationKey.AuthorizeNetTransactionKey, ((TextBox)CreateUserWizard1.WizardSteps[2].Controls[0].FindControl("AuthorizeNetTransactionKey")).Text);

        StoreConfigurations.SaveAll();
    }
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Assert Methods
        public static void Equal(StoreConfiguration expected, StoreConfiguration actual)
        {
            // Handle when 'expected' is null.
            if (expected == null)
            {
                Assert.Null(actual);
                return;
            }
            Assert.NotNull(actual);

            Assert.Equal(expected.StoreConfigurationId, actual.StoreConfigurationId);
            Assert.Equal(expected.IsLive, actual.IsLive);
            MailingAddressAssert.Equal(expected.MailingAddress, actual.MailingAddress);
            PhoneNumberAssert.Equal(expected.PhoneNumbers, actual.PhoneNumbers);
        }
Exemplo n.º 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //If store is not configurated, show configuration screen
     if (!Utils.IS_CONFIGURED && StoreConfiguration.GetConfigurationValue(ConfigurationKey.SetupRan) == "true")
     {
         Utils.IS_CONFIGURED = true;
     }
     else if (!Utils.IS_CONFIGURED)
     {
         Response.Redirect("Setup/Default.aspx");
     }
     if (!Page.IsPostBack)
     {
         Page.Title = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
     }
 }
Exemplo n.º 24
0
 protected void GoogleImageButton_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string           orderXML       = GetGoogleCartCode();
         string           googleResponse = Utils.PostToURL(String.Format(StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleCheckoutURL), StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantID)), orderXML, StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantID), StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantkey));
         TextReader       reader         = new StringReader(googleResponse);
         XmlSerializer    serializer     = new XmlSerializer(typeof(CheckoutRedirect));
         CheckoutRedirect redirect       = (CheckoutRedirect)serializer.Deserialize(reader);
         Response.Redirect(redirect.redirecturl);
     }
     catch (Exception ex)
     {
         MessageLabel.Text = "Problem using Google Checkout.";
     }
 }
Exemplo n.º 25
0
        public IActionResult Export([FromBody] Configuration configuration)
        {
            using (TextWriter writer = new StreamWriter($"output\\{configuration.Name}.json", false))
            {
                StoreConfiguration storeConfig = new StoreConfiguration();
                storeConfig.name = configuration.Name;
                foreach (var feat in configuration.Features)
                {
                    if (!feat.Available)
                    {
                        continue;
                    }

                    StoreFeature storeFeat = new StoreFeature();
                    if (feat.Module != "")
                    {
                        storeFeat.isModule    = true;
                        storeFeat.description = feat.Module.TrimStart('_') + " " + feat.Functionality;
                    }
                    else
                    {
                        storeFeat.isModule    = false;
                        storeFeat.description = feat.Functionality;
                    }
                    storeFeat.fragment = feat.Fragment;

                    storeFeat.options.Add(new StoreFeatureOption {
                        edition = "STD", availability = ConvertStoreFeatureOption(feat.Standard)
                    });
                    storeFeat.options.Add(new StoreFeatureOption {
                        edition = "PRO", availability = ConvertStoreFeatureOption(feat.Professional)
                    });
                    storeFeat.options.Add(new StoreFeatureOption {
                        edition = "ENT", availability = ConvertStoreFeatureOption(feat.Enterprise)
                    });

                    storeConfig.features.Add(storeFeat);
                }
                string json = JsonConvert.SerializeObject(storeConfig, new JsonSerializerSettings {
                    Formatting = Formatting.Indented
                });
                writer.WriteLine(json);
            }
            return(NoContent());
        }
 private static void OnPostProcessScene()
 {
     if (File.Exists(ModePath))
     {
         try {
             config = StoreConfiguration.Deserialize(File.ReadAllText(ModePath));
             ConfigureProject(config.androidStore);
         } catch (Exception e) {
             #if ENABLE_EDITOR_GAME_SERVICES
             Debug.LogError("Unity IAP unable to strip undesired Android stores from build, check file: " + ModePath);
             #else
             Debug.LogError("Unity IAP unable to strip undesired Android stores from build, use menu (e.g. "
                            + SwitchStoreMenuItem + ") and check file: " + ModePath);
             #endif
             Debug.LogError(e);
         }
     }
 }
Exemplo n.º 27
0
        public void TestAppendCommitPoint()
        {
            var          pm      = new FilePersistenceManager();
            const string dirName = "TestAppendCommitPoint";

            EnsureEmptyDirectory(pm, dirName);

            var storeConfig = new StoreConfiguration {
                PersistenceType = PersistenceType.AppendOnly
            };
            var      storeSetId   = Guid.NewGuid();
            var      mf           = MasterFile.Create(pm, dirName, storeConfig, storeSetId);
            DateTime commit1Time  = DateTime.UtcNow;
            Guid     commit1JobId = Guid.NewGuid();

            mf = MasterFile.Open(pm, dirName);
            mf.AppendCommitPoint(new CommitPoint(1ul, 1ul, commit1Time, commit1JobId));
            DateTime commit2Time  = DateTime.UtcNow;
            Guid     commit2JobId = Guid.NewGuid();

            mf = MasterFile.Open(pm, dirName);
            mf.AppendCommitPoint(new CommitPoint(2ul, 2ul, commit2Time, commit2JobId));

            mf = MasterFile.Open(pm, dirName);
            var allCommits = mf.GetCommitPoints().ToList();

            Assert.AreEqual(2, allCommits.Count);
            Assert.AreEqual(2ul, allCommits[0].CommitNumber);
            Assert.AreEqual(2ul, allCommits[0].LocationOffset);
            Assert.AreEqual(commit2JobId, allCommits[0].JobId);
            Assert.AreEqual(commit2Time.Ticks, allCommits[0].CommitTime.Ticks);

            Assert.AreEqual(1ul, allCommits[1].CommitNumber);
            Assert.AreEqual(1ul, allCommits[1].LocationOffset);
            Assert.AreEqual(commit1JobId, allCommits[1].JobId);
            Assert.AreEqual(commit1Time.Ticks, allCommits[1].CommitTime.Ticks);

            var lastCommit = mf.GetLatestCommitPoint();

            Assert.AreEqual(2ul, lastCommit.CommitNumber);
            Assert.AreEqual(2ul, lastCommit.LocationOffset);
            Assert.AreEqual(commit2JobId, lastCommit.JobId);
            Assert.AreEqual(commit2Time.Ticks, lastCommit.CommitTime.Ticks);
        }
Exemplo n.º 28
0
 private void LoadForm()
 {
     StoreName.Text                  = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
     StoreURL.Text                   = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreURL);
     SalesTeamEmail.Text             = StoreConfiguration.GetConfigurationValue(ConfigurationKey.SalesTeamEmail);
     NewOrdersEmail.Text             = StoreConfiguration.GetConfigurationValue(ConfigurationKey.NewOrdersEmail);
     ContactEmail.Text               = StoreConfiguration.GetConfigurationValue(ConfigurationKey.ContactEmail);
     PayPalAPIUsername.Text          = StoreConfiguration.GetConfigurationValue(ConfigurationKey.PayPalAPIUsername);
     PayPalAPIPassword.Text          = StoreConfiguration.GetConfigurationValue(ConfigurationKey.PayPalAPIPassword);
     PayPalAPISignature.Text         = StoreConfiguration.GetConfigurationValue(ConfigurationKey.PayPalAPISignature);
     GoogleCheckoutEnabled.Checked   = Convert.ToBoolean(StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleCheckoutEnabled));
     GoogleMerchantID.Text           = StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantID);
     GoogleMerchantkey.Text          = StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantkey);
     GoogleImageButtonURL.Text       = StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleImageButtonURL);
     GoogleCheckoutURL.Text          = StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleCheckoutURL);
     AuthorizeNetTestMode.Checked    = Convert.ToBoolean(StoreConfiguration.GetConfigurationValue(ConfigurationKey.AuthorizeNetTestMode));
     AuthorizeNetAPILoginID.Text     = StoreConfiguration.GetConfigurationValue(ConfigurationKey.AuthorizeNetAPILoginID);
     AuthorizeNetTransactionKey.Text = StoreConfiguration.GetConfigurationValue(ConfigurationKey.AuthorizeNetTransactionKey);
 }
 // Create or read BillingMode.json at Project Editor load
 static UnityPurchasingEditor()
 {
     EditorApplication.delayCall += () =>
     {
         if (File.Exists(ModePath))
         {
             var oldAppStore = GetAppStoreSafe();
             config = StoreConfiguration.Deserialize(File.ReadAllText(ModePath));
             if (oldAppStore != config.androidStore)
             {
                 OnAndroidTargetChange?.Invoke(config.androidStore);
             }
         }
         else
         {
             CreateDefaultBillingModeFile();
         }
     };
 }
Exemplo n.º 30
0
    private void SendNewCustomerOrderEmail(string orderNo)
    {
        Dictionary <string, string> replacmentValues = new Dictionary <string, string>();

        replacmentValues.Add("FirstName", FirstNameTextBox.Text);
        replacmentValues.Add("OrderNumber", orderNo);
        replacmentValues.Add("StoreName", StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName));
        replacmentValues.Add("StoreURL", StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreURL));

        string emailBody = EmailManager.GetEmailString(replacmentValues, EmailType.NewSaleCustomerEmail);

        Email.SendSimpleEmail(StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName) + " Sales",
                              StoreConfiguration.GetConfigurationValue(ConfigurationKey.SalesTeamEmail), new List <System.Net.Mail.MailAddress>()
        {
            new System.Net.Mail.MailAddress(EmailTextBox.Text)
        },
                              "New Order Confirmation",
                              emailBody,
                              true);
    }
        public static ISessionFactory CreateSessionFactory()
        {
            var connStr = "Data Source=.;Initial Catalog=testInventoryDB;Integrated Security=True";
            ////Write your Connection String here....

            var cfgi = new StoreConfiguration();

            var fluentConfiguration = Fluently.Configure()
                                      .Database(MsSqlConfiguration.MsSql2012
                                                .ConnectionString(connStr)
                                                .ShowSql()
                                                );
            var configuration =
                fluentConfiguration.Mappings(m =>
                                             m.AutoMappings
                                             .Add(AutoMap.AssemblyOf <BaseClass>(cfgi).UseOverridesFromAssemblyOf <BaseClass>().Conventions
                                                  .Add(typeof(CustomIdConvention))).Add(AutoMap.AssemblyOf <Document>(cfgi)));

            return(configuration.ExposeConfiguration(cfg => { new SchemaUpdate(cfg).Execute(true, true); })
                   .BuildSessionFactory());
        }
Exemplo n.º 32
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
            var scfg = new StoreConfiguration();
            var config = new Configuration();
            config.Configure();

            SessionFactory = config.BuildSessionFactory();
            SessionFactory = Fluently.Configure(config)
            .Database(FluentNHibernate.Cfg.Db.JetDriverConfiguration.Standard)
            .Mappings(m => m.FluentMappings
                 .AddFromAssemblyOf<DetalėMapping>()
                 .AddFromAssemblyOf<DetaliųGrupėMapping>()
            )
            .BuildSessionFactory();
            /* SessionFactory = Fluently.Configure()
             .Database(FluentNHibernate.Cfg.Db.JetDriverConfiguration.Standard
             .ConnectionString(x => x.DatabaseFile(@"\web\test.accdb")))
            */
        }
Exemplo n.º 33
0
        internal const int PageSize = 4096; // 4kB pages

        public BPlusTreeStoreManager(StoreConfiguration configuration, IPersistenceManager persistenceManager)
        {
            _storeConfiguration = configuration;
            _persistenceManager = persistenceManager;
        }
 public IsolatedStorageStoreManager(StoreConfiguration storeConfiguration) : base(storeConfiguration, new IsolatedStoragePersistanceManager())
 {
     
 }
Exemplo n.º 35
0
 public FileStoreManager(StoreConfiguration storeConfiguration) : base(storeConfiguration, new FilePersistenceManager())
 {
 }