public MainViewModel()
        {
            if (ViewModelHelper.IsInDesignMode)
            {
                var fakeList = new IndependentList<CodeRepositoryItem>();
                fakeList.Add(new CodeRepositoryItem("Test", "test", null, "OK"));
                fakeList.Add(new CodeRepositoryItem("Test2", "test", null, "Out of Date"));
                fakeList.Add(new CodeRepositoryItem("Test3", "test", null, "Merge Conflict"));
                this.ItemList = fakeList;
            }
            else
            {
                // todo inject these instead of newing them up
                this.appConfiguration = new AppConfiguration();
                this.codeRepositoryStore = new CodeRepositoryStore(this.appConfiguration);
                var updateServices = new List<ICodeRepositoryUpdateService>();
                var queryServices = new List<ICodeRepositoryQueryService>();
                var tfsCommandFactory = new TfsCommandFactory(new TfsCommandPathLocator());
                var tfsCommandOutputParser = new TfsCommandOutputParser();
                queryServices.Add(new CodeRepositoryQueryService(tfsCommandFactory, new TfsWorkspaceQueryService(tfsCommandFactory, tfsCommandOutputParser)));
                this.codeRepositoryMonitor = new CodeRepositoryMonitor(queryServices, updateServices);
                this.RetrieveItemsList();
            }

            this.InitCommands();
        }
 public void SetFamilies(IEnumerable <Family> families)
 {
     _families.Clear();
     foreach (var family in families)
     {
         _families.Add(family);
     }
     SelectedFamily = families.FirstOrDefault();
 }
Beispiel #3
0
        public ProjectAction NewAction()
        {
            ProjectAction action = new ProjectAction();

            _actions.Add(action);
            return(action);
        }
        public bool Add(ParseUser member)
        {
            var match = _members.FirstOrDefault(u => u.ObjectId == member.ObjectId);

            if (match != null)
            {
                SelectedMember = match;
                return(false);
            }
            else
            {
                _members.Add(member);
                SelectedMember = member;
                return(true);
            }
        }
Beispiel #5
0
        public Project NewProject()
        {
            Project project = new Project();

            _projects.Add(project);
            return(project);
        }
 public void OpenCloud(Cloud cloud)
 {
     if (!_openClouds.Contains(cloud))
     {
         _openClouds.Add(cloud);
     }
 }
Beispiel #7
0
        public void SetBills(IEnumerable <Bill> bills)
        {
            var bin = new RecycleBin <Bill>(_bills);

            _bills.Clear();
            foreach (var bill in bills)
            {
                var recycled = bin.Extract(bill);
                recycled.Payee     = bill.Payee;
                recycled.Amount    = bill.Amount;
                recycled.Frequency = bill.Frequency;
                recycled.NextDue   = bill.NextDue;

                _bills.Add(recycled);
            }
        }
Beispiel #8
0
 public void SetCompanySelected(Company company, bool value)
 {
     if (value == true && !_selectedCompanies.Contains(company))
     {
         _selectedCompanies.Add(company);
     }
     else if (value == false && _selectedCompanies.Contains(company))
     {
         _selectedCompanies.Remove(company);
     }
 }
Beispiel #9
0
        public void BeginOpenAssemblies(string[] filenames, bool partialTrust)
        {
            var newRoots = new List <RowModel>();

            for (int i = 0; i < filenames.Length; i++)
            {
                string fn         = filenames[i];
                string baseFolder = Path.GetFullPath(Path.Combine(fn, ".."));
                var    task       = AppDomainStarter.Start <AssemblyScanTask>(baseFolder, Path.GetFileName(fn), new object[] { fn, baseFolder }, partialTrust);
                var    root       = new TaskRowModel(Path.GetFileName(fn), TestNodeType.Assembly, task, false);

                newRoots.Add(root);
                _roots.Add(root);
            }
            _runner.AddTasks(newRoots.Select(row => row.Task));
            _runner.AutoStartTasks();
        }
        public void Load()
        {
            _bills.Clear();
            Perform(async delegate
            {
                // Using a ParseRelation:

                var bills =
                    from family in new ParseQuery <Family>()
                    where family["Members"] == _user
                    join bill in new ParseQuery <Bill>()
                    on family equals bill.Family
                    select bill;

                // Or, using a join table:
                //
                //var members =
                //    from member in new ParseQuery<Member>()
                //    where member.User == _user
                //    select member;
                //var bills =
                //    from member in members
                //    join bill in new ParseQuery<Bill>()
                //        on member.Family equals bill.Family
                //    select bill;

                var query =
                    from bill in bills
                    where bill.NextDue < new DateTime(2013, 9, 26)
                    orderby bill.NextDue, bill.Payee
                select bill;

                var results = await query
                              .Include("Family")
                              .FindAsync();
                foreach (var bill in results)
                {
                    _bills.Add(bill);
                }
            });
        }
Beispiel #11
0
        public void BeginOpenAssemblies(string[] filenames, bool partialTrust)
        {
            if (filenames.Length == 0)
            {
                return;
            }

            // Create Assembly objects with AppDomains
            foreach (string fn in filenames)
            {
                string baseFolder = Path.GetFullPath(Path.Combine(fn, ".."));
                if (!_assemblies.Any(a => a.Path == fn))
                {
                    var ass = _assemblies.FirstOrDefault(a => a.Domain.BaseFolder == baseFolder && a.Domain.PartialTrust == partialTrust);
                    var adh = ass != null ? ass.Domain : new AppDomainHolder(baseFolder, Path.GetFileNameWithoutExtension(fn), partialTrust);
                    _assemblies.Add(new Assembly {
                        Path = fn, Domain = adh
                    });
                }
            }

            // Start scan tasks
            var newTasks = new List <AssemblyScanTask>();

            foreach (var ass in _assemblies.Where(a => a.Row == null))
            {
                                #pragma warning disable 618 // method is "obsolete" in .NET4 but its replacement does not exist in .NET 3.5
                var task = (AssemblyScanTask)Activator.CreateInstanceFrom(ass.Domain.Domain,
                                                                          typeof(AssemblyScanTask).Assembly.ManifestModule.FullyQualifiedName,
                                                                          typeof(AssemblyScanTask).FullName, false,
                                                                          0, null, new object[] { ass.Path, ass.Domain.BaseFolder }, null, null, null).Unwrap();
                ass.Row = new TaskRowModel(Path.GetFileName(ass.Path), TestNodeType.Assembly, task, false);
                newTasks.Add(task);
            }
            _runner.AddTasks(newTasks.Upcast <ITask, AssemblyScanTask>());
            _runner.AutoStartTasks();
        }
Beispiel #12
0
 public void AddSession(Session session)
 {
     _sessions.Add(session);
 }
Beispiel #13
0
 public void AddRatingQuestion(string question)
 {
     _ratingQuestions.Add(question);
 }
Beispiel #14
0
 public void AddContact(Contact contact)
 {
     _contacts.Add(contact);
 }
Beispiel #15
0
 public void AddOrderLine(int quantity, Product product)
 {
     _orderLines.Add(new OrderLine(quantity, product));
 }
Beispiel #16
0
 public void AddDevice(ConnectableDevice device)
 {
     discoverredDevices.Add(device);
 }
Beispiel #17
0
 public void NewNumber()
 {
     _numbers.Add(_random.Next(1000));
 }
Beispiel #18
0
 public void AddEssayQuestion(string question)
 {
     _essayQuestions.Add(question);
 }