Solved

C# - Call method from another class with shortened name.

Posted on 2014-11-10
4
302 Views
Last Modified: 2014-11-11
Hi.

Inside the class amazon.cs, have this:
public class keisoku
{
            public static double f2_nUD_D[6];
}

Open in new window


How to call this amazon.keisoku.f2_nUD_D[x] in another class with amazon.keisoku shortened to  amk?
amk.f2_nUD_D[x]

Open in new window

0
Comment
Question by:ocaccy
4 Comments
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 167 total points
ID: 40434327
make a class in the current namepace that amk which calls amazon.keisoku
0
 
LVL 14

Assisted Solution

by:Tchuki
Tchuki earned 167 total points
ID: 40434762
You can use a 'using' directive alias:

namespace ConsoleApplication1
{
    using amk = AmazonCs.SubNamespace.AnotherSubNamespace.keisoku;

    internal class Program
    {
        private static void Main()
        {
            var buffer = amk.buffer;
        }
    }
}

namespace AmazonCs.SubNamespace.AnotherSubNamespace
{
    public unsafe struct f2_NUD_D
    {
        public fixed double buffer [6];
    }

    public class keisoku
    {
        public static f2_NUD_D buffer;
    }
}

Open in new window

0
 
LVL 2

Assisted Solution

by:toakkiyadav
toakkiyadav earned 166 total points
ID: 40435360
Agree with Tchuki.

alias should work here.

For your problem:
using amk = namespace.Amazon.keisoku;

....
amk.f2_nUD_D

thanks
0
 

Author Closing Comment

by:ocaccy
ID: 40436473
Amazing !
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now