<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 14"><meta name="Originator" content="Microsoft Word 14"><link rel="File-List" href="file:///C:%5CUsers%5CVivek%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"><link rel="themeData" href="file:///C:%5CUsers%5CVivek%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"><link rel="colorSchemeMapping" href="file:///C:%5CUsers%5CVivek%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"><style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:swiss;
        mso-font-pitch:variable;
        mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-unhide:no;
        mso-style-qformat:yes;
        mso-style-parent:"";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        mso-bidi-font-size:10.5pt;
        font-family:"Arial","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-unhide:no;
        mso-style-locked:yes;
        mso-style-link:"Plain Text";
        mso-ansi-font-size:10.0pt;
        mso-bidi-font-size:10.5pt;
        font-family:"Arial","sans-serif";
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-default-props:yes;
        font-family:"Calibri","sans-serif";
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
div.WordSection1
        {page:WordSection1;}
-->
</style>

<p class="MsoPlainText">I think I haven&#39;t explained the issue well enough.</p>

<p class="MsoPlainText">Namespace aliases will not fix this, as mentioned before.</p>

<p class="MsoPlainText"> </p>

<p class="MsoPlainText">Here is a picture:</p>

<p class="MsoPlainText"> </p>

<p class="MsoPlainText">MyApp</p>

<p class="MsoPlainText">+ MonoMac.dll (reference)</p>

<p class="MsoPlainText"><span style="">   </span>+ System.Drawing.dll
(reference)</p>

<p class="MsoPlainText"><span style="">     </span>- System.Drawing.PointF</p>

<p class="MsoPlainText"><span style="">   </span><span style="">  </span>- MonoMac.CoreGraphics.CGContext</p>

<p class="MsoPlainText"><span style="">       </span>{</p>

<p class="MsoPlainText"><span style="">     </span><span style="">  </span><span style="">  </span><span style="">  </span>AddLines(System.Drawing.PointF[]);</p>

<p class="MsoPlainText"><span style="">       </span>}</p>

<p class="MsoPlainText"><span style="">     </span>-
System.Drawing.Graphics</p>

<p class="MsoPlainText"><span style="">      </span>{</p>

<p class="MsoPlainText"><span style="">        </span><span style="">  </span>void AddLines(System.Drawing.PointF[] points)</p>

<p class="MsoPlainText"><span style="">          </span>{</p>

<p class="MsoPlainText"><span style="">             </span>//
This implementation is broken on MonoMac, since winforms is not supported.</p>

<p class="MsoPlainText"><span style="">          </span>}</p>

<p class="MsoPlainText"><span style="">      </span>}</p>

<p class="MsoPlainText">+ Types exposed by MyApp</p>

<p class="MsoPlainText"><span style="">  </span>- System.Drawing.PointF</p>

<p class="MsoPlainText"><span style="">  </span>- System.Drawing.Graphics</p>

<p class="MsoPlainText"><span style=""> </span><span style="">  </span>{</p>

<p class="MsoPlainText"><span style="">   </span><span style="">  </span><span style=""> </span>private
CGContext CGContext {get; set;}</p>

<p class="MsoPlainText"><span style="">   </span><span style=""> </span><span style="">  </span>void AddLines(System.Drawing.PointF[]
points)</p>

<p class="MsoPlainText"><span style="">    </span><span style="">  </span>{</p>

<p class="MsoPlainText"><span style="">      </span><span style="">  </span><span style="">  </span>This.CGContext.AddLines(points);</p>

<p class="MsoPlainText"><span style="">    </span><span style="">  </span>}</p>

<p class="MsoPlainText"><span style=""> </span><span style="">  </span>}</p>

<p class="MsoPlainText"> </p>

<p class="MsoPlainText">Thus, our wrapper for Graphics.AddLines cannot use our
definition of PointF because</p>

<p class="MsoPlainText">CGContext expects the definition inside
System.Drawing.dll.</p>

<p class="MsoPlainText">But our wrapper also cannot use the definition inside
System.Drawing.dll because</p>

<p class="MsoPlainText">referencing that dll means we cannot have a wrapper by
that name to begin with,</p>

<p class="MsoPlainText">since the dll defines exactly the same wrapper.</p>

<p class="MsoPlainText"> </p>

<p class="MsoPlainText">The solution here is to not have these useless types included
by reference into MonoMac,</p>

<p class="MsoPlainText">and to follow what MonoTouch does and directly define Point,
Size, Rectangle, PointF, SizeF, RectangleF</p>

<p class="MsoPlainText">in MonoMac.dll. Then, our app would use these definitions
and the rest of the System.Drawing wrappers</p>

<p class="MsoPlainText">our app defines would work.</p>

<p class="MsoPlainText"> </p>

<p class="MsoPlainText">Net: This is a very simple fix to implement in MonoMac,
and MonoTouch already works this way.</p>

<p class="MsoPlainText"> </p>

<p class="MsoPlainText">Thanks</p>

<br><br><div class="gmail_quote">On Wed, Sep 8, 2010 at 11:22 AM, Lee V. Andrus <span dir="ltr">&lt;<a href="mailto:landrus2@by-rite.net">landrus2@by-rite.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Using directives can also be used to create aliases for specific types<br>
without exposing the whole namespace.  Like this:<br>
<br>
  using PointF = System.Drawing.PointF;<br>
<br>
I&#39;m sure it&#39;s a pain to put so much at the top of every file because<br>
C# doesn&#39;t have #include or typedef.  But this can reduce the solution<br>
to boilerplate.  You may even be able to incorporate it into your<br>
standard header.<br>
<br></blockquote></div>