Solved

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

Posted on 2014-11-10
4
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 82

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:Vel Eous
Vel Eous 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
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 …
Introduction to Processes

623 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