473,761 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.F orm4.InteriorCl ass myCl_MF4IC; //shorter way?
public ManagerClass()
{
i = 0;
myCl_MF4IC = new MyNamesSpace1.F orm4.InteriorCl ass(); //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 1544
I took your subject line to indicate you knew the answer, but if you
didn't...

using ic = MyNamesSpace1.F orm4.InteriorCl ass;

then in code,

ic myCI_MF4IC;

"raylopez99 " <ra********@yah oo.comwrote in message
news:f1******** *************** ***********@p25 g2000hsf.google groups.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.F orm4.InteriorCl ass myCl_MF4IC; //shorter way?
public ManagerClass()
{
i = 0;
myCl_MF4IC = new MyNamesSpace1.F orm4.InteriorCl ass(); //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.c omwrote:
using ic = MyNamesSpace1.F orm4.InteriorCl ass;

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.Fo rm4;

and then

f4.InteriorClas s 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******** *************** ***********@j22 g2000hsf.google groups.com...
On Sep 4, 6:30 pm, "Family Tree Mike"
<FamilyTreeM... @ThisOldHouse.c omwrote:
>using ic = MyNamesSpace1.F orm4.InteriorCl ass;

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.Fo rm4;

and then

f4.InteriorClas s myCl_MF4IC;

Cheers,

Chris
Sep 6 '08 #4
On Sep 6, 9:30*am, "Family Tree Mike"
<FamilyTreeM... @ThisOldHouse.c omwrote:
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
1644
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
1912
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' + '<%# (string)DataBinder.Eval(Container.DataItem, "ParcelID") %>' + PropType1 I think part of the problem is that intially there is no data bound to this repeater section. The data doesn't get built until the user clicks a button on the form and then...
3
3848
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 when for loads. How do I use a variable control name. This is what I'm trying to do below but of course it doesn't work, I'm rookie. Thanks Dim rbchecked as String
8
6265
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 am using VB.net 2.0 any ideas? Here's my code Thanks in advance.
1
1716
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; But I also want to be able to change the name of the table in the code. So I want to have "tablename" above refer to a VARIABLE that contains the name of a table, so I don't have to go changing the tablename throughout the code if the table name...
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.