コード例 #1
0
        public async Task Initialize()
        {
            _community = new Community(new MemoryStorageStrategy())
                .Register<CorrespondenceModel>();

            _profile = await _community.AddFactAsync(new Profile());
            _profile.Name = "Michael Perry";

            var company = await _community.AddFactAsync(new Company("improvingEnterprises"));
            var quarter = await _community.AddFactAsync(new Quarter(company, new DateTime(2012, 7, 1)));

            var industryContributionLeadership = await _community.AddFactAsync(new Category(company, "industryContributionLeadership"));
            industryContributionLeadership.Description = "Industry Contribution/Leadership";
            var leadUserGroup = await _community.AddFactAsync(new ActivityDefinition(industryContributionLeadership, "leadUserGroup"));
            leadUserGroup.Description = "Lead a user group";
            leadUserGroup.Qualifier = "mtg";
            var leadUserGroupReward = await _community.AddFactAsync(new ActivityReward(leadUserGroup, quarter));
            leadUserGroupReward.Points = 3;
            var presentationUserGroup = await _community.AddFactAsync(new ActivityDefinition(industryContributionLeadership, "presentationUserGroup"));
            presentationUserGroup.Description = "Presentation - user group";
            presentationUserGroup.Qualifier = "presentation";
            var presentationUserGroupReward = await _community.AddFactAsync(new ActivityReward(presentationUserGroup, quarter));
            presentationUserGroupReward.Points = 10;

            var certificationRecognition = await _community.AddFactAsync(new Category(company, "certificationRecognition"));
            certificationRecognition.Description = "Certification/Recognition";
            var mvp = await _community.AddFactAsync(new ActivityDefinition(certificationRecognition, "microsoftMvp"));
            mvp.Description = "Microsoft MVP";
            var mvpReward = await _community.AddFactAsync(new ActivityReward(mvp, quarter));
            mvpReward.Points = 50;

            var profileQuarter = await _community.AddFactAsync(new ProfileQuarter(_profile, quarter));

            var a1 = await _community.AddFactAsync(new Activity(profileQuarter, leadUserGroupReward, new DateTime(2012, 9, 4)));
            a1.Description = "Dallas XAML User Group";
            var a2 = await _community.AddFactAsync(new Activity(profileQuarter, mvpReward, new DateTime(2012, 7, 1)));
            var a3 = await _community.AddFactAsync(new Activity(profileQuarter, presentationUserGroupReward, new DateTime(2012, 9, 4)));
            a3.Description = "Dallas XAML User Group";

            _viewModel = new ActivityReportViewModel(_profile);
        }
コード例 #2
0
 public ActivityReportViewModel(Profile profile)
 {
     _profile = profile;
 }
コード例 #3
0
 // Results
 // Business constructor
 public Profile__name(
     Profile profile
     ,IEnumerable<Profile__name> prior
     ,string value
     )
 {
     InitializeResults();
     _profile = new PredecessorObj<Profile>(this, GetRoleProfile(), profile);
     _prior = new PredecessorList<Profile__name>(this, GetRolePrior(), prior);
     _value = value;
 }
コード例 #4
0
 // Fields
 // Results
 // Business constructor
 public ProfileQuarter(
     Profile profile
     ,Quarter quarter
     )
 {
     InitializeResults();
     _profile = new PredecessorObj<Profile>(this, GetRoleProfile(), profile);
     _quarter = new PredecessorObj<Quarter>(this, GetRoleQuarter(), quarter);
 }
コード例 #5
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                Profile newFact = new Profile(memento);

                // Create a memory stream from the memento data.
                using (MemoryStream data = new MemoryStream(memento.Data))
                {
                    using (BinaryReader output = new BinaryReader(data))
                    {
                        newFact._unique = (Guid)_fieldSerializerByType[typeof(Guid)].ReadData(output);
                    }
                }

                return newFact;
            }
コード例 #6
0
 // Fields
 // Results
 // Business constructor
 public IndividualProfile(
     Individual individual
     ,Profile profile
     )
 {
     InitializeResults();
     _individual = new PredecessorObj<Individual>(this, GetRoleIndividual(), individual);
     _profile = new PredecessorObj<Profile>(this, GetRoleProfile(), profile);
 }