Solved

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

Posted on 2014-11-10
4
312 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

914 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

19 Experts available now in Live!

Get 1:1 Help Now