Solved

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

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

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MailAddress in vb 4 29
storing csv file in table variable in Python 2 28
C# Service FileSystemwatcher isse 9 27
Data organization issue 7 19
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.

828 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