26 new messages in 15 topics - digest


== 1 of 2 ==
Date: Fri, May 9 2008 5:52 am
From: Gidi


Hi Again,

i found the PageScale property, and as i understand it changes my page size
(in my case it's 70% smaller).

the problem is that if i use it, it doesn't effect the font size or the
image size that i'm drawing(printing).

is that mean that i have to have 2 different class, one for printing my
document in A4 Size and the second to print it 70% smaller?

thanks,
Gidi.

"Morten Wennevik [C# MVP]" wrote:

> Hi Gidi,
>
> I haven't tested it, but in your printing code I believe you should be able
> to adjust the Graphics object to scale down to 70% the normal size, which
> would cause the printed output to be reduced to 70% as well.
>
> --
> Happy Coding!
> Morten Wennevik [C# MVP]
>
>
> "Gidi" wrote:
>
> > Hi,
> >
> > I've a document which i'm creating and printing.
> > i want to print 2 copies:
> >
> > 1. regular A4 copy
> > 2. 70% of A4 size (like in copy machine, where you can choose the size of
> > copy).
> >
> > how can i do that?
> >
> >
> > thanks,
> > Gidi.




== 2 of 2 ==
Date: Fri, May 9 2008 10:45 am
From: "Peter Duniho"


On Fri, 09 May 2008 05:52:01 -0700, Gidi <shnapsi@hotmail.com.dontspam>
wrote:

> i found the PageScale property, and as i understand it changes my page
> size
> (in my case it's 70% smaller).

If you're talking about the Graphics.PageScale property, it doesn't
exactly change your page size.  It changes the scaling between "world
coordinates" and "page units".  This is probably not exactly what you want
because...

> the problem is that if i use it, it doesn't effect the font size or the
> image size that i'm drawing(printing).

Right, because those things carry with them their own units that are
applied independently.  I think that there may be some way to adjust how
those are drawn.  However, there's a simpler way.  Use the
Graphics.ScaleTransform() method instead.  This works similarly to how the
PageScale property does, but should apply equally to _all_ graphics
rendered.

> is that mean that i have to have 2 different class, one for printing my
> document in A4 Size and the second to print it 70% smaller?

Whether you need two different classes depends on how you've designed your
code.  It's entirely possible to design a single class such that it allows
you to specify scaling that's applied when it draws its graphics.  Whether
you follow that approach or use two different classes is up to you.

Pete





==============================================================================
TOPIC: inherited class instead of expected class in interface implementation
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/f686e4acbcaa1ca0?hl=en
==============================================================================

== 1 of 3 ==
Date: Fri, May 9 2008 6:21 am
From: parez


Why should the following not compile? ( it does not)

interface ISomething
{

        Apples a {get;set;}
}


public class  ChilieanApples:Apples
{
}

public class  Apples
{
}


Class SomethingSpecific:ISomething
{
  public ChilieanApples  apples {get;set;}
}






== 2 of 3 ==
Date: Fri, May 9 2008 6:38 am
From: "Jon Skeet [C# MVP]"


On May 9, 2:21 pm, parez <psaw...@gmail.com> wrote:
> Why should the following not compile? ( it does not)

Because C# doesn't support covariance of return types in terms for
interface implementation and member overriding. To override/implement
something, you have to supply exactly the same signature.

It's a pain, but that's the way it is.

Jon




== 3 of 3 ==
Date: Fri, May 9 2008 8:26 am
From: parez


On May 9, 9:38 am, "Jon Skeet [C# MVP]" <sk...@pobox.com> wrote:
> On May 9, 2:21 pm, parez <psaw...@gmail.com> wrote:
>
> > Why should the following not compile? ( it does not)
>
> Because C# doesn't support covariance of return types in terms for
> interface implementation and member overriding. To override/implement
> something, you have to supply exactly the same signature.
>
> It's a pain, but that's the way it is.
>
> Jon

Thanks.
I thought I  mite have missed something because i expected it to
compile.






==============================================================================
TOPIC: CHINA WHOLESALE THROW JERSEY WOMEN 'S JERSEY THROWBACK 2008 NFL JERSEY
'S
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/811af752934810ef?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 6:25 am
From: nflstore82@yahoo.com.cn


--------------------WWW.JERSEYNFLSTORE.CN---------------------
 jersey,supply,NFL,MLB,NBA,NHL SuperBowl NFL jersey from wholesale NFL
NBA MLB NHL Jerseys.Soccer Jersey china supplier,nlf NBA Jersey





==============================================================================
TOPIC: Drawing xor line on picture box. HELP!
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/8c5df4848a7cb9c3?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 6:27 am
From: Chris Dunaway


On May 8, 1:11 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> On Thu, 08 May 2008 07:02:12 -0700, Chris Dunaway <dunaw...@gmail.com>
> wrote:
>
> > Have you looked at the ControlPaint.DrawReversibleLine method?
> > Perhaps that will do what you need.
>
> Interesting...I've never seen that class before.
>
> I'm a bit confused though; maybe you can elaborate on the purpose of that
> class.  All of the examples that I looked at in the class documentation
> show using the class to draw directly in a non-painting event handler.
> Normally this would be a major no-no, since drawing done in that context
> isn't persistent.
>
> So then I thought "well, maybe this is some special kind of drawing the
> ControlPaint class internally persists somehow".  But then I see the
> methods take a Graphics instance just like other drawing methods, and that
> seems to suggest ControlPaint's not doing anything other than adding some
> new features to Graphics (in fact, I suppose they might have been
> extension methods had extension methods been around when ControlPaint was
> designed).
>
> Are the examples bogus?  Or is there something more to ControlPaint than
> just adding some extra ways to draw to a Graphics instance?
>
> (Yeah, I could use Reflector and look myself, but I don't have Windows
> running at the moment and I figure it'd be better to ask someone who might
> have more practical experience with the class anyway).
>
> Pete

I'm afraid that I can't offer anything more than what you have learned
on your own.  I only suggested that class because I have seen the
original poster's question many times in various forums and that is,
invariably, the answer that is given.  I haven't delved too deeply
into the subject myself.

Chris





==============================================================================
TOPIC: How best can I create a panel which allows zoom on a drawing?
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/55d00fd49fad8b87?hl=en
==============================================================================

== 1 of 3 ==
Date: Fri, May 9 2008 6:41 am
From: Chris Dunaway


On May 9, 6:48 am, steve <s_j_b...@yahoo.com> wrote:
> I would like to create a panel, or other widget, on which I can draw,
> say, a triangle, and use the wheel on the mouse to zoom in and out on
> the drawing. A vector drawing.
>
> I know this can be done because I have seen apps that do this. They
> were 3D and I only need 2D but they were very fast.
>
> Is there an easy way to do this? Do I need to use the DirectX
> libraries to do this?
>
> Any pointer in the right direction would be very welcome and hopefully
> save me much time.
>
> Thanks,
>
> Steve

Check out this site:

http://www.bobpowell.net

and this link in particular:

http://www.bobpowell.net/zoompicbox.htm

Chris




== 2 of 3 ==
Date: Fri, May 9 2008 6:57 am
From: Marc Gravell


Not really, but you can embed WPF in WinForm (via ElementHost) and
WinForm in WPF (via WindowsFormsHost).

However, depending on the complexity, the zooming picturebox (that Chris
mentions) looks interesting.

Marc




== 3 of 3 ==
Date: Fri, May 9 2008 8:23 am
From: steve



thanks, I will have to play around with it a bit to see how it would
work for what I want.

Steve



On Fri, 9 May 2008 06:41:43 -0700 (PDT), Chris Dunaway
<dunawayc@gmail.com> wrote:

>On May 9, 6:48 am, steve <s_j_b...@yahoo.com> wrote:
>> I would like to create a panel, or other widget, on which I can draw,
>> say, a triangle, and use the wheel on the mouse to zoom in and out on
>> the drawing. A vector drawing.
>>
>> I know this can be done because I have seen apps that do this. They
>> were 3D and I only need 2D but they were very fast.
>>
>> Is there an easy way to do this? Do I need to use the DirectX
>> libraries to do this?
>>
>> Any pointer in the right direction would be very welcome and hopefully
>> save me much time.
>>
>> Thanks,
>>
>> Steve
>
>Check out this site:
>
>http://www.bobpowell.net
>
>and this link in particular:
>
>http://www.bobpowell.net/zoompicbox.htm
>
>Chris





==============================================================================
TOPIC: What classes do I use to create a web proxy
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/8e50629346f9aad0?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 6:59 am
From: "Alberto Poblacion"


Take a look at the System.Net.Sockets namespace.
You could use a TcpListener object to listen for requests from the desktop
application, and a TcpClient (or easier: a WebRequest object) to connect to
the original web server.

However, there might be an easier way: You could use an asp.net application
hosted in IIS to receive the requests from your client. An Http Handler in
your application would process all requests, and use the WebClient class to
send the same requests to the original webserver. This would save you from
programming all the multithreading that you would need to add into your code
if you were using a TcpListener to process mutiple client requests.

You say that you "do not want to create a web service proxy nor do I want to
do anything with web services". However, this route that you don't want to
follow might be the easiest of them all. If all the requests from your
desktop client are calls into a web service, you can probably, with a bit of
work, use asp.net web services to emulate the services in the original
server, and also use the web service client in .Net to call into the server.


"Peter" <pepaltavista@yahoo.co.uk> wrote in message
news:27fcdd18-2d14-4a6f-ac32-8435ab2ead32@y38g2000hsy.googlegroups.com...
> Firstly let me be very clear about this, I do not want to create a web
> service proxy nor do I want to do anything with web services.
>
> Basically, I have a shrink wrapped desktop application which downloads
> data from a web site. Unfortunately the application has a fixed
> timeout and the web server regularly exceeds this, causing the
> application to shut the connection and subsequently not receive any
> data. The desktop application also uploads data to the web server but
> this does not suffer from timeout problems.
>
> Changing the desktop or web serve application is not an option.
>
> So I need to create a lightweight proxy that can sit between the
> desktop and web server applications. The proxy needs to operate in 3
> modes. The 1st mode would download the data from the web server to
> persistent storage and the 2nd mode of the proxy would serve this data
> from persistent storage to the desktop application. To complicate
> matters a little more, the 3rd mode must be able to operate as a
> transparent proxy, merely accepting the data fromthe desktop
> application and passing it on to the web server.
>
> So I think that I simply need to be able to request the data from the
> web server and provide a web server interface to the desktop
> application. I know how to do this quickly in Java but have no idea
> where to start with dotnet. The documentation in MSDN is somewhat
> overwhelming at the moment.
>
> Can anyone please give me a pointer to the classes that I would need
> to do this. Of course I may also be off target here, so if I need to
> use Visual C++ instead of C#, then please point that out.
>
> TIA, Peter






==============================================================================
TOPIC: How to access a run time generated PictureBox on the form
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/94fd6070f5e86193?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, May 9 2008 7:12 am
From: "Jim McGivney"


Thanks for your help.  Could you possibly show me some code (syntax) that I
can use to make my pictureBox array an instance member using the code in my
posting.  Thanks for your help,
Jim


"Jim McGivney" <mcgivney@winid.com> wrote in message
news:05F78C94-A0D9-440B-8C06-711ABEEF23F2@microsoft.com...
> In C# on Form1 I genetate an array of PictureBoxes and populate each with
> an image as seen in the code below.
> Later on I want to access a specific PictureBox to change its image,  but
> I keep getting the error "The name 'PictureBox1' does not exist in the
> current context"
> The code I use to try to access the PictureBox is
> "PictureBox1[Target].Image = HoldBitMap; "  where kount is an integer.
> I know the answer is probably in using the Controls collection but I can't
> get the syntax correct.
> Thanks in advance for your help.
> Jim
>
>
>        private void InitializePictureBox()
>        {
>            //allocate the picture box
>            PictureBox[] PictureBox1 = new PictureBox[1000];
>            int i;
>            int j;
>            int kount = 0;
>            Random randObj = new Random(unchecked((int)
> (DateTime.Now.Ticks)));
>
>            //initialise each picture box
>            for(i=0; i<8; i++)
>            {
>                for (j = 0; j < 6; j++)
>                {
>                    PictureBox1[kount] = new PictureBox();
>
>                    // Set the location and size of the PictureBox control.
>                    PictureBox1[kount].Location = new
> System.Drawing.Point(100 * i, 100 * j);
>                    PictureBox1[kount].Size = new System.Drawing.Size(99,
> 99);
>                    PictureBox1[kount].TabStop = false;
>
>                    // Set the SizeMode property to the StretchImage value.
> This
>                    // will shrink or enlarge the image as needed to fit
> into
>                    // the PictureBox.
>                    PictureBox1[kount].SizeMode = PictureBoxSizeMode.Zoom;
> //    .StretchImage;
>
>                    // Set the border style to a three-dimensional border.
>                    PictureBox1[kount].BorderStyle = BorderStyle.Fixed3D;
>
>                    //Wire the picture boxes click to new common click
> handler.
>                    PictureBox1[kount].Click += new
> System.EventHandler(ClickHandler);
>                    PictureBox1[kount].Tag = kount;
>                    // Add the PictureBox to the form.
>                    Controls.Add(PictureBox1[kount]);
>                    // Add the image
>                    PictureBox1[kount].Image = MakeBitMap();
>                    kount++;
>                }
>            }
>        }





== 2 of 2 ==
Date: Fri, May 9 2008 7:25 am
From: Marc Gravell


Simply move it outside of the method.
For the record, I'd probably use a List<PitureBox> rather than a
PictureBox[] so that I can resize it more easily...

Marc


// declare the field
PictureBox[] PictureBox1;

private void InitializePictureBox()
{
    //allocate the picture box
    PictureBox1 = new PictureBox[1000];

    // ...
}





==============================================================================
TOPIC: namespaces
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/1ac534761e857fce?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 7:38 am
From: "clintonG"


Get the tattoo:
THE MOST READABLE CODE WINS.

"Tem" <tem1232@yahoo.com> wrote in message
news:OqplAnZsIHA.4392@TK2MSFTNGP03.phx.gbl...
> "The scope of a namespace member declared by a namespace-member-
> declaration within a namespace-declaration whose fully qualified name
> is N, is the namespace-body of every namespace-declaration whose fully
> qualified
> name is N or starts with N, followed by a period."
>
> so which one is better? or perferred?
>
>
> "Brian Gideon" <briangideon@yahoo.com> wrote in message
> news:f4cde640-6059-489b-a3ec-b5e6c455d5a1@l42g2000hsc.googlegroups.com...
> On May 6, 3:11 am, "Tem" <tem1...@yahoo.com> wrote:
>> Are these equivalent?
>>
>> ------------------
>> using System;
>>
>> namespace SomeNamespace
>> {
>>
>> }
>>
>> -------------------
>> namespace SomeNamespace
>> {
>> using System;
>>
>>
>>
>> }
>
> In that particular case, yes.  But, like Jon said, it can make a
> difference.  I discovered this oddity and posted it in this group
> quite some time ago hoping someone could point me to the section in
> the specification that discusses it.  I did some scouring of my own
> and I believe the crucial section is 10.7 (ECMA) where it says:
>
> "The scope of a namespace member declared by a namespace-member-
> declaration within a namespace-declaration whose fully qualified name
> is N, is the
> namespace-body of every namespace-declaration whose fully qualified
> name is N
> or starts with N, followed by a period."
>
> Clear as mud huh?






==============================================================================
TOPIC: movie
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/1f67c7bc6adb94fa?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 7:54 am
From: lavrey-2@mail.ru


http://watch-me.890m.com





==============================================================================
TOPIC: Threads and Exceptions
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/d39df2bc2eacbcf4?hl=en
==============================================================================

== 1 of 6 ==
Date: Fri, May 9 2008 7:57 am
From: DaveC


I am trying to use a ssh stream reader that has no timeout method. It
simply watches the stream until an escape character appears in the
stream. It then returns the contents of the buffer. Thus, when the
server never responds to a read action (no escape character appears in
the stream), the program appears hung while the thread is waiting for
a stream character that never comes.

To solve this, I issue the stream read inside of a 'try' block with a
catch for a custom exception. Just before the call to the stream
reader, I launch a watchdog function with its own thread. The watchdog
sleeps for 3 seconds and then checks the buffer (passed in by
reference) to see if it is still empty. If it is empty, it throws the
customer exception and pulls the main thread back to the catch portion
of the try.

This sounds good, but isn't working. When the exception throws in the
watchdog thread, it is treated like an unhandled exception even tho
the thread was launched from inside of a 'try' that has an explicit
handler for that exception.

In the code snippet below, as part of my efforts to figure this out, I
have the watchdog throw an exception for either condition of the read
stream. If the stream has something in it, one exception is thrown,
and if the stream buffer is still empty another exception is thrown.
Again, both are treated as unhandled even tho the function was launced
with its own thread from inside the 'try' block.

How can I get these exceptions to be handled by the 'try' block catch
blocks?

Dave

snippet:

try
           {
               Thread thd_watchdog = new Thread(delegate()
{ Read_Watchdog(ref response, 200); });
               thd_watchdog.Start();
               response = ssh.ReadResponse();
           }
           catch (ExpireException)
           {   return "Error opening SSH stream to " + proxyServer; }
           catch (ClearException)
           {   return "Success opening SSH stream to " +
proxyServer; }


private ParameterizedThreadStart Read_Watchdog(ref string response,
int i_timer)
       {
           Thread.Sleep(i_timer);
           if (response.Length > 0)
               throw new ClearException();
           else
               throw new ExpireException();
       }




== 2 of 6 ==
Date: Fri, May 9 2008 8:24 am
From: parez


This is what i noticed in a .net 1.1 app.

you have to try catch within the function that the thread executes. if
you dont have  a try catch in the function then you dont get notified
about the unhandled exception.
Dont know if things have changed since then.

DaveC wrote:
> I am trying to use a ssh stream reader that has no timeout method. It
> simply watches the stream until an escape character appears in the
> stream. It then returns the contents of the buffer. Thus, when the
> server never responds to a read action (no escape character appears in
> the stream), the program appears hung while the thread is waiting for
> a stream character that never comes.
>
> To solve this, I issue the stream read inside of a 'try' block with a
> catch for a custom exception. Just before the call to the stream
> reader, I launch a watchdog function with its own thread. The watchdog
> sleeps for 3 seconds and then checks the buffer (passed in by
> reference) to see if it is still empty. If it is empty, it throws the
> customer exception and pulls the main thread back to the catch portion
> of the try.
>
> This sounds good, but isn't working. When the exception throws in the
> watchdog thread, it is treated like an unhandled exception even tho
> the thread was launched from inside of a 'try' that has an explicit
> handler for that exception.
>
> In the code snippet below, as part of my efforts to figure this out, I
> have the watchdog throw an exception for either condition of the read
> stream. If the stream has something in it, one exception is thrown,
> and if the stream buffer is still empty another exception is thrown.
> Again, both are treated as unhandled even tho the function was launced
> with its own thread from inside the 'try' block.
>
> How can I get these exceptions to be handled by the 'try' block catch
> blocks?
>
> Dave
>
> snippet:
>
> try
>             {
>                 Thread thd_watchdog = new Thread(delegate()
> { Read_Watchdog(ref response, 200); });
>                 thd_watchdog.Start();
>                 response = ssh.ReadResponse();
>             }
>             catch (ExpireException)
>             {   return "Error opening SSH stream to " + proxyServer; }
>             catch (ClearException)
>             {   return "Success opening SSH stream to " +
> proxyServer; }
>
>
> private ParameterizedThreadStart Read_Watchdog(ref string response,
> int i_timer)
>         {
>             Thread.Sleep(i_timer);
>             if (response.Length > 0)
>                 throw new ClearException();
>             else
>                 throw new ExpireException();
>         }




== 3 of 6 ==
Date: Fri, May 9 2008 8:33 am
From: "Jon Skeet [C# MVP]"


On May 9, 3:57 pm, DaveC <davec...@gmail.com> wrote:

<snip>

> How can I get these exceptions to be handled by the 'try' block catch
> blocks?

An exception can only be caught in the thread which throws it. In
other words, if you want a particular "catch" block to execute, you
need to move that into the code executed in the other thread.

Jon




== 4 of 6 ==
Date: Fri, May 9 2008 9:21 am
From: DaveC


Ouch... the whole basis of my approach is that one thread could watch
and use an exception to interrupt another thread that was not
performing well.

Could I name my main() thread and then have the watchdog thread throw
the exception on the main thread instead of its own thread?

What would the code for that even look like?

throw new Thread.Threads("main").ClearException();  //complete and
total WAG

- OR -

Should I be using some other mechanism to watchdog and break the hung
stream read?

Dave



On May 9, 10:33 am, "Jon Skeet [C# MVP]" <sk...@pobox.com> wrote:
> On May 9, 3:57 pm, DaveC <davec...@gmail.com> wrote:
>
> <snip>
>
> > How can I get these exceptions to be handled by the 'try' block catch
> > blocks?
>
> An exception can only be caught in the thread which throws it. In
> other words, if you want a particular "catch" block to execute, you
> need to move that into the code executed in the other thread.
>
> Jon





== 5 of 6 ==
Date: Fri, May 9 2008 10:36 am
From: "Peter Duniho"


On Fri, 09 May 2008 09:21:17 -0700, DaveC <davecove@gmail.com> wrote:

> Ouch... the whole basis of my approach is that one thread could watch
> and use an exception to interrupt another thread that was not
> performing well.
>
> Could I name my main() thread and then have the watchdog thread throw
> the exception on the main thread instead of its own thread?

No.  The rule about catching an exception only from the thread in which it
was thrown is absolute.  You can't inject an arbitrary exception into some
other thread.

However...

> [...]
> Should I be using some other mechanism to watchdog and break the hung
> stream read?

Since you didn't post much detail in your actual code, I can't say for
sure.  But generally speaking, you can cause an exception on a thread
that's blocked on an i/o operation by closing the i/o object on which the
operation was started.  Depending on the type of "ssh", you could probably
call "ssh.Close()" in your "watchdog" thread to cause an exception.

Note, however, that however you do this, you have a race condition in
which your watchdog thread could wind up closing the i/o object just
_after_ it successfully returned but before it was able to assign the
result to your "response" variable.  This may or may not be an issue for
you.

Finally, note that you don't get to pick the exception that's thrown.  So
your code would use the exception to detect the exceptional case (which is
as it should be anyway), and the lack of an exception would indicate
success.

Pete




== 6 of 6 ==
Date: Fri, May 9 2008 10:44 am
From: "Peter Bromberg [C# MVP]"


An alternative might be to make the action "timeout-able". Here's a short
article with some sample code:
http://www.eggheadcafe.com/tutorials/aspnet/847c94bf-4b8d-4a66-9ae5-5b61f049019f/basics-make-any-method-c.aspx
--Peter

"DaveC" <davecove@gmail.com> wrote in message
news:77826a82-d8bc-4e39-b6ff-78ace73a00cc@f36g2000hsa.googlegroups.com...
Ouch... the whole basis of my approach is that one thread could watch
and use an exception to interrupt another thread that was not
performing well.

Could I name my main() thread and then have the watchdog thread throw
the exception on the main thread instead of its own thread?

What would the code for that even look like?

throw new Thread.Threads("main").ClearException();  //complete and
total WAG

- OR -

Should I be using some other mechanism to watchdog and break the hung
stream read?

Dave



On May 9, 10:33 am, "Jon Skeet [C# MVP]" <sk...@pobox.com> wrote:
> On May 9, 3:57 pm, DaveC <davec...@gmail.com> wrote:
>
> <snip>
>
> > How can I get these exceptions to be handled by the 'try' block catch
> > blocks?
>
> An exception can only be caught in the thread which throws it. In
> other words, if you want a particular "catch" block to execute, you
> need to move that into the code executed in the other thread.
>
> Jon






==============================================================================
TOPIC: simple logging in a C# COM DLL
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/9b40554d5d28f69f?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 9:51 am
From: wurzelCidermaker


I have created a very simple C# class library (DLL).

I have ticked the "Register for COM interop" option in the project
properties dialog.

I have made the [assembly: ComVisible(true)] in the AssemblyInfo.cs file.

I can call a public method in this library from VBScript.

So far so good, now I'd like to have some very *simple* loggging capability.

For other applications I've gone down the [log4net] route and rolled by own
loggers etc...etc.

For this tiny DLL, I'd like to have for example the option to just drop a
[myDll.dll.config] file into the same directory as the DLL and add a trace
listener that outputs to a file or optionally roll my own trace listener
(i.e. udp).

I've successfully done things with trace listeners, but cannot get the DLL
to pick up the custom trace listener config file.

I've tried various names for the config file, but no joy.

Any suggestions?

Is it because I'm calling it from a VBScript file and not a .NET application?





==============================================================================
TOPIC: Opacity on MDI Child Form
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/0052c410264b1a89?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 9:58 am
From: Frank Uray


Hi all

I have a MDI Container with a Form as MDI Child.
Now I want to set the Opacity on this child form
but it does not work ...

Does somebody know how to do this ??

Thanks for any comments

Regards
Frank Uray





==============================================================================
TOPIC: Evaluating numeric expressions
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/8f6d40de7fb368a9?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 10:03 am
From: Frank Uray


Maybe you can try with RegularExpressions

string local_pattern = @"[^0-9]";
System.Text.RegularExpressions.Regex local_RegEx = new
System.Text.RegularExpressions.Regex(local_pattern);
return local_RegEx.Replace(local_InputString, "");



"PatrickS" wrote:

> Is there an easy way in C# to take a string that contains an expression, say
> for example something like '(10 / 2) + 1' and evaluate it without having to
> parse the string myself and muck about with other stuff like operator
> precedence?





==============================================================================
TOPIC: Using a namespace between 2 partial classes
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/a4261d7f00cdb1ff?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 10:28 am
From: "Peter Duniho"


On Fri, 09 May 2008 03:50:00 -0700, <Peted> wrote:

> im using c# vs2008
>
> is it possible to define two partial classes in two different named
> code modules in this case the class and its attched designer class,
> and have a using statement at the top of the main class that allows
> access to a 3rd class/control/dll etc etc
>
> if i have the using statment at the top of the main class is it
> possible to have that using statement used in a partial class there,
> and have the using statment propogate through to the partial class in
> the designer code that is auto generated, so that referenced objects
> can also be called by code in the designer

If I understand your question correctly, the answer is "no".  The "using"
directive applies only to the code file being compiled.

If you can explain more specifically how it is you'd think the
Designer-generated code file would use your other assembly reference, it's
possible that someone could come up with a different idea for solving
whatever problem you're trying to address.  For example, how is it that
you'd expect the Designer-generated code file to even be aware of this
other assembly?  What action in the Designer would you take that would
cause the Designer-generated code to use the other assembly?

Pete





==============================================================================
TOPIC: Using MS SQL Express in my C# App
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/19f9377dbede22ad?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 10:48 am
From: "Peter Bromberg [C# MVP]"


As long as your application doesn't require the use of stored procedures,
you might want to consider shipping your app with SQL Server Compact 3.5
edition. It can be deployed by simply including the 7 required assemblies
and your database "SDF" file with your app; no special installation is
required. It also takes up *Way* less space.
--Peter
"Todd Carnes" <toddcarnes@gmail.com> wrote in message
news:g007oj$u6$1@aioe.org...
> I'm writing my first app that uses SQL Express to store a bunch of user
> data (vice using a simple txt file, etc.), but I have a question that you
> guys who've been doing this a while will probably laugh at.
>
> Once I've completed my app, will I have to ship SQL Express with my app in
> order for people to use my program?
>
> Todd




No comments: