473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Using using to make name references shorter--how?

Please consider the below and how to make name references shorter--
there has to be a way.

RL

using System;

namespace MyNamesSpace1
{
class ManagerClass
{
int i;
MyNamesSpace1.Form4.InteriorClass myCl_MF4IC; //shorter way?
public ManagerClass()
{
i = 0;
myCl_MF4IC = new MyNamesSpace1.Form4.InteriorClass(); //shorter way?
}

}
}

How to avoid having to type “MyNamesSpace1.Form4.” before the type
name “InteriorClass” when referencing the member class and/or member
member, myCl_MF4IC?

InteriorClass is a class (not nested) that appears inside of Form4,
which is a form (i.e. a class) to the main form, Form1 of the same
namespace, MyNamesSpace1.
Sep 4 '08 #1
4 1515
I took your subject line to indicate you knew the answer, but if you
didn't...

using ic = MyNamesSpace1.Form4.InteriorClass;

then in code,

ic myCI_MF4IC;

"raylopez99" <ra********@yahoo.comwrote in message
news:f1**********************************@p25g2000 hsf.googlegroups.com...
Please consider the below and how to make name references shorter--
there has to be a way.

RL

using System;

namespace MyNamesSpace1
{
class ManagerClass
{
int i;
MyNamesSpace1.Form4.InteriorClass myCl_MF4IC; //shorter way?
public ManagerClass()
{
i = 0;
myCl_MF4IC = new MyNamesSpace1.Form4.InteriorClass(); //shorter way?
}

}
}

How to avoid having to type “MyNamesSpace1.Form4.” before the type
name “InteriorClass” when referencing the member class and/or member
member, myCl_MF4IC?

InteriorClass is a class (not nested) that appears inside of Form4,
which is a form (i.e. a class) to the main form, Form1 of the same
namespace, MyNamesSpace1.
Sep 4 '08 #2
On Sep 4, 6:30 pm, "Family Tree Mike"
<FamilyTreeM...@ThisOldHouse.comwrote:
using ic = MyNamesSpace1.Form4.InteriorClass;

then in code,

ic myCI_MF4IC;
I know each person is different, but to me, looking at the second line
of code makes me ask : "What is ic?" I don't think I'd shorten it
quite that much. I think I'd probably use something like this:

using f4 = MyNameSpace1.Form4;

and then

f4.InteriorClass myCl_MF4IC;

Cheers,

Chris
Sep 5 '08 #3
I agree with you, but I wanted to show an extreme example....

"Chris Dunaway" <du******@gmail.comwrote in message
news:88**********************************@j22g2000 hsf.googlegroups.com...
On Sep 4, 6:30 pm, "Family Tree Mike"
<FamilyTreeM...@ThisOldHouse.comwrote:
>using ic = MyNamesSpace1.Form4.InteriorClass;

then in code,

ic myCI_MF4IC;

I know each person is different, but to me, looking at the second line
of code makes me ask : "What is ic?" I don't think I'd shorten it
quite that much. I think I'd probably use something like this:

using f4 = MyNameSpace1.Form4;

and then

f4.InteriorClass myCl_MF4IC;

Cheers,

Chris
Sep 6 '08 #4
On Sep 6, 9:30*am, "Family Tree Mike"
<FamilyTreeM...@ThisOldHouse.comwrote:
Thanks FTM. I did not know the answer, and could not find it in any
book, until you posted. I'll make note of this in my notebook.

RL
Sep 6 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Daniel | last post by:
how to make two references to one string that stay refered to the same string reguardless of the changing value in the string?
2
by: John Holmes | last post by:
I am using radioButton controls in a data repeater and would like to incorporate the 'key' field into the 'id' attribute of the radioButton controls and name them something like: 'rad' + '<%#...
3
by: B-Dog | last post by:
I'm capturing the checked radio button to XML file using the name of the radio button. I want to read my xml file to find which button was checked on close and the check the appropriate button...
8
by: Sameh Ahmed | last post by:
Hello there I need to get a list of domain controllers to a domain I bind too using it's name rather than the DN. I am trying a query looking for objectClass=nTDSDSA but this returns 0 results I...
1
by: kalyson | last post by:
Hello, I realize that using the TYPE declaration for variables makes their definitions more dynamic, like this: myField tablename.name%TYPE; myRow tablename%ROWTYPE; ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.