Solved

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

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

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

This is about my first experience with programming Arduino.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

710 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