/// <summary> /// Customize constructor contains a parameter ModificationData. /// </summary> /// <param name="modificationData"></param> public HostedSweepModifyForm(ModificationData modificationData) : this() { m_modificationData = modificationData; this.Text = "Modify " + m_modificationData.CreatorName; }
/// <summary> /// Create a hosted-sweep according to the CreationData parameter. /// </summary> /// <param name="creationData">CreationData parameter</param> /// <returns>ModificationData which contains the created hosted-sweep</returns> public ModificationData Create(CreationData creationData) { ReferenceArray refArr = new ReferenceArray(); foreach (Edge edge in creationData.EdgesForHostedSweep) { refArr.Append(edge.Reference); } ModificationData modificationData = null; Transaction transaction = new Transaction(m_rvtDoc, "CreateHostedSweep"); try { transaction.Start(); HostedSweep createdHostedSweep = CreateHostedSweep(creationData.Symbol, refArr); if (transaction.Commit() == TransactionStatus.Committed) { m_rvtUIDoc.ShowElements(createdHostedSweep); // just only end transaction return true, we will create the hosted sweep. modificationData = new ModificationData(createdHostedSweep, creationData); m_createdHostedSweeps.Add(modificationData); } } catch { transaction.RollBack(); } return modificationData; }