Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

903 lines
17 KiB

  1. using System;
  2. using System.Collections;
  3. using System.Collections.Specialized;
  4. using System.Diagnostics;
  5. using System.ComponentModel;
  6. using System.Xml.Serialization;
  7. using Microsoft.Uddi;
  8. namespace Microsoft.Uddi.ServiceType
  9. {
  10. [XmlRootAttribute("delete_tModel", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  11. public class DeleteTModel : UddiSecureMessage
  12. {
  13. private StringCollection tModelKeys;
  14. [XmlElement("tModelKey")]
  15. public StringCollection TModelKeys
  16. {
  17. get
  18. {
  19. if( null == tModelKeys )
  20. {
  21. tModelKeys = new StringCollection();
  22. }
  23. return tModelKeys;
  24. }
  25. set { tModelKeys = value; }
  26. }
  27. }
  28. [XmlRootAttribute("find_tModel", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  29. public class FindTModel : UddiQueryMessage
  30. {
  31. private string name;
  32. private KeyedReferenceCollection identifierBag;
  33. private KeyedReferenceCollection categoryBag;
  34. [XmlElement("name")]
  35. public string Name
  36. {
  37. get { return name; }
  38. set { name = value; }
  39. }
  40. [XmlArray("identifierBag"), XmlArrayItem("keyedReference")]
  41. public KeyedReferenceCollection IdentifierBag
  42. {
  43. get
  44. {
  45. if( true == SerializeMode &&
  46. true == Utility.CollectionEmpty( identifierBag ) )
  47. {
  48. return null;
  49. }
  50. if( null == identifierBag )
  51. {
  52. identifierBag = new KeyedReferenceCollection();
  53. }
  54. return identifierBag;
  55. }
  56. set { identifierBag = value; }
  57. }
  58. [XmlArray("categoryBag"), XmlArrayItem("keyedReference")]
  59. public KeyedReferenceCollection CategoryBag
  60. {
  61. get
  62. {
  63. if( true == SerializeMode &&
  64. true == Utility.CollectionEmpty( categoryBag ) )
  65. {
  66. return null;
  67. }
  68. if( null == categoryBag )
  69. {
  70. categoryBag = new KeyedReferenceCollection();
  71. }
  72. return categoryBag;
  73. }
  74. set { categoryBag = value; }
  75. }
  76. }
  77. [XmlRootAttribute("get_tModelDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  78. public class GetTModelDetail : UddiMessage
  79. {
  80. private StringCollection tModelKeys;
  81. [XmlElement("tModelKey")]
  82. public StringCollection TModelKeys
  83. {
  84. get
  85. {
  86. if( null == tModelKeys )
  87. {
  88. tModelKeys = new StringCollection();
  89. }
  90. return tModelKeys;
  91. }
  92. set { tModelKeys = value; }
  93. }
  94. }
  95. [XmlRootAttribute("save_tModel", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  96. public class SaveTModel : UddiSecureMessage
  97. {
  98. private TModelCollection tModels;
  99. private StringCollection uploadRegisters;
  100. [XmlElement("tModel")]
  101. public TModelCollection TModels
  102. {
  103. get
  104. {
  105. if( true == SerializeMode &&
  106. true == Utility.CollectionEmpty( tModels ) )
  107. {
  108. return null;
  109. }
  110. if( null == tModels )
  111. {
  112. tModels = new TModelCollection();
  113. }
  114. return tModels;
  115. }
  116. set { tModels = value; }
  117. }
  118. [XmlElement("uploadRegister")]
  119. public StringCollection UploadRegisters
  120. {
  121. get
  122. {
  123. if( true == SerializeMode &&
  124. true == Utility.CollectionEmpty( uploadRegisters ) )
  125. {
  126. return null;
  127. }
  128. if( null == uploadRegisters )
  129. {
  130. uploadRegisters = new StringCollection();
  131. }
  132. return uploadRegisters;
  133. }
  134. set { uploadRegisters = value; }
  135. }
  136. public override bool SerializeMode
  137. {
  138. get { return base.SerializeMode; }
  139. set
  140. {
  141. if( false == Utility.CollectionEmpty( tModels ) )
  142. {
  143. foreach( TModel tModel in tModels )
  144. {
  145. tModel.SerializeMode = value;
  146. }
  147. }
  148. base.SerializeMode = value;
  149. }
  150. }
  151. }
  152. [XmlRootAttribute("tModelDetail", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  153. public class TModelDetail : UddiCore
  154. {
  155. private string node;
  156. private bool truncated;
  157. private TModelCollection tModels;
  158. [XmlAttribute("operator")]
  159. public string Operator
  160. {
  161. get { return node; }
  162. set { node = value; }
  163. }
  164. [XmlAttribute("truncated")]
  165. public bool Truncated
  166. {
  167. get { return truncated; }
  168. set { truncated = value; }
  169. }
  170. [XmlElement("tModel")]
  171. public TModelCollection TModels
  172. {
  173. get
  174. {
  175. if( null == tModels )
  176. {
  177. tModels = new TModelCollection();
  178. }
  179. return tModels;
  180. }
  181. set { tModels = value; }
  182. }
  183. }
  184. [XmlRootAttribute("tModelList", Namespace=Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace)]
  185. public class TModelList : UddiCore
  186. {
  187. private string node;
  188. private bool truncated;
  189. private TModelInfoCollection tModelInfos;
  190. [XmlAttribute("operator")]
  191. public string Operator
  192. {
  193. get { return node; }
  194. set { node = value; }
  195. }
  196. [XmlAttribute("truncated")]
  197. public bool Truncated
  198. {
  199. get { return truncated; }
  200. set { truncated = value; }
  201. }
  202. [XmlArray("tModelInfos"), XmlArrayItem("tModelInfo")]
  203. public TModelInfoCollection TModelInfos
  204. {
  205. get
  206. {
  207. if( null == tModelInfos )
  208. {
  209. tModelInfos = new TModelInfoCollection();
  210. }
  211. return tModelInfos;
  212. }
  213. set { tModelInfos = value; }
  214. }
  215. }
  216. public class TModel : UddiCore
  217. {
  218. private string tModelKey;
  219. private string node;
  220. private string authorizedName;
  221. private string name;
  222. private OverviewDoc overviewDoc;
  223. private DescriptionCollection descriptions;
  224. private KeyedReferenceCollection identifierBag;
  225. private KeyedReferenceCollection categoryBag;
  226. public TModel() : this( "" )
  227. {}
  228. public TModel( string tModelKey )
  229. {
  230. TModelKey = tModelKey;
  231. }
  232. [XmlAttribute("tModelKey")]
  233. public string TModelKey
  234. {
  235. get { return tModelKey; }
  236. set { tModelKey = value; }
  237. }
  238. [XmlAttribute("operator")]
  239. public string Operator
  240. {
  241. get { return node; }
  242. set { node = value; }
  243. }
  244. [XmlAttribute("authorizedName")]
  245. public string AuthorizedName
  246. {
  247. get { return authorizedName; }
  248. set { authorizedName = value; }
  249. }
  250. [XmlElement("name")]
  251. public string Name
  252. {
  253. get { return name; }
  254. set { name = value; }
  255. }
  256. [XmlElement("description")]
  257. public DescriptionCollection Descriptions
  258. {
  259. get
  260. {
  261. if( true == SerializeMode &&
  262. true == Utility.CollectionEmpty( descriptions ) )
  263. {
  264. return null;
  265. }
  266. if( null == descriptions )
  267. {
  268. descriptions = new DescriptionCollection();
  269. }
  270. return descriptions;
  271. }
  272. set { descriptions = value; }
  273. }
  274. [XmlElement("overviewDoc")]
  275. public OverviewDoc OverviewDoc
  276. {
  277. get
  278. {
  279. if( true == SerializeMode &&
  280. ( null == overviewDoc ||
  281. true == Utility.StringEmpty( overviewDoc.OverviewUrl )&&
  282. true == Utility.CollectionEmpty( overviewDoc.Descriptions )
  283. ) )
  284. {
  285. return null;
  286. }
  287. if( null == overviewDoc )
  288. {
  289. overviewDoc = new OverviewDoc();
  290. }
  291. return overviewDoc;
  292. }
  293. set { overviewDoc = value; }
  294. }
  295. [XmlArray("identifierBag"), XmlArrayItem("keyedReference")]
  296. public KeyedReferenceCollection IdentifierBag
  297. {
  298. get
  299. {
  300. if( true == SerializeMode &&
  301. true == Utility.CollectionEmpty( identifierBag ) )
  302. {
  303. return null;
  304. }
  305. if( null == identifierBag )
  306. {
  307. identifierBag = new KeyedReferenceCollection();
  308. }
  309. return identifierBag;
  310. }
  311. set { identifierBag = value; }
  312. }
  313. [XmlArray("categoryBag"), XmlArrayItem("keyedReference")]
  314. public KeyedReferenceCollection CategoryBag
  315. {
  316. get
  317. {
  318. if( true == SerializeMode &&
  319. true == Utility.CollectionEmpty( categoryBag ) )
  320. {
  321. return null;
  322. }
  323. if( null == categoryBag )
  324. {
  325. categoryBag = new KeyedReferenceCollection();
  326. }
  327. return categoryBag;
  328. }
  329. set { categoryBag = value; }
  330. }
  331. public override bool SerializeMode
  332. {
  333. get { return base.SerializeMode; }
  334. set
  335. {
  336. if( null != overviewDoc )
  337. {
  338. overviewDoc.SerializeMode = value;
  339. }
  340. base.SerializeMode = value;
  341. }
  342. }
  343. }
  344. public class TModelInstanceDetail : UddiCore
  345. {
  346. private TModelInstanceInfoCollection tModelInstanceInfos;
  347. [XmlElement("tModelInstanceInfo")]
  348. public TModelInstanceInfoCollection TModelInstanceInfos
  349. {
  350. get
  351. {
  352. if( true == SerializeMode &&
  353. true == Utility.CollectionEmpty( tModelInstanceInfos ) )
  354. {
  355. return null;
  356. }
  357. if( null == tModelInstanceInfos )
  358. {
  359. tModelInstanceInfos = new TModelInstanceInfoCollection();
  360. }
  361. return tModelInstanceInfos;
  362. }
  363. set { tModelInstanceInfos = value; }
  364. }
  365. public override bool SerializeMode
  366. {
  367. get { return base.SerializeMode; }
  368. set
  369. {
  370. if( false == Utility.CollectionEmpty( tModelInstanceInfos ) )
  371. {
  372. foreach( TModelInstanceInfo instanceInfo in tModelInstanceInfos )
  373. {
  374. instanceInfo.SerializeMode = value;
  375. }
  376. }
  377. base.SerializeMode = value;
  378. }
  379. }
  380. }
  381. public class TModelInstanceInfo : UddiCore
  382. {
  383. private string tModelKey;
  384. private DescriptionCollection descriptions;
  385. private InstanceDetail instanceDetails;
  386. [XmlAttribute("tModelKey")]
  387. public string TModelKey
  388. {
  389. get { return tModelKey; }
  390. set { tModelKey = value; }
  391. }
  392. [XmlElement("description")]
  393. public DescriptionCollection Descriptions
  394. {
  395. get
  396. {
  397. if( true == SerializeMode &&
  398. true == Utility.CollectionEmpty( descriptions ) )
  399. {
  400. return null;
  401. }
  402. if( null == descriptions )
  403. {
  404. descriptions = new DescriptionCollection();
  405. }
  406. return descriptions;
  407. }
  408. set { descriptions = value; }
  409. }
  410. [XmlElement("instanceDetails")]
  411. public InstanceDetail InstanceDetail
  412. {
  413. get
  414. {
  415. if( true == SerializeMode &&
  416. ( null == instanceDetails || instanceDetails.IsEmpty() ) )
  417. {
  418. return null;
  419. }
  420. if( null == instanceDetails )
  421. {
  422. instanceDetails = new InstanceDetail();
  423. }
  424. return instanceDetails;
  425. }
  426. set { instanceDetails = value; }
  427. }
  428. public override bool SerializeMode
  429. {
  430. get { return base.SerializeMode; }
  431. set
  432. {
  433. if( null != instanceDetails )
  434. {
  435. instanceDetails.SerializeMode = value;
  436. }
  437. base.SerializeMode = value;
  438. }
  439. }
  440. }
  441. public class TModelInfo : UddiCore
  442. {
  443. private string tModelKey;
  444. private string name;
  445. public TModelInfo() : this( "", "" )
  446. {}
  447. public TModelInfo( string tModelKey, string name )
  448. {
  449. TModelKey = tModelKey;
  450. Name = name;
  451. }
  452. [XmlAttribute("tModelKey")]
  453. public string TModelKey
  454. {
  455. get { return tModelKey; }
  456. set { tModelKey = value; }
  457. }
  458. [XmlElement("name")]
  459. public string Name
  460. {
  461. get { return name; }
  462. set { name = value; }
  463. }
  464. }
  465. public class InstanceDetail : UddiCore
  466. {
  467. private string instanceParms;
  468. private DescriptionCollection descriptions;
  469. private OverviewDoc overviewDoc;
  470. [XmlElement("description")]
  471. public DescriptionCollection Descriptions
  472. {
  473. get
  474. {
  475. if( true == SerializeMode &&
  476. true == Utility.CollectionEmpty( descriptions ) )
  477. {
  478. return null;
  479. }
  480. if( null == descriptions )
  481. {
  482. descriptions = new DescriptionCollection();
  483. }
  484. return descriptions;
  485. }
  486. set { descriptions = value; }
  487. }
  488. [XmlElement("overviewDoc")]
  489. public OverviewDoc OverviewDoc
  490. {
  491. get
  492. {
  493. if( true == SerializeMode &&
  494. ( null == overviewDoc || overviewDoc.IsEmpty() ) )
  495. {
  496. return null;
  497. }
  498. if( null == overviewDoc )
  499. {
  500. overviewDoc = new OverviewDoc();
  501. }
  502. return overviewDoc;
  503. }
  504. set { overviewDoc = value; }
  505. }
  506. [XmlElement("instanceParms")]
  507. public string InstanceParm
  508. {
  509. get { return instanceParms; }
  510. set { instanceParms = value; }
  511. }
  512. internal bool IsEmpty()
  513. {
  514. return Utility.CollectionEmpty( descriptions ) &&
  515. Utility.StringEmpty( instanceParms ) &&
  516. ( null == overviewDoc || overviewDoc.IsEmpty() );
  517. }
  518. public override bool SerializeMode
  519. {
  520. get { return base.SerializeMode; }
  521. set
  522. {
  523. if( null != overviewDoc )
  524. {
  525. overviewDoc.SerializeMode = value;
  526. }
  527. base.SerializeMode = value;
  528. }
  529. }
  530. }
  531. public class OverviewDoc : UddiCore
  532. {
  533. private string overviewUrl;
  534. private DescriptionCollection descriptions;
  535. [XmlElement("description")]
  536. public DescriptionCollection Descriptions
  537. {
  538. get
  539. {
  540. if( true == SerializeMode &&
  541. Utility.CollectionEmpty( descriptions ) )
  542. {
  543. return null;
  544. }
  545. if( null == descriptions )
  546. {
  547. descriptions = new DescriptionCollection();
  548. }
  549. return descriptions;
  550. }
  551. set { descriptions = value; }
  552. }
  553. [XmlElement("overviewURL")]
  554. public string OverviewUrl
  555. {
  556. get { return overviewUrl; }
  557. set { overviewUrl = value; }
  558. }
  559. internal bool IsEmpty()
  560. {
  561. return Utility.StringEmpty( overviewUrl ) &&
  562. Utility.CollectionEmpty( descriptions );
  563. }
  564. }
  565. public class TModelCollection : CollectionBase
  566. {
  567. public TModel this[int index]
  568. {
  569. get { return (TModel)List[index]; }
  570. set { List[index] = value; }
  571. }
  572. public int Add(TModel tModel)
  573. {
  574. return List.Add(tModel);
  575. }
  576. public int Add( string tModelKey )
  577. {
  578. return List.Add( new TModel( tModelKey ) );
  579. }
  580. public void Insert(int index, TModel value)
  581. {
  582. List.Insert(index, value);
  583. }
  584. public int IndexOf(TModel value)
  585. {
  586. return List.IndexOf(value);
  587. }
  588. public bool Contains(TModel value)
  589. {
  590. return List.Contains(value);
  591. }
  592. public void Remove(TModel value)
  593. {
  594. List.Remove(value);
  595. }
  596. public void CopyTo(TModel[] array, int index)
  597. {
  598. InnerList.CopyTo(array, index);
  599. }
  600. public new TModelEnumerator GetEnumerator()
  601. {
  602. return new TModelEnumerator( List.GetEnumerator() );
  603. }
  604. }
  605. public sealed class TModelEnumerator : IEnumerator
  606. {
  607. private IEnumerator enumerator;
  608. public TModelEnumerator( IEnumerator enumerator )
  609. {
  610. this.enumerator = enumerator;
  611. }
  612. public TModel Current
  613. {
  614. get { return ( TModel ) enumerator.Current; }
  615. }
  616. object IEnumerator.Current
  617. {
  618. get{ return enumerator.Current; }
  619. }
  620. public bool MoveNext()
  621. {
  622. return enumerator.MoveNext();
  623. }
  624. public void Reset()
  625. {
  626. enumerator.Reset();
  627. }
  628. }
  629. public class TModelInfoCollection : CollectionBase
  630. {
  631. public TModelInfo this[int index]
  632. {
  633. get { return (TModelInfo)List[index]; }
  634. set { List[index] = value; }
  635. }
  636. public int Add( string tModelKey, string name )
  637. {
  638. return List.Add( new TModelInfo( tModelKey, name ) );
  639. }
  640. public int Add(TModelInfo tModelInfo)
  641. {
  642. return List.Add(tModelInfo);
  643. }
  644. public void Insert(int index, TModelInfo value)
  645. {
  646. List.Insert(index, value);
  647. }
  648. public int IndexOf(TModelInfo value)
  649. {
  650. return List.IndexOf(value);
  651. }
  652. public bool Contains(TModelInfo value)
  653. {
  654. return List.Contains(value);
  655. }
  656. public void Remove(TModelInfo value)
  657. {
  658. List.Remove(value);
  659. }
  660. public void CopyTo(TModelInfo[] array, int index)
  661. {
  662. List.CopyTo(array, index);
  663. }
  664. public new TModelInfoEnumerator GetEnumerator()
  665. {
  666. return new TModelInfoEnumerator( List.GetEnumerator() );
  667. }
  668. }
  669. public sealed class TModelInfoEnumerator : IEnumerator
  670. {
  671. private IEnumerator enumerator;
  672. public TModelInfoEnumerator( IEnumerator enumerator )
  673. {
  674. this.enumerator = enumerator;
  675. }
  676. public TModelInfo Current
  677. {
  678. get { return ( TModelInfo ) enumerator.Current; }
  679. }
  680. object IEnumerator.Current
  681. {
  682. get{ return enumerator.Current; }
  683. }
  684. public bool MoveNext()
  685. {
  686. return enumerator.MoveNext();
  687. }
  688. public void Reset()
  689. {
  690. enumerator.Reset();
  691. }
  692. }
  693. public class TModelInstanceInfoCollection : CollectionBase
  694. {
  695. public TModelInstanceInfo this[int index]
  696. {
  697. get { return (TModelInstanceInfo)List[index]; }
  698. set { List[index] = value; }
  699. }
  700. public int Add(TModelInstanceInfo tModelInstanceInfo)
  701. {
  702. return List.Add(tModelInstanceInfo);
  703. }
  704. public void Insert( int index, TModelInstanceInfo tModelInstanceInfo )
  705. {
  706. List.Insert(index, tModelInstanceInfo );
  707. }
  708. public int IndexOf(TModelInstanceInfo value)
  709. {
  710. return List.IndexOf(value);
  711. }
  712. public bool Contains(TModelInstanceInfo value)
  713. {
  714. return List.Contains(value);
  715. }
  716. public void Remove(TModelInstanceInfo value)
  717. {
  718. List.Remove(value);
  719. }
  720. public void CopyTo(TModelInstanceInfo[] array, int index)
  721. {
  722. List.CopyTo(array, index);
  723. }
  724. public new TModelInstanceInfoEnumerator GetEnumerator()
  725. {
  726. return new TModelInstanceInfoEnumerator( List.GetEnumerator() );
  727. }
  728. }
  729. public sealed class TModelInstanceInfoEnumerator : IEnumerator
  730. {
  731. private IEnumerator enumerator;
  732. public TModelInstanceInfoEnumerator( IEnumerator enumerator )
  733. {
  734. this.enumerator = enumerator;
  735. }
  736. public TModelInstanceInfo Current
  737. {
  738. get { return ( TModelInstanceInfo ) enumerator.Current; }
  739. }
  740. object IEnumerator.Current
  741. {
  742. get{ return enumerator.Current; }
  743. }
  744. public bool MoveNext()
  745. {
  746. return enumerator.MoveNext();
  747. }
  748. public void Reset()
  749. {
  750. enumerator.Reset();
  751. }
  752. }
  753. }