Esempio n. 1
0
        /// <summary>
        /// Method to fill this form and fade in.
        /// </summary>
        /// <param name="info">
        /// The info to show.
        /// </param>
        public void ShowChange(ChangeInfo info)
        {
            this.information = info;
            ExistingForms.Add(this);

            this.Show();

            this.Left = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
            this.Top  = Screen.PrimaryScreen.WorkingArea.Height - this.Height;

            this.Text        = this.information.TargetSystemName;
            this.label1.Text = this.information.DisplayName;

            this.FadeOutTimer.Enabled = true;
        }
Esempio n. 2
0
        /// <summary>
        /// Compares two contact instances and reports the difference.
        /// </summary>
        /// <param name="baselineContact">
        /// The contact from the base line (how it has been read last time).
        /// </param>
        /// <param name="currentContact">
        /// The contact currently read from the source.
        /// </param>
        private void CompareEntities(StdContact baselineContact, StdContact currentContact)
        {
            var changes =
                SyncTools.DetectConflicts(
                    SyncTools.BuildConflictTestContainerList(
                        new List <StdElement>(new[] { currentContact }),
                        new List <StdElement>(new[] { baselineContact }),
                        null,
                        typeof(StdContact)),
                    true);

            var changeSet = new ChangeInfo();

            foreach (var change in changes)
            {
                changeSet.ChangedProperties.Add(
                    change.PathToProperty + " " + change.PropertyConflict + ": " + change.SourceElement);
            }

            if (changeSet.ChangedProperties.Count <= 0)
            {
                return;
            }

            changeSet.DisplayName = string.Format(
                CultureInfo.InvariantCulture,
                "{0} has {1} properties changed.",
                baselineContact.Name,
                changeSet.ChangedProperties.Count);
            this.DetectedChanges.Add(changeSet);

            while (this.DetectedChanges.Count > this.MaxEntries)
            {
                this.DetectedChanges.RemoveAt(0);
            }
        }