public void SetSelected(PositionAssociation pa)
 {
     foreach (DataGridViewRow dataGridViewRow in (IEnumerable)this.pinList.Rows)
     {
         if (dataGridViewRow.Tag == pa)
         {
             dataGridViewRow.Selected = true;
             this.pinList.CurrentCell = dataGridViewRow.Cells[0];
             return;
         }
     }
     this.UnselectAll();
 }
Example #2
0
 public void AddAssociation(PositionAssociation positionAssociaton)
 {
     if (positionAssociaton.pinId == -1)
     {
         positionAssociaton.pinId = this.nextPinId;
     }
     if (positionAssociaton.associationName == "")
     {
         positionAssociaton.associationName = string.Format("Pin{0}", positionAssociaton.pinId);
     }
     this.nextPinId = Math.Max(this.nextPinId, positionAssociaton.pinId) + 1;
     this.associationList.Add(positionAssociaton);
     this.dirtyEvent.SetDirty();
 }
Example #3
0
        public RegistrationDefinition(MashupParseContext context, DirtyEvent dirtyEvent)
        {
            this.dirtyEvent = new DirtyEvent(dirtyEvent);
            XMLTagReader xMLTagReader = context.NewTagReader(RegistrationDefinition.RegistrationDefinitionTag);

            this.warpStyle = TransformationStyleFactory.ReadFromXMLAttribute(context);
            while (xMLTagReader.FindNextStartTag())
            {
                if (xMLTagReader.TagIs(PositionAssociation.XMLTag()))
                {
                    this.AddAssociation(new PositionAssociation(context, dirtyEvent));
                }
            }
        }
		public void AddAssociation(PositionAssociation positionAssociaton)
		{
			if (positionAssociaton.pinId == -1)
			{
				positionAssociaton.pinId = this.nextPinId;
			}
			if (positionAssociaton.associationName == "")
			{
				positionAssociaton.associationName = string.Format("Pin{0}", positionAssociaton.pinId);
			}
			this.nextPinId = Math.Max(this.nextPinId, positionAssociaton.pinId) + 1;
			this.associationList.Add(positionAssociaton);
			this.dirtyEvent.SetDirty();
		}
        private void updatePushPinButton_Click(object sender, EventArgs e)
        {
            if (this.pinList.SelectedRows.Count == 0)
            {
                return;
            }
            int firstDisplayedScrollingRowIndex     = this.pinList.FirstDisplayedScrollingRowIndex;
            PositionAssociation positionAssociation = (PositionAssociation)this.pinList.SelectedRows[0].Tag;

            try
            {
                this.associationIfc.UpdateAssociation(positionAssociation, this.pinText.Text);
            }
            catch (DuplicatePushpinException ex)
            {
                this.DisplayDuplicatePushpinMessage("Cannot update pushpin.", ex);
            }
            this.pinText.Text = "";
            this.SetSelected(positionAssociation);
            this.pinList.FirstDisplayedScrollingRowIndex = firstDisplayedScrollingRowIndex;
        }
		public PositionAssociationView(PositionAssociation assoc, PositionAssociationView.WhichPosition whichPosition)
		{
			this.assoc = assoc;
			this.whichPosition = whichPosition;
		}
Example #7
0
 public void ViewAssociation(PositionAssociation pa)
 {
     this.uiPosition.GetSMPos().setPosition(pa.sourcePosition.pinPosition);
     this.uiPosition.GetVEPos().setPosition(pa.globalPosition.pinPosition);
     this.SetVEMapStyle(this.uiPosition.GetVEPos().style);
 }
Example #8
0
 public void RemoveAssociation(PositionAssociation assoc)
 {
     this.displayedRegistration.model.RemoveAssociation(assoc);
     this.updateRegistrationDisplay();
 }
Example #9
0
 private void CheckForDuplicatePushpin(PositionAssociation newAssoc, int ignorePinId)
 {
     foreach (PositionAssociation current in this.displayedRegistration.model.GetAssociationList())
     {
         if (ignorePinId == -1 || ignorePinId != current.pinId)
         {
             bool flag = current.globalPosition.pinPosition == newAssoc.globalPosition.pinPosition;
             bool flag2 = current.imagePosition.pinPosition == newAssoc.imagePosition.pinPosition;
             string text = "";
             if (flag && flag2)
             {
                 text = "reference and source";
             }
             else
             {
                 if (flag)
                 {
                     text = "reference";
                 }
                 else
                 {
                     if (flag2)
                     {
                         text = "source";
                     }
                 }
             }
             if (text != "")
             {
                 throw new DuplicatePushpinException(text, current.pinId, current.associationName);
             }
         }
     }
 }
Example #10
0
 public void UpdateAssociation(PositionAssociation assoc, string newName)
 {
     PositionAssociation newAssoc = new PositionAssociation("proposed", this.uiPosition.GetSMPos().llz, this.uiPosition.GetSMPos().llz, this.uiPosition.GetVEPos().llz, new DirtyEvent());
     this.CheckForDuplicatePushpin(newAssoc, assoc.pinId);
     assoc.UpdateAssociation(this.uiPosition.GetSMPos().llz, this.uiPosition.GetVEPos().llz);
     if (newName != null && newName != "")
     {
         assoc.associationName = newName;
     }
     this.updateRegistrationDisplay();
 }
Example #11
0
 public void AddNewAssociation(string newPinName)
 {
     D.Assert(!((SourceMapViewManager)this.currentView).MapsLocked());
     PositionAssociation positionAssociation = new PositionAssociation(newPinName, this.uiPosition.GetSMPos().llz, this.uiPosition.GetSMPos().llz, this.uiPosition.GetVEPos().llz, this.displayedRegistration.model.dirtyEvent);
     this.CheckForDuplicatePushpin(positionAssociation, -1);
     this.displayedRegistration.model.AddAssociation(positionAssociation);
     this.updateRegistrationDisplay();
 }
Example #12
0
 public void SetSelected(PositionAssociation pa)
 {
     foreach (DataGridViewRow dataGridViewRow in (IEnumerable)this.pinList.Rows)
     {
         if (dataGridViewRow.Tag == pa)
         {
             dataGridViewRow.Selected = true;
             this.pinList.CurrentCell = dataGridViewRow.Cells[0];
             return;
         }
     }
     this.UnselectAll();
 }
Example #13
0
 public void RemoveAssociation(PositionAssociation assoc)
 {
     this.associationList.Remove(assoc);
     this.dirtyEvent.SetDirty();
 }
 public PositionAssociationView(PositionAssociation assoc, PositionAssociationView.WhichPosition whichPosition)
 {
     this.assoc         = assoc;
     this.whichPosition = whichPosition;
 }
Example #15
0
		public void RemoveAssociation(PositionAssociation assoc)
		{
			this.associationList.Remove(assoc);
			this.dirtyEvent.SetDirty();
		}