PageRenderTime 57ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/ServiceMoniker.cs

http://github.com/mono/mono
C# | 186 lines | 138 code | 45 blank | 3 comment | 9 complexity | a8e4d8161acd9252eefc3b2bd11aa8cc MD5 | raw file
Possible License(s): GPL-2.0, CC-BY-SA-3.0, LGPL-2.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, Unlicense, Apache-2.0
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. namespace System.ServiceModel.ComIntegration
  5. {
  6. using System;
  7. using System.Runtime.InteropServices.ComTypes;
  8. using Microsoft.Win32;
  9. using System.Reflection;
  10. using System.Collections.Generic;
  11. using System.Threading;
  12. using System.Runtime.Remoting;
  13. using System.Runtime.Remoting.Services;
  14. using System.Diagnostics;
  15. using System.ServiceModel.Diagnostics;
  16. [System.Runtime.InteropServices.ComVisible(true)]
  17. [System.Runtime.InteropServices.Guid("CE39D6F3-DAB7-41b3-9F7D-BD1CC4E92399")]
  18. [MonikerProxyAttribute]
  19. public sealed class ServiceMoniker : ContextBoundObject
  20. {
  21. }
  22. internal sealed class ServiceMonikerInternal : ContextBoundObject, IMoniker, IParseDisplayName, IDisposable
  23. {
  24. void IDisposable.Dispose()
  25. {
  26. }
  27. public ServiceMonikerInternal()
  28. {
  29. PropertyTable = new Dictionary<MonikerHelper.MonikerAttribute, string>();
  30. }
  31. void IMoniker.GetClassID(out System.Guid clsid)
  32. {
  33. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  34. }
  35. int IMoniker.IsDirty()
  36. {
  37. return HR.S_FALSE;
  38. }
  39. void IMoniker.Load(IStream stream)
  40. {
  41. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  42. }
  43. void IMoniker.Save(IStream stream, bool isDirty)
  44. {
  45. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  46. }
  47. void IMoniker.GetSizeMax(out Int64 size)
  48. {
  49. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  50. }
  51. void IMoniker.BindToStorage(IBindCtx pbc, IMoniker pmkToLeft, ref Guid riid, out object ppvObj)
  52. {
  53. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  54. }
  55. void IMoniker.BindToObject(IBindCtx pbc, IMoniker pmkToLeft, ref Guid riidResult, IntPtr ppvResult)
  56. {
  57. ProxyBuilder.Build(PropertyTable, ref riidResult, ppvResult);
  58. }
  59. void IMoniker.Hash(IntPtr pdwHash)
  60. {
  61. if (IntPtr.Zero == pdwHash)
  62. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("pdwHash");
  63. System.Runtime.InteropServices.Marshal.WriteInt32(pdwHash, 0);
  64. }
  65. void IMoniker.CommonPrefixWith(IMoniker pmkOther,
  66. out IMoniker ppmkPrefix)
  67. {
  68. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  69. }
  70. void IMoniker.ComposeWith(IMoniker pmkRight, bool fOnlyIfNotGeneric, out IMoniker ppmkComposite)
  71. {
  72. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  73. }
  74. void IMoniker.Enum(bool fForward, out IEnumMoniker ppenumMoniker)
  75. {
  76. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  77. }
  78. void IMoniker.GetDisplayName(IBindCtx pbc, IMoniker pmkToLeft, out string ppszDisplayName)
  79. {
  80. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  81. }
  82. void IMoniker.GetTimeOfLastChange(IBindCtx pbc, IMoniker pmkToLeft, out FILETIME pFileTime)
  83. {
  84. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  85. }
  86. void IMoniker.Inverse(out IMoniker ppmk)
  87. {
  88. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  89. }
  90. int IMoniker.IsEqual(IMoniker pmkOtherMoniker)
  91. {
  92. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  93. }
  94. int IMoniker.IsRunning(IBindCtx pbc,
  95. IMoniker pmkToLeft,
  96. IMoniker pmkNewlyRunning)
  97. {
  98. return HR.S_FALSE;
  99. }
  100. int IMoniker.IsSystemMoniker(IntPtr pdwMksys)
  101. {
  102. if (IntPtr.Zero == pdwMksys)
  103. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("pdwMksys");
  104. System.Runtime.InteropServices.Marshal.WriteInt32(pdwMksys, 0);
  105. return HR.S_FALSE;
  106. }
  107. void IMoniker.ParseDisplayName(IBindCtx pbc,
  108. IMoniker pmkToLeft,
  109. string pszDisplayName,
  110. out int pchEaten,
  111. out IMoniker ppmkOut)
  112. {
  113. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  114. }
  115. void IMoniker.Reduce(IBindCtx pbc, int dwReduceHowFar, ref IMoniker ppmkToLeft, out IMoniker ppmkReduced)
  116. {
  117. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  118. }
  119. void IMoniker.RelativePathTo(IMoniker pmkOther, out IMoniker ppmkRelPath)
  120. {
  121. throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
  122. }
  123. void IParseDisplayName.ParseDisplayName(IBindCtx pbc, string pszDisplayName, IntPtr pchEaten, IntPtr ppmkOut)
  124. {
  125. if (IntPtr.Zero == ppmkOut)
  126. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("ppmkOut");
  127. System.Runtime.InteropServices.Marshal.WriteIntPtr(ppmkOut, IntPtr.Zero);
  128. if (IntPtr.Zero == pchEaten)
  129. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("pchEaten");
  130. if (string.IsNullOrEmpty(pszDisplayName))
  131. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("pszDisplayName");
  132. MonikerUtility.Parse(pszDisplayName, ref PropertyTable);
  133. ComPlusServiceMonikerTrace.Trace(TraceEventType.Verbose, TraceCode.ComIntegrationServiceMonikerParsed,
  134. SR.TraceCodeComIntegrationServiceMonikerParsed, PropertyTable);
  135. System.Runtime.InteropServices.Marshal.WriteInt32(pchEaten, pszDisplayName.Length);
  136. IntPtr ppv = InterfaceHelper.GetInterfacePtrForObject(typeof(IMoniker).GUID, this);
  137. System.Runtime.InteropServices.Marshal.WriteIntPtr(ppmkOut, ppv);
  138. }
  139. private Dictionary<MonikerHelper.MonikerAttribute, string> PropertyTable;
  140. }
  141. }