コード例 #1
0
        static void Main(string[] args)
        {
            // create two lists to hold two teams of 3
            List <ITeammate> serverSide = new List <ITeammate>();
            List <ITeammate> clientSide = new List <ITeammate>();

            // create new instances of each teammate class
            Greg    Greg    = new Greg();
            Krys    Krys    = new Krys();
            Kimmie  Kimmie  = new Kimmie();
            Garrett Garrett = new Garrett();
            Paul    Paul    = new Paul();
            Sean    Sean    = new Sean();

            // add teammates to each of the two lists
            serverSide.Add(Paul);
            serverSide.Add(Garrett);
            serverSide.Add(Sean);

            clientSide.Add(Greg);
            clientSide.Add(Krys);
            clientSide.Add(Kimmie);


            // iterate over the lists and run each teammates work() method
            foreach (ITeammate teammate in serverSide)
            {
                teammate.Work();
            }

            foreach (ITeammate teammate in clientSide)
            {
                teammate.Work();
            }
        }
コード例 #2
0
 public PackageDownloadHandle(DynamoViewModel dynamoViewModel, Greg.Responses.PackageHeader header, PackageVersion version)
 {
     this.dynamoViewModel = dynamoViewModel;
     this.Header = header;
     this.DownloadPath = "";
     this.VersionName = version.version;
 }
コード例 #3
0
 /// <summary>
 /// The class constructor. </summary>
 /// <param name="header">The PackageHeader object describing the element</param>
 public PackageManagerSearchElement(Greg.Responses.PackageHeader header)
 {
     this.Header = header;
     this.Weight = 1;
     if (header.keywords != null && header.keywords.Count > 0)
     {
         this.Keywords = String.Join(" ", header.keywords);
     }
     else
     {
         this.Keywords = "";
     }
 }
コード例 #4
0
 /// <summary>
 /// The class constructor. </summary>
 /// <param name="header">The PackageHeader object describing the element</param>
 public PackageManagerSearchElement(Greg.Responses.PackageHeader header)
 {
     this.Header = header;
     this.Weight = 1;
     if (header.keywords != null && header.keywords.Count > 0)
     {
         this.Keywords = String.Join(" ", header.keywords);
     }
     else
     {
         this.Keywords = "";
     }
     this.IsExpanded = false;
     this.DownloadLatest = new DelegateCommand((Action) Execute);
 }
コード例 #5
0
        /// <summary>
        /// The class constructor. </summary>
        /// <param name="header">The PackageHeader object describing the element</param>
        public PackageManagerSearchElement(DynamoViewModel dynamoViewModel, Greg.Responses.PackageHeader header)
        {
            this.dynamoViewModel = dynamoViewModel;

            this.Header = header;
            this.Weight = header.deprecated ? 0.1 : 1;

            if (header.keywords != null && header.keywords.Count > 0)
            {
                this.Keywords = String.Join(" ", header.keywords);
            } 
            else
            {
                this.Keywords = "";
            }
            this.Votes = header.votes;
            this.IsExpanded = false;
            this.DownloadLatest = new DelegateCommand((Action) Execute);
            this.UpvoteCommand = new DelegateCommand((Action) Upvote, CanUpvote);
            this.DownvoteCommand = new DelegateCommand((Action) Downvote, CanDownvote);
        }
コード例 #6
0
 public PackageDownloadHandle(Greg.Responses.PackageHeader header, PackageVersion version)
 {
     this.Header = header;
     this.DownloadPath = "";
     this.VersionName = version.version;
 }