Ejemplo n.º 1
0
        public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger)
        {
            Pull.Initialise(playerReader, requirementFactory, logger);
            Combat.Initialise(playerReader, requirementFactory, logger);
            Adhoc.Initialise(playerReader, requirementFactory, logger);
            Parallel.Initialise(playerReader, requirementFactory, logger);
            ShapeshiftForm.ForEach(i => i.Initialise(playerReader, requirementFactory, logger));

            Interact.Key = InteractKey;
            Interact.Initialise(playerReader, requirementFactory, logger);

            if (string.IsNullOrEmpty(Blink.Key))
            {
                Blink.Key = " ";
            }
            Blink.Initialise(playerReader, requirementFactory, logger);

            TargetLastTarget.Key = TargetLastTargetKey;
            TargetLastTarget.Initialise(playerReader, requirementFactory, logger);

            GatherFindKeys.ForEach(key =>
            {
                GatherFindKeyConfig.Add(new KeyAction {
                    Key = key
                });
                GatherFindKeyConfig.Last().Initialise(playerReader, requirementFactory, logger);
            });
        }
Ejemplo n.º 2
0
 protected Planner()
 {
     this.move = new Move();
     this.pull = new Pull();
     this.push = new Push();
     this.noOp = new NoOp();
 }
Ejemplo n.º 3
0
        public async Task <IActionResult> AddDevice(Input_Device model, [FromServices] ContextString dbContext)
        {
            QianMuResult _Result = new QianMuResult();

            Stream stream = HttpContext.Request.Body;

            byte[] buffer = new byte[HttpContext.Request.ContentLength.Value];
            stream.Read(buffer, 0, buffer.Length);
            string inputStr = Encoding.UTF8.GetString(buffer);



            //调用云端接口创建设备
            var url = Method.MallSite + "API/IOT/AddDevice";

            _Result = Method.PostMothsToObj(url, inputStr);
            if (_Result.Code == "200")
            {
                Pull pull = new Pull();
                await pull.PullDevData();
            }



            return(Json(_Result));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Admin != null)
         {
             hashCode = hashCode * 59 + Admin.GetHashCode();
         }
         if (Push != null)
         {
             hashCode = hashCode * 59 + Push.GetHashCode();
         }
         if (Pull != null)
         {
             hashCode = hashCode * 59 + Pull.GetHashCode();
         }
         if (Class != null)
         {
             hashCode = hashCode * 59 + Class.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 5
0
        public void WithoutPermissions()
        {
            this.Login("noperm");

            var context = new Context(this.Database, this.Workspace);

            var pull = new Pull
            {
                Extent = new Extent(M.C1.ObjectType),
            };

            var result = context.Load(pull).Result;

            var c1s = result.GetCollection <C1>("C1s");

            foreach (var c1 in c1s)
            {
                foreach (var roleType in M.C1.ObjectType.RoleTypes)
                {
                    var role = c1.Get(roleType);
                    Assert.True(role == null || (role is Array array && array.Length == 0));
                }

                foreach (var associationType in M.C1.ObjectType.AssociationTypes)
                {
                    var association = context.Session.GetAssociation(c1, associationType);
                    Assert.Empty(association);
                }
            }
        }
Ejemplo n.º 6
0
        private void UpdateSync()
        {
            if (Database == null)
            {
                return;
            }

            var preferences = PreferenceManager.GetDefaultSharedPreferences(this);
            var syncUrl     = preferences.GetString("sync-gateway-url", null);

            ForgetSync();

            if (!String.IsNullOrEmpty(syncUrl))
            {
                try
                {
                    var uri = new Uri(syncUrl);
                    Pull            = Database.CreatePullReplication(uri);
                    Pull.Continuous = true;
                    Pull.Changed   += ReplicationChanged;

                    Push            = Database.CreatePushReplication(uri);
                    Push.Continuous = true;
                    Push.Changed   += ReplicationChanged;

                    Pull.Start();
                    Push.Start();
                }
                catch (Java.Lang.Throwable th)
                {
                    Log.Debug(Tag, th, "UpdateSync Error");
                }
            }
        }
Ejemplo n.º 7
0
        internal void Store(Pull pull)
        {
            var root = JsonSchemaGenerator.Generate(pull, _loggerFactory);
            var json = JsonConvert.SerializeObject(root, Formatting.Indented);

            File.WriteAllText(Source.Path, json);
        }
Ejemplo n.º 8
0
 private void Pull_MouseDown(object sender, MouseEventArgs e)
 {
     if (Logined)
     {
         Pull.DoDragDrop(Pull.SelectedItem, DragDropEffects.Scroll | DragDropEffects.Move | DragDropEffects.Copy);
     }
 }
Ejemplo n.º 9
0
 public PullInstantiate(ISession session, Pull pull, User user, IFetchService fetchService)
 {
     this.session      = session;
     this.pull         = pull;
     this.user         = user;
     this.fetchService = fetchService;
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Returns true if GithubRepositorypermissions instances are equal
        /// </summary>
        /// <param name="other">Instance of GithubRepositorypermissions to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GithubRepositorypermissions other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Admin == other.Admin ||

                     Admin.Equals(other.Admin)
                     ) &&
                 (
                     Push == other.Push ||

                     Push.Equals(other.Push)
                 ) &&
                 (
                     Pull == other.Pull ||

                     Pull.Equals(other.Pull)
                 ) &&
                 (
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                 ));
        }
Ejemplo n.º 11
0
        public void Users()
        {
            var context = new Context(this.Database, this.Workspace);

            var pull = new Pull
            {
                Extent  = new Filter(M.User.ObjectType),
                Results = new[]
                {
                    new Result
                    {
                        Fetch = new Fetch
                        {
                            Include = new UserNodeBuilder(v => v.Person_Address()),
                        },
                    },
                },
            };

            var result = context.Load(pull).Result;

            var users = result.GetCollection <User>();

            var personWithAddress = (Person)users.Single(v => (v as Person)?.ExistAddress == true);

            Assert.NotNull(personWithAddress);
            Assert.Equal("Jane", personWithAddress.FirstName);
        }
Ejemplo n.º 12
0
 public PullInstantiate(ISession session, Pull pull, IAccessControlLists acls, IFetchService fetchService)
 {
     this.session      = session;
     this.pull         = pull;
     this.fetchService = fetchService;
     this.acls         = acls;
 }
Ejemplo n.º 13
0
 public PullExtent(ISession session, Pull pull, IAccessControlLists acls, IExtentService extentService, IFetchService fetchService)
 {
     this.session       = session;
     this.pull          = pull;
     this.extentService = extentService;
     this.fetchService  = fetchService;
     this.acls          = acls;
 }
Ejemplo n.º 14
0
 public PullExtent(ISession session, Pull pull, User user, IExtentService extentService, IFetchService fetchService)
 {
     this.session       = session;
     this.pull          = pull;
     this.user          = user;
     this.extentService = extentService;
     this.fetchService  = fetchService;
 }
Ejemplo n.º 15
0
        internal static Message GeneratePullMessage(EnumerationContextType context, int pageSize)
        {
            Pull op = new Pull();

            op.EnumerationContext = context;
            op.MaxElements        = pageSize.ToString();

            return(Message.CreateMessage(MessageVersion.Soap12WSAddressing10, Namespaces.Pull, new SerializerBodyWriter(op)));
        }
Ejemplo n.º 16
0
    private void Start()
    {
        audioManager = Audio.instance;
        audioManager.PlaySound(nameSound);

        test = transform.right;

        pull = FindObjectOfType <Pull>();
        StartCoroutine(wait());
    }
Ejemplo n.º 17
0
    public static bool AddPullData(XContainer xc, List <Station> stationList)
    {
        try
        {
            string          LastUpdate = xc.Element("stations").Attribute("lastUpdate").Value;
            CaBiDataContext dc         = new CaBiDataContext();

            if ((from p in dc.Pulls where p.DateSignature == LastUpdate select p).Count <Pull>() == 0)
            {
                Pull p = new Pull();
                p.DateSignature = LastUpdate;
                p.PullDate      = DateTime.Now;
                dc.Pulls.InsertOnSubmit(p);
                dc.SubmitChanges();

                int pullID = (from pid in dc.Pulls where pid.DateSignature == LastUpdate select pid.PullID).First <int>();

                foreach (Station s in stationList)
                {
                    if ((from ps in dc.PulledStations where ps.StationID == s.id select ps).Count <PulledStation>() == 0)
                    {
                        CaBiDataContext dcsub = new CaBiDataContext();
                        PulledStation   ps    = new PulledStation();
                        ps.StationID   = s.id;
                        ps.StationName = s.name;
                        ps.Latitude    = s.lat;
                        ps.Longitude   = s.lng;
                        ps.Installed   = s.installed;
                        ps.Locked      = s.locked;
                        ps.Temporary   = s.temporary;
                        dcsub.PulledStations.InsertOnSubmit(ps);
                        dcsub.SubmitChanges();
                    }

                    PullResult pr = new PullResult();
                    pr.PullID    = pullID;
                    pr.StationID = s.id;
                    pr.Docked    = s.bikeCount;
                    pr.Empty     = s.dockCount;
                    pr.Installed = s.installed;
                    pr.Locked    = s.locked;
                    pr.Temporary = s.temporary;
                    dc.PullResults.InsertOnSubmit(pr);
                }
                dc.SubmitChanges();
            }

            return(true);
        }
        catch
        {
            return(false);
        }
    }
Ejemplo n.º 18
0
    public static bool AddPullData(XContainer xc, List<Station> stationList)
    {
        try
        {
            string LastUpdate = xc.Element("stations").Attribute("lastUpdate").Value;
            CaBiDataContext dc = new CaBiDataContext();

            if ((from p in dc.Pulls where p.DateSignature == LastUpdate select p).Count<Pull>() == 0)
            {
                Pull p = new Pull();
                p.DateSignature = LastUpdate;
                p.PullDate = DateTime.Now;
                dc.Pulls.InsertOnSubmit(p);
                dc.SubmitChanges();

                int pullID = (from pid in dc.Pulls where pid.DateSignature == LastUpdate select pid.PullID).First<int>();

                foreach (Station s in stationList)
                {
                    if ((from ps in dc.PulledStations where ps.StationID == s.id select ps).Count<PulledStation>() == 0)
                    {
                        CaBiDataContext dcsub = new CaBiDataContext();
                        PulledStation ps = new PulledStation();
                        ps.StationID = s.id;
                        ps.StationName = s.name;
                        ps.Latitude = s.lat;
                        ps.Longitude = s.lng;
                        ps.Installed = s.installed;
                        ps.Locked = s.locked;
                        ps.Temporary = s.temporary;
                        dcsub.PulledStations.InsertOnSubmit(ps);
                        dcsub.SubmitChanges();
                    }

                    PullResult pr = new PullResult();
                    pr.PullID = pullID;
                    pr.StationID = s.id;
                    pr.Docked = s.bikeCount;
                    pr.Empty = s.dockCount;
                    pr.Installed = s.installed;
                    pr.Locked = s.locked;
                    pr.Temporary = s.temporary;
                    dc.PullResults.InsertOnSubmit(pr);
                }
                dc.SubmitChanges();
            }

            return true;
        }
        catch
        {
            return false;
        }
    }
Ejemplo n.º 19
0
        public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger)
        {
            Pull.Initialise(playerReader, requirementFactory, logger);
            Combat.Initialise(playerReader, requirementFactory, logger);
            Adhoc.Initialise(playerReader, requirementFactory, logger);
            Parallel.Initialise(playerReader, requirementFactory, logger);
            ShapeshiftForm.ForEach(i => i.Initialise(playerReader, requirementFactory, logger));

            Interact.Key = InteractKey;
            Interact.Initialise(playerReader, requirementFactory, logger);
            Blink.Initialise(playerReader, requirementFactory, logger);
        }
Ejemplo n.º 20
0
        private IDictionary <string, object> GenerateFromPull(Pull pull, ILoggerFactory loggerFactory)
        {
            var logger = loggerFactory?.CreateLogger <JsonSchemaGenerator>();
            var root   = new Dictionary <string, object>();

            foreach (var key in pull.Properties.Keys)
            {
                var keys = key.Split('.');
                CreateJSONFromDictionary(root, keys, 0, pull.Properties[key], logger);
            }
            return(root);
        }
Ejemplo n.º 21
0
        public FormSubmodules(GitUICommands commands)
            : base(commands)
        {
            InitializeComponent();

            nameDataGridViewTextBoxColumn.DataPropertyName = nameof(GitSubmoduleInfo.Name);
            Status.DataPropertyName = nameof(GitSubmoduleInfo.Status);
            gitSubmoduleBindingSource.DataSource = _modules;
            splitContainer1.SplitterDistance     = DpiUtil.Scale(222);
            Pull.AdaptImageLightness();
            InitializeComplete();
        }
Ejemplo n.º 22
0
        public async void OnGet()
        {
            var context = new Context(this.Database, this.Workspace);

            var pull = new Pull
            {
                Extent = new Filter(M.Person.ObjectType),
            };

            var result = await context.Load(pull);

            this.People = result.GetCollection <Person>("People");
        }
Ejemplo n.º 23
0
        private void ForgetSync()
        {
            if (Pull != null) {
                Pull.Changed -= ReplicationChanged;
                Pull.Stop();
                Pull = null;
            }

            if (Push != null) {
                Push.Changed -= ReplicationChanged;
                Push.Stop();
                Push = null;
            }
        }
        private void PullUpdated(Pull pull, Card card, BoardMapping boardMapping)
        {
            Log.Info("Pull [{0}] updated, comparing to corresponding card...", pull.Id);

            long boardId = boardMapping.Identity.LeanKit;

            // sync and save those items that are different (of title, description, priority)
            bool saveCard = false;

            if (pull.Title != card.Title)
            {
                card.Title = pull.Title;
                saveCard   = true;
            }

            if (pull.Body.SanitizeCardDescription() != card.Description)
            {
                card.Description = pull.Body.SanitizeCardDescription();
                saveCard         = true;
            }

            var priority = pull.LeanKitPriority();

            if (priority != card.Priority)
            {
                card.Priority = priority;
                saveCard      = true;
            }

            if ((card.Tags == null || !card.Tags.Contains(ServiceName)) && boardMapping.TagCardsWithTargetSystemName)
            {
                if (string.IsNullOrEmpty(card.Tags))
                {
                    card.Tags = ServiceName;
                }
                else
                {
                    card.Tags += "," + ServiceName;
                }
                saveCard = true;
            }

            if (saveCard)
            {
                Log.Info("Updating card [{0}]", card.Id);
                LeanKit.UpdateCard(boardId, card);
            }
        }
Ejemplo n.º 25
0
    public void Init()
    {
        jointController = GetComponent <DistanceJointController>();
        jointController.Init();

        pull = GetComponent <Pull>();
        pull.Init(jointController);

        push = GetComponent <Push>();
        push.Init(this, jointController);

        input = GetComponent <PlayerInput>();
        input.Init();

        lineRenderer = GetComponent <LineController>();
        lineRenderer.Init();
    }
Ejemplo n.º 26
0
        public void GetOne2One() =>
        AsyncContext.Run(
            async() =>
        {
            var context = new Context(this.Database, this.Workspace);

            var pull = new Pull[]
            {
                new Pull
                {
                    Extent = new Filter(M.C2.ObjectType)
                    {
                        Predicate = new Equals(M.C2.Name)
                        {
                            Value = "c2C"
                        },
                    },
                    Results = new[]
                    {
                        new Result
                        {
                            Fetch = new Fetch
                            {
                                Include = new[]
                                {
                                    new Node(M.C2.C1WhereC1C2One2One),
                                },
                            },
                        },
                    },
                },
            };

            var result = await context.Load(pull);

            var c2s = result.GetCollection <C2>();

            var c2C = c2s.First(v => v.Name == "c2C");

            var c1WhereC1C2One2One = c2C.C1WhereC1C2One2One;

            // One to One
            Assert.NotNull(c1WhereC1C2One2One);
            Assert.Equal("c1C", c1WhereC1C2One2One.Name);
        });
Ejemplo n.º 27
0
        private static void PullRepBroker()
        {
            var tasksToSend       = new List <CommonRequest>();
            var responsesToClient = new List <CommonReply>();

            Pull <CommonRequest>             pull = null;
            REP <CommonRequest, CommonReply> rep  = null;

            var processClientRequest = new Func <CommonRequest, bool>(r =>
            {
                Console.WriteLine("[x] Received request {0} from {1} ", r.RequestId, r.ClientId.ToString().Substring(30));

                tasksToSend.Add(r);
                rep.AddTask(r);
                return(true);
            });

            var fromClientTask = Task.Factory.StartNew(() =>
            {
                pull = new Pull <CommonRequest>("tcp://127.0.0.1:5001", processClientRequest);
                pull.Start();
            });

            var processWorkerResponse = new Func <CommonReply, bool>(r =>
            {
                Console.WriteLine("[x] Received reply {0} to {1} ", r.ReplyId, r.ClientId.ToString().Substring(30));

                if (r.ClientId != default(Guid))
                {
                    responsesToClient.Add(r);
                }

                // TODO: Send response to client

                return(true);
            });

            var toWorkerTask = Task.Factory.StartNew(() =>
            {
                rep = new REP <CommonRequest, CommonReply>("tcp://127.0.0.1:5000", processWorkerResponse);
                rep.Start();
            });

            Task.WaitAll(fromClientTask, toWorkerTask);
        }
Ejemplo n.º 28
0
        public unsafe void NullablePullIndex()
        {
            var blockSize = 50;
            var pull      = new NullablePull <int>(blockSize);

            for (int i = 0; i < 100; i++)
            {
                var index = Pull.GetHIndex(i, blockSize, out var block, out var blockIndex);
                Helper.OneToTwoShift(index, out var left, out var right);
                Debug.WriteLine($"pull index {i} = {index} left {left} right {right}");
                pull.SetValue <int?>(index, i);
            }

            for (int i = 0; i < 100; i++)
            {
                Pull.GetHIndex(i, blockSize, out var block, out var blockIndex);
                Assert.AreEqual(i, pull.GetValue(block, blockIndex));
            }
        }
Ejemplo n.º 29
0
    void Start()
    {
        //SizeUpObject = GameObject.FindGameObjectWithTag("Black");

        //rndCode = SizeUpObject.GetComponent<Rnd>();
        StateCheck      = GameObject.Find("Cekim");
        Degerler        = AnaKarakter.transform.localScale;
        pullcode        = StateCheck.GetComponent <Pull>();
        StateCheckSuper = GameObject.FindGameObjectWithTag("CekimSuper");
        pullCodeSuper   = StateCheckSuper.GetComponent <PullSuper>();

        AnaKarakter           = GameObject.FindGameObjectWithTag("Player");
        MoveCode              = AnaKarakter.GetComponent <PlayerMovement>();
        cameraObject          = GameObject.Find("MainCamera");
        Trigger               = GameObject.FindGameObjectWithTag("FastTrigger");
        Trigcode              = Trigger.GetComponent <ToNextStage>();
        pullCodeSuper.enabled = false;
        //Ball = GameObject.FindGameObjectWithTag("Balls");
        //camCode = cameraObject.GetComponent<CameraMovementScript>();
    }
Ejemplo n.º 30
0
        public async static Task <bool> PullDataFromCloud()
        {
            Pull pull = new Pull();
            await pull.PullAppData();

            await pull.PullDevData();

            await pull.PullFileData();

            await pull.PullInitData();

            await pull.PullProgramData();

            await pull.PullReviewData();

            await pull.PullShopInfoData();

            await pull.PullSystemData();;

            return(true);
        }
Ejemplo n.º 31
0
        public void WithAccessControl()
        {
            var context = new Context(this.Database, this.Workspace);

            var pull = new Pull
            {
                Extent = new Extent(M.C1.ObjectType),
            };

            var result = context.Load(pull).Result;

            var c1s = result.GetCollection <C1>("C1s");

            Assert.Equal(4, c1s.Length);

            result = context.Load(pull).Result;

            var c1s2 = result.GetCollection <C1>("C1s");

            Assert.Equal(4, c1s2.Length);
        }
Ejemplo n.º 32
0
 public PowerUp getPowerUp(PowerUpList chosenPowerUpID)
 {
     PowerUp chosenPowerUp = null;
     switch (chosenPowerUpID) {
     case PowerUpList.SlowDown:
         chosenPowerUp = new SlowDown(10);
         break;
     case PowerUpList.SpeedUp:
         chosenPowerUp = new SpeedUp(10);
         break;
     case PowerUpList.Warp:
         chosenPowerUp = new Warp(10);
         break;
     case PowerUpList.IceyPlayer:
         chosenPowerUp = new IceyPlayer(10);
         break;
     case PowerUpList.ObjectSpawnPowerUp:
         chosenPowerUp = new ObjectSpawnPowerUp(10);
         break;
     case PowerUpList.Pull:
         chosenPowerUp = new Pull(10);
         break;
     case PowerUpList.Push:
         chosenPowerUp = new Push(10);
         break;
     case PowerUpList.Bigger:
         chosenPowerUp = new Bigger(10);
         break;
     case PowerUpList.Smaller:
         chosenPowerUp = new Smaller(10);
         break;
     case PowerUpList.OrbitingShield:
         chosenPowerUp = new OrbitingShield(10);
         break;
     }
     return chosenPowerUp;
 }
Ejemplo n.º 33
0
 partial void InsertPull(Pull instance);
Ejemplo n.º 34
0
 partial void UpdatePull(Pull instance);
Ejemplo n.º 35
0
 partial void DeletePull(Pull instance);
		private void PullUpdated(Pull pull, Card card, BoardMapping boardMapping) 
		{
			Log.Info("Pull [{0}] updated, comparing to corresponding card...", pull.Id);

			long boardId = boardMapping.Identity.LeanKit;

			// sync and save those items that are different (of title, description, priority)
			bool saveCard = false;
			if (pull.Title != card.Title) 
			{
				card.Title = pull.Title;
				saveCard = true;
			}

			if (pull.Body.SanitizeCardDescription() != card.Description) 
			{
				card.Description = pull.Body.SanitizeCardDescription();
				saveCard = true;
			}

			var priority = pull.LeanKitPriority();
			if (priority != card.Priority) 
			{
				card.Priority = priority;
				saveCard = true;
			}

			if ((card.Tags == null || !card.Tags.Contains(ServiceName)) && boardMapping.TagCardsWithTargetSystemName) 
			{
				if (string.IsNullOrEmpty(card.Tags))
					card.Tags = ServiceName;
				else
					card.Tags += "," + ServiceName;
				saveCard = true;
			}

			if (saveCard) 
			{
				Log.Info("Updating card [{0}]", card.Id);
				LeanKit.UpdateCard(boardId, card);
			}
		}
        private void CreateCardFromItem(BoardMapping project, Pull pull)
        {
			if (pull == null) return;
        
            var boardId = project.Identity.LeanKit;
        
            var mappedCardType = pull.LeanKitCardType(project);
            var laneId = project.LanesFromState(pull.State).First();
            var card = new Card
            {
			    Active = true,
                Title = pull.Title,
				Description = pull.Body.SanitizeCardDescription(),
				Priority = pull.LeanKitPriority(),
                TypeId = mappedCardType.Id,
                TypeName = mappedCardType.Name,
                LaneId = laneId,
                ExternalCardID = pull.Id.ToString() + "|" + pull.Number.ToString(),
                ExternalSystemName = ServiceName, 				
				ExternalSystemUrl = string.Format(_externalUrlTemplate, project.Identity.Target, pull.Number)
            };

			var assignedUserId = pull.LeanKitAssignedUser(boardId, LeanKit);
			if (assignedUserId != null)
				card.AssignedUserIds = new[] { assignedUserId.Value };

			if ((card.Tags == null || !card.Tags.Contains(ServiceName)) && project.TagCardsWithTargetSystemName) 
			{
				if (string.IsNullOrEmpty(card.Tags))
					card.Tags = ServiceName;
				else
					card.Tags += "," + ServiceName;
			}

            Log.Info("Creating a card of type [{0}] for Pull Request [{1}] on Board [{2}] on Lane [{3}]", mappedCardType.Name, pull.Number, boardId, laneId);

	        CardAddResult cardAddResult = null;

			int tries = 0;
			bool success = false;
			while (tries < 10 && !success) 
			{
				if (tries > 0) 
				{
					Log.Error(string.Format("Attempting to create card for Pull Request [{0}] attempt number [{1}]", pull.Id,
											 tries));
					// wait 5 seconds before trying again
					Thread.Sleep(new TimeSpan(0, 0, 5));
				}

				try {
					cardAddResult = LeanKit.AddCard(boardId, card, "New Card From GitHub Pull Request");
					success = true;
				} catch (Exception ex) {
					Log.Error(string.Format("An error occurred: {0} - {1} - {2}", ex.GetType(), ex.Message, ex.StackTrace));
				}
				tries++;
			}
	        if (cardAddResult != null) card.Id = cardAddResult.CardId;

	        Log.Info("Created a card [{0}] of type [{1}] for Pull Request [{2}] on Board [{3}] on Lane [{4}]", card.Id, mappedCardType.Name, pull.Number, boardId, laneId);
        }
Ejemplo n.º 38
0
		public PullingReader (Pull _pull, DoClose _close) : base ()
		{
			pull = _pull;
			close = _close;
		}
Ejemplo n.º 39
0
		public PullingReader (Pull _pull) : this (_pull, null) { }