Example #1
0
        public override void RunTest(Synchronization.ISyncLock lockObject, TestParameters testParameters)
        {
            if (lockObject is NoOpLock)
            {
                throw new InapplicableTestException("Timeout tests are not needed for no op locks");
            }

            Console.WriteLine("Trying simple timed wait with long timeout");

            bool acquired = lockObject.WaitForLock(new TimeSpan(1, 0, 0));

            if (!acquired)
            {
                throw new InvalidOperationException("Unable to acquire lock in single thread scenario");
            }

            Console.WriteLine("Successfully acquired lock after bounded wait");

            lockObject.Unlock();

            //
            // Wait for 0 seconds for lock after it is known to have been released
            //
            Console.WriteLine("Now wait for 0 and verify correct signaled state");

            TestLockWait(lockObject, new TimeSpan(0, 0, 0), new TimeSpan(0,0,0), true);

            //
            // Signal, Wait for 0 secondsm
            //
            Console.WriteLine("Now acquire the lock and verify that it is acquired after the other thread holds it for 0 s");
            TestLockWait(lockObject, new TimeSpan(0, 0, 5), new TimeSpan(0,0,0), false);

            //
            // Wait for 5s for a lock that is held for 3s
            //
            Console.WriteLine("Wait 5s for a lock held 3s");
            TestLockWait(lockObject, new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 3), false);

            //
            // Wait for 0s for a lock that is held for 3s -- lock should fail to be released
            //
            Console.WriteLine("Wait 0s for a lock held 3s");
            TestLockWait(lockObject, new TimeSpan(0, 0, 0), new TimeSpan(0, 0, 3), false);

            //
            // Wait for 1s for a lock that is held for 4s -- lock should fail to be released
            //
            Console.WriteLine("Wait 1s for a lock held 4s");
            TestLockWait(lockObject, new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 4), false);

            //
            // Wait for 4s for a lock held 1s
            //
            Console.WriteLine("Wait 7s for a lock held 4s");
            TestLockWait(lockObject, new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 4), false);
        }
Example #2
0
 public ProxyHomePage EnterUserNameProxySprint2(string user)
 {
     _txtUserNameSprint.SendKeys(user);
     if (Synchronization.WaitForElementToBePresent(By.XPath(string.Format("//li[@class='proxy_user-result']", user))) != null)
     {
         Synchronization.WaitForElementToBePresent(By.XPath("//li[@class='proxy_user-result']")).Click();
     }
     else
     {
         Assert.Fail("User was not found");
     }
     return(this);
 }
Example #3
0
 public ProxyHomePage EnterUserNameHealthAlliance(string name)
 {
     _txtUserName.SendKeys(name);
     if (Synchronization.WaitForElementToBePresent(By.Id("ui-id-1")) != null)
     {
         Synchronization.WaitForElementToBePresent(By.XPath("//div[contains(@class,'autocomplete-name')]")).Click();
     }
     else
     {
         Assert.Fail("User was not found");
     }
     return(this);
 }
Example #4
0
 public ProxyHomePage EnterUserName(string name)
 {
     _txtUserName.SendKeys(name);
     if (Synchronization.WaitForElementToBePresent(By.Id("ui-id-1")) != null)
     {
         Synchronization.WaitForElementToBePresent(By.XPath(string.Format("//div[contains(.,'{0}')]", name))).Click();
     }
     else
     {
         Assert.Fail("User was not found");
     }
     return(this);
 }
Example #5
0
 public WorkStridePage ClickPromoBoxBtn(string p)
 {
     IWebElement[] promoboxes = Synchronization.WaitForElementsToBePresent(By.XPath("//a[contains(@class,'btn btn-default promo-box-btn btn-desktop')]")).ToArray();
     if (p == "Left")
     {
         promoboxes[0].Click();
     }
     else
     {
         promoboxes[1].Click();
     }
     return(NewPage <WorkStridePage>());
 }
Example #6
0
 public bool IsFollowBannerPresent()
 {
     Thread.Sleep(1500);
     Actions.MoveToElement(Synchronization.WaitForElementsToBePresent(By.XPath("//h4[contains(@class,'center-align')]")).ElementAt(3));
     Actions.MoveToElement(Synchronization.WaitForElementsToBePresent(By.XPath("//h4[contains(@class,'center-align')]")).FirstOrDefault());
     if (Synchronization.WaitForElementToBePresent(By.XPath("//div[contains(@class,'follow-ribbon')]")) != null)
     {
         return
             (Synchronization.WaitForElementToBePresent(By.XPath("//div[contains(@class,'follow-ribbon')]"))
              .Displayed);
     }
     return(false);
 }
Example #7
0
        public void Clear(BaseProtocol pFrom = null)
        {
            Payload.SetValue();
            var clearDirtyInfo = new DirtyInfo {
                PropertyName = null, Type = Defines.SOT_SC_CLEAR_DATA
            };

            Synchronization?.Invoke(clearDirtyInfo);
            foreach (var registeredProtocol in _dirtyPropsByProtocol.Where(x => x.Key != pFrom))
            {
                registeredProtocol.Value.Add(clearDirtyInfo);
            }
        }
        /// <summary>
        /// Wraps the source sequence in order to run its subscription and unsubscription logic on the specified dispatcher.
        /// </summary>
        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
        /// <param name="source">Source sequence.</param>
        /// <param name="dispatcher">Dispatcher whose associated message loop is used to perform subscription and unsubscription actions on.</param>
        /// <param name="priority">Priority to schedule work items at.</param>
        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the specified dispatcher.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
        /// <remarks>
        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified dispatcher.
        /// In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use <see cref="DispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, CoreDispatcher, CoreDispatcherPriority)"/>.
        /// </remarks>
        public static IObservable <TSource> SubscribeOn <TSource>(this IObservable <TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (dispatcher == null)
            {
                throw new ArgumentNullException("dispatcher");
            }

            return(Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dispatcher, priority)));
        }
Example #9
0
        /// <summary>
        /// Wraps the source sequence in order to run its observer callbacks on the Windows Forms message loop associated with the specified control.
        /// </summary>
        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
        /// <param name="source">Source sequence.</param>
        /// <param name="control">Windows Forms control whose associated message loop is used to to notify observers on.</param>
        /// <returns>The source sequence whose observations happen on the Windows Forms message loop associated with the specified control.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="control"/> is null.</exception>
        public static IObservable <TSource> ObserveOn <TSource>(this IObservable <TSource> source, Control control)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            return(Synchronization.ObserveOn(source, new ControlScheduler(control)));
        }
Example #10
0
        /// <summary>
        /// Wraps the source sequence in order to run its subscription and unsubscription logic on the Windows Forms message loop associated with the specified control.
        /// </summary>
        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
        /// <param name="source">Source sequence.</param>
        /// <param name="control">Windows Forms control whose associated message loop is used to to perform subscription and unsubscription actions on.</param>
        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the Windows Forms message loop associated with the specified control.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="control"/> is null.</exception>
        /// <remarks>
        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified control.
        /// In order to invoke observer callbacks on the specified control, e.g. to render results in a control, use <see cref="ControlObservable.ObserveOn"/>.
        /// </remarks>
        public static IObservable <TSource> SubscribeOn <TSource>(this IObservable <TSource> source, Control control)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (control == null)
            {
                throw new ArgumentNullException(nameof(control));
            }

            return(Synchronization.SubscribeOn(source, new ControlScheduler(control)));
        }
 public void ThenUserShouldBeLandedSuccessfullyForReportsPage()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//h3[contains(text(),'Reports')]"));
         Assert.IsTrue(ReportsPage.ReportsText(SelectBrowser.driver).Text.Contains("Reports"));
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenUserClicksOnTheReportsLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'Reports')]"));
         ReportsPage.ReportsText(SelectBrowser.driver).Click();
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Example #13
0
 public MainHomePage ClickLogin()
 {
     _btnLogin.Click();
     if (FindElement(
             By.XPath(
                 "//img[contains(@src,'http://demoassets.workstride.com/resources/images/milestone_logo_newHire_120x120.png')]")) !=
         null)
     {
         Synchronization.WaitForElementToBePresent(By.Id("modal"));
         FindElement(By.XPath("//*[@id='modal']/div/div/a")).Click();
     }
     return(NewPage <MainHomePage>());
 }
Example #14
0
        public override void Init(object initData)
        {
            base.Init(initData);

            _szenarioType  = (SzenarioCommandType)initData;
            RobotGroupList = new List <RobotGroupModel>();

            //Send synchronization command to get all robots
            RobotController.Updated = false;
            var command = new Synchronization(CommandType.Synchronization.ToString(), SynchronizationCommandType.AllRobots.ToString(), Client.Identification, SzenarioController.Szenarios, RobotController.Robots);

            Client.SendCmd(command.ToJsonString());
        }
 public void ThenUserShouldBeLandedSuccessfullyForSalesActivityPage()
 {
     try
     {
         SelectBrowser.driver.SwitchTo().Window(SelectBrowser.driver.WindowHandles.Last());
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//button[@type='button']"));
         Assert.IsTrue(ReportsPage.ViewReports(SelectBrowser.driver).Text.Contains("View Report"));
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Example #16
0
        public WordDetails()
        {
            InitializeComponent();
            this.LayoutRoot.Background = new SolidColorBrush(AppSettings.BackgroundColor);
            this.pageTitle.Text        = AppResources.appName;
            this.Loaded += new RoutedEventHandler(WordDetails_Loaded);

            if (this.syncManager == null)
            {
                this.syncManager = new Synchronization();
            }
            this.syncManager.SyncComplete += new Synchronization.EventHandler(syncManager_SyncComplete);
            this.syncManager.SyncError    += new Synchronization.EventHandler(syncManager_SyncError);
        }
Example #17
0
        private async Task<Synchronization> CreateSynchronization() {
            api = new Api(await GenerateAuthToken, new Files(), new Folders());

            var sync = new Synchronization(api, new FilesComparison(), new FoldersComparison());
            sync.Preparing += () => LogEvent("Preparing");
            sync.Synchronizing += () => LogEvent("Synchronizing");
            sync.Downloading += () => LogEvent("Downloading");
            sync.Uploading += () => LogEvent("Uploading");
            sync.Deleting += () => LogEvent("Deleting");
            sync.Done += () => LogEvent("Done");
            sync.UnknownError += () => LogEvent("Unknown Error");

            return sync;
        }
Example #18
0
 public NominationHomePage SearchEmployeeFoundMultiple(string user)
 {
     Synchronization.WaitForElementToBePresent(By.XPath("//label[contains(.,'Search for an employee:')]"));
     Synchronization.WaitForElementToBePresent(By.Name("employee-lookup"));
     _txtName.Clear();
     _txtName.SendKeys(user);
     if (Synchronization.WaitForElementToBePresent(By.XPath(string.Format("//span[contains(.,'{0}')]", user))) !=
         null)
     {
         Synchronization.WaitForElementToBePresent(By.XPath(string.Format("//span[contains(.,'{0}')]", user)))
         .Click();
     }
     return(NewPage <NominationHomePage>());
 }
 public void WhenNowUserClicksOnTheReconLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//col-md-[contains(text(),'Recon')]"));
         SpecificAccountInfo.ReconLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the Recon Link");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void ThenUserShouldBeLandedSuccessfullyForJeopardyAccountsPage()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//h3[contains(text(),'Jeopardy Accounts')]"));
         Assert.IsTrue(AccountsPage.AccountsText(SelectBrowser.driver).Text.Contains("Jeopardy Accounts"));
         test.Log(Status.Info, "User Landed Successfully to the Jeopardy Account");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenUserClicksOnTheInvoicesPaymentsLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//a[@ui-sref='Invoice/Payments']/col-md-"));
         SpecificAccountInfo.Invoiceslink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the Invoices and Payments Link");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenClickOnTheLoginButton()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//input[@id='Login']"));
         LoginPage.LoginButton(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "Click on the Login to the SandBox");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void ThenUserShouldNavigateToTheCredentialsPage()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//input[@id='Login']"));
         Assert.IsTrue(LoginPage.LoginButton(SelectBrowser.driver).GetAttribute("name").Contains("Login"));
         test.Log(Status.Pass, "User Navigayed to the Credentials Page");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
        /// <summary>
        /// Wraps the source sequence in order to run its observer callbacks on the dispatcher associated with the specified object.
        /// </summary>
        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
        /// <param name="source">Source sequence.</param>
        /// <param name="dependencyObject">Object to get the dispatcher from.</param>
        /// <returns>The source sequence whose observations happen on the specified object's dispatcher.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
        public static IObservable <TSource> ObserveOn <TSource>(this IObservable <TSource> source, DependencyObject dependencyObject)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            if (dependencyObject == null)
            {
                throw new ArgumentNullException(nameof(dependencyObject));
            }

            return(Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher)));
        }
        /// <summary>
        /// Wraps the source sequence in order to run its subscription and unsubscription logic on the specified dispatcher.
        /// </summary>
        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
        /// <param name="source">Source sequence.</param>
        /// <param name="dispatcher">Dispatcher whose associated message loop is used to perform subscription and unsubscription actions on.</param>
        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the specified dispatcher.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
        /// <remarks>
        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified dispatcher.
        /// In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, CoreDispatcher)"/>.
        /// </remarks>
        public static IObservable <TSource> SubscribeOn <TSource>(this IObservable <TSource> source, CoreDispatcher dispatcher)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            if (dispatcher == null)
            {
                throw new ArgumentNullException(nameof(dispatcher));
            }

            return(Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dispatcher)));
        }
Example #26
0
    public static IEnumerator submitScore(float score)
    {
        yield return(null);

        if (Social.localUser.authenticated)
        {
            Social.ReportScore((int)score, leaderBoardID, instance.onSubmitScoreEvent);
        }

        else
        {
            Synchronization.setSynchronization();
        }
    }
Example #27
0
 public void ThenUserShouldClickOnLinkWFormUnderRatesPolicies()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//a[contains(text(),'W9 Form')]"));
         RatesPoliciesPage.WForm(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the W9Form under Rates & Policies");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenUserClickOnAnyAvailableLinkUnderMediaSalesAsPerSelectedDrillDown()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'Month Start')]"));
         ActivityHomePage.MediaDisplayLink(SelectBrowser.driver).Click();
         Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 private static void LoadTask(Config config)
 { // these tasks will always be running in the same thread as each other
     try
     {
         var store = config.Store;
         using var writeLock = Synchronization.LockWrite(store.WriteSyncObject);
         store.ReadFrom(config.configProvider);
     }
     catch (Exception e)
     {
         Logger.Config.Error($"{nameof(IConfigStore)} for {config.File} errored while reading from the {nameof(IConfigProvider)}");
         Logger.Config.Error(e);
     }
 }
 public void WhenUserClicksOnTheLoginWithSalesForceLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.LinkText("Login with Salesforce"));
         InitialPage.LoginButton(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "Click on the Login Button");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void ThenUserShouldSuccessfullyLandedToTheMainPage()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//div[@class='pull-right refresh_info']"));
         Assert.IsTrue(LoginPage.VerificationText(SelectBrowser.driver).Text.Contains("Information was refreshed"));
         test.Info("User Successfully Landed to the Main Page");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenUserClickOnTheDownloadLinkForMediaSales()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'Month Start')]"));
         ActivityHomePage.MediaDisplayDownloadLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the download link for Media Sales");
         //Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
        //        public void UpdatePerformances(CompetitionInfo model)
        //        {
        //            var performances =
        //                RavenSession
        //                    .Query<Performance>()
        //                    .Where(x => x.CompetitionId == model.CompetitionId)
        //                    .Take(int.MaxValue) //not expecting more than 100s, but likely slighly more than 128
        //                    .ToList();
        //
        //            var scores =
        //                RavenSession
        //                    .Query<JudgeScore>()
        //                    .Where(x => x.CompetitionId == model.CompetitionId)
        //                    .Take(int.MaxValue) //TODO: page through these, could be more than 1024
        //                    .ToList();
        //
        //            foreach (var performance in performances)
        //            {
        //                RavenSession.Delete(performance);
        //            }
        //
        //            foreach (var score in scores)
        //            {
        //                RavenSession.Delete(score);
        //            }
        //
        //            foreach (var performance in model.Performances)
        //            {
        //                RavenSession.Store(performance);
        //            }
        //        }
        public ActionResult Init(string id)
        {
            var doc =
                RavenSession
                    .Load<Synchronization>(Synchronization.FormatId(TenantName));

            if (doc == null && id != null)
            {
                doc = new Synchronization
                      {
                      	CompanyId = TenantName,
                      	Token = id
                      };
                RavenSession.Store(doc);
            }

            return new JsonDotNetResult("ok");
        }
Example #34
0
        private async void SynchronizeNowClick(object sender, RoutedEventArgs e) {

            try {
                var paths = new List<Pair<string>> {
                    new Pair<string>("test/test1", @"E:\boxSyncTest1"),
                };

                if (synchronization == null) {
                    synchronization = await CreateSynchronization();
                }

                if (await UserIsLogOff(api)) {
                    api.RefreshAuthToken(await GenerateAuthToken);
                }

                await synchronization.Start(paths);
            }
            catch (AuthenticationException) {
                LogEvent("Authentication FAILED");
            }
        }
Example #35
0
 public SynchronizationContext(Synchronization synchronization, SynchronizationDirection direction, ChangePropagationMode changePropagation)
     : base(synchronization)
 {
     this.direction = direction;
     this.changePropagation = changePropagation;
 }
Example #36
0
 /// <summary>
 /// Update the progress bar.
 /// </summary>
 void currAgent_ProgressChanged(object sender, Synchronization.SyncProgressChangedEventArgs e)
 {
     currentJobEntry.ProgressBarValue = e.Progress;
     if (tbManager != null) tbManager.SetProgressValue(e.Progress, 100);
 }
Example #37
0
 /// <summary>
 /// Tell the user which file is being processed now.
 /// </summary>
 void currAgent_FileChanged(object sender, Synchronization.SyncFileChangedEventArgs e)
 {
     if (this.Dispatcher.CheckAccess())
         lblSubStatus.Content = String.Format(m_ResourceManager.GetString("msg_syncingDirectory"), e.RelativePath);
     else
         lblSubStatus.Dispatcher.Invoke((Action)delegate { lblSubStatus.Content = String.Format(m_ResourceManager.GetString("msg_syncingDirectory"), e.RelativePath); });
 }
        void CheckSynchronization(string companyid)
        {
            var doc = new Synchronization
                      {
                      	CompanyId = companyid,
                      	Token = ShortGuid.NewGuid(),
                      	Url = string.Empty
                      };

            doc.Token = doc.Token.Replace("-", "q"); //don't want hypens

            RavenSession.Store(doc);
            RavenSession.SaveChanges();
        }