Exemplo n.º 1
0
 public TeamcityBuildTracker(ICommandParser commandParser, IKeyValueStore persistence, ITeamcityBuildApi teamcityBuildApi)
 {
     m_CommandParser              = commandParser;
     m_Persistence                = new ListPersistenceApi <Tracked <TeamcityBuildStatus> >(persistence, "tracked-tc-builds");
     m_TeamcityBuildApi           = teamcityBuildApi;
     m_TeamcityBuildCompareEngine = new CompareEngine <TeamcityBuildStatus>(x => string.Format("<http://teamcity/viewLog.html?buildId={0}|Build {0}> ({1}) updated:", x.Id, x.Name),
                                                                            new[] { new PropertyComparer <TeamcityBuildStatus>(x => x.OldValue.State != x.NewValue.State, FormatStateChanged) });
 }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            CompareEngine compareEngine = new CompareEngine();
            frmMain       compareViewer = new frmMain();
            Presenter     presenter     = new Presenter(compareEngine, compareViewer, A.ProfileManager);

            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            Application.Run(compareViewer);
        }
Exemplo n.º 3
0
        internal readonly CompareEngine <ZendeskTicket> m_ZendeskTicketCompareEngine; // internal for tests -- should be injected?

        public ZendeskTicketTracker(ICommandParser commandParser, IKeyValueStore persistence, IZendeskTicketApi zendeskApi)
        {
            m_CommandParser = commandParser;
            m_Persistence   = new ListPersistenceApi <Tracked <ZendeskTicket> >(persistence, "tracked-zd-tickets");
            m_ZendeskApi    = zendeskApi;
            m_ZendeskTicketCompareEngine = new CompareEngine <ZendeskTicket>(
                x => string.Format("<https://redgatesupport.zendesk.com/agent/tickets/{0}|ZD#{0}> ({1}) updated:", x.Id, x.Description),
                new[]
            {
                new PropertyComparer <ZendeskTicket>(x => x.OldValue.Comments.Count < x.NewValue.Comments.Count, FormatCommentsAdded),
                new PropertyComparer <ZendeskTicket>(ClosedOrOpened, FormatStatusChanged),
                new PropertyComparer <ZendeskTicket>(x => x.OldValue.Description != x.NewValue.Description, FormatDescriptionChanged),
            });
        }
Exemplo n.º 4
0
 public Images Compare(string image1, string image2, int i)
 {
     using (var imagea = loadImage(image1))
         using (var imageb = loadImage(image2))
         {
             if (config.ConvertTiffToBmp)
             {
                 image1 = convertImage(imagea, i, "A") ?? image1;
                 image2 = convertImage(imagea, i, "B") ?? image2;
             }
             var test = CompareEngine.GetDiff2((Bitmap)imagea, (Bitmap)imageb);
             test.Save($"{config.OutputPath}\\{config.ImageFileName}{i}.bmp");
             return(new Images
             {
                 ImageA = image1,
                 ImageB = image2,
                 ImageDiff = $"{config.OutputPath}\\{config.ImageFileName}{i}.bmp"
             });
         }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Load all saved parameters.
        /// </summary>
        private void LoadParameters()
        {
            Administrator.ProfileManager.UserSettings.Load(Administrator.ProfileManager.SystemProfile.CurrentUserSettings, Administrator.ProfileManager.SystemProfile.MasterUserSettings);
            UserSetting userSetting = new UserSetting();

            if (Administrator.ProfileManager.UserSettings.SelectedItem != null)
            {
                userSetting = Administrator.ProfileManager.UserSettings.SelectedItem;
            }
            NewPath             = userSetting.NewPath;
            OldPath             = userSetting.OldPath;
            _newFilesEstimate   = userSetting.NewFilesEstimate;
            _oldFilesEstimate   = userSetting.OldFilesEstimate;
            _chgFilesEstimate   = userSetting.ChgFilesEstimate;
            IgnoreFileExtension = userSetting.IgnoreFileExtension;
            _monitoredTypesOnly = userSetting.MonitoredTypesOnly;
            SetCurrentKey();
            moCompare = new CompareEngine();
            moCompare.EventBeginProgress  += new CompareEngine.EventDelegate(moCompare_EventBeginProgress);
            moCompare.EventUpdateProgress += new CompareEngine.EventDelegate(moCompare_EventUpdateProgress);
            moCompare.EventEndOfProgress  += new CompareEngine.EventDelegate(moCompare_EventEndOfProgress);
        }
Exemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void sync_btn_Click(object sender, EventArgs e)
 {
     CompareEngine.Sync();
 }