Пример #1
0
        public static void Init()
        {
            ProjectControlSourceItem itemOne = new ProjectControlSourceItem()
            {
                Project = "Algo Service", StageDir = "Algo Windows Service", Timestamp = DateTime.UtcNow, BaseDir = "Algo", FTPPath = "Algo Service"
            };
            ProjectControlSourceItem itemTwo = new ProjectControlSourceItem()
            {
                Project = "Matlab Server", StageDir = "Matlab Server Windows Service", Timestamp = DateTime.UtcNow, BaseDir = "Matlab Server", FTPPath = "Matlab Server Service"
            };
            ProjectControlSourceItem itemThree = new ProjectControlSourceItem()
            {
                Project = "Optimizer", StageDir = "Optimizer Windows Service", Timestamp = DateTime.UtcNow, BaseDir = "Optimizer", FTPPath = "Optimizer"
            };
            ProjectControlSourceItem itemFour = new ProjectControlSourceItem()
            {
                Project = "Task Scheduler", StageDir = "Task Scheduler Windows Service", Timestamp = DateTime.UtcNow, BaseDir = "Task Scheduler", FTPPath = "Task Scheduler"
            };
            ProjectControlSourceItem itemFive = new ProjectControlSourceItem()
            {
                Project = "Trading Monitor", StageDir = "Task Scheduler Windows Service", Timestamp = DateTime.UtcNow, BaseDir = "Trading Monitor", FTPPath = "Trading Montior"
            };
            ProjectControlSourceItem itemSix = new ProjectControlSourceItem()
            {
                Project = "TT Gateway", StageDir = "TT Gateway Windows Service", Timestamp = DateTime.UtcNow, BaseDir = "TT Gateway", FTPPath = "TT Gateway"
            };

            ProjectControlSource source = new ProjectControlSource();

            source.Items = new List <ProjectControlSourceItem>();
            source.Items.Add(itemOne);
            source.Items.Add(itemTwo);
            source.Items.Add(itemThree);
            source.Items.Add(itemFour);
            source.Items.Add(itemFive);
            source.Items.Add(itemSix);
            source.BaseDir  = @"c:\dev\projects\";
            source.FTPHosts = new List <FTPHost>();
            //  source.FTPHosts.Add(new FTPHost {IPAddress= });
            // source.FTPHosts.Add("10.10.100.35");
            source.Save();
        }
Пример #2
0
        private void BumpButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.StatusUpdated != null)
            {
                this.StatusUpdated(this, new NewReportEventArgs(""));
            }
            bool   success    = true;
            string bumpChoice = "unknown";

            if (majorBump_RB.IsChecked == true)
            {
                bumpChoice = "Major";
            }
            else if (minorBump_RB.IsChecked == true)
            {
                bumpChoice = "Minor";
            }
            else if (trivialBump_RB.IsChecked == true)
            {
                bumpChoice = "Trivial";
            }
            try
            {
                Task <Deployment.JSONVersion> bump = Task.Factory.StartNew(() =>
                {
                    return(bumper.Bump(bumpChoice));
                });
                Task bump_ui = bump.ContinueWith((antecedent) =>
                {
                    Version        = antecedent.Result.Version;
                    Timestamp      = DateTime.UtcNow;
                    item.Timestamp = Timestamp;
                    source.Save();
                    EnableUI();
                    setStatus(true);
                }, TaskScheduler.FromCurrentSynchronizationContext());
                if (success)
                {
                    Task <int> waiting = bump_ui.ContinueWith((antecedent) =>
                    {
                        Thread.Sleep(3000);
                        return(1);
                    }, TaskScheduler.Default);
                    Task waitingcontinue = waiting.ContinueWith((antecedent) =>
                    {
                        if (canceltoken.IsCancellationRequested)
                        {
                            return;
                        }
                        WarningStatus.Status = new BitmapImage(new Uri("Images\\gray-circle.png", UriKind.Relative));
                        WarningStatus.Status.Freeze();
                        taskcount--;
                    }, canceltoken, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
                }
            }
            catch (AggregateException ex)
            {
                success = false;
                if (this.StatusUpdated != null)
                {
                    this.StatusUpdated(this, new NewReportEventArgs(ex.Flatten().ToString()));
                }
            }
        }
Пример #3
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     source.Save();
 }