Use A Private Class And It's Members From Another Class?

May 18, 2009

I usually use which is free, works a little too well, it's obfuscating the code that passes between my scripting class and the other classes, so after obfuscating the app, the scripting functions no longer work.However I found another obfuscator called Skater lite which is a free edition, it will only obfuscate private classes and members, so what I would like to do if possible is make most of my classes private and their members (except for the scripting class, which should allow it to work properly after being obfuscated), and somehow still use them globally, declaring an instance of the class doesn't seem to work, I'm not even sure it's possible and I know little about the scope of private classes, so anyone got any ideas or workarounds?

View 14 Replies


ADVERTISEMENT

Access Members Of A Sub Class Through A Property Of The Parent Class?

Mar 30, 2010

This is a bit of a continuation from a previous post for which AtmaWeapon was very informative.

Problem:
A parent class has a sub class with various properties. A property of the parent class is a List(of T) with T = the sub class The issue is how to store data in the sub class of the instantiated parent

Some example code (hopefully formatted correctly):

Code:
'=========== Class Definitions =============
Public Class courseClass
Public Class timeTableClass

[Code].....

View 7 Replies

Can't Make Difference Between Public Class And Private Class And Friend And Protected Friend Class

May 15, 2009

I can't make difference between public class and private class and friend and protected friend class.

View 1 Replies

Private And Public Class At Class Library

Mar 12, 2011

I'm posting this there is a relationship with my previous post [URL]

I have two projects, namely:

1. Project1 (Windows Application)

2. Project2 (Class Library)

in Project2 there are several classes:

* frmLogin.vb
* frmCustomer.vb
* clsGlobals.vb

in my case, I want to frmLogin.vb and frmCustomer.vb not called in Project1 and I can only call is clsGlobals.vb

View 8 Replies

Access Enum Members From Outside A Class?

Aug 1, 2011

I'm going to do my best to describe what I'm trying to do. I have a class that has an enum in it.[code]...

View 2 Replies

Best Way To Initialize Shared Members In A Class

Aug 23, 2011

I was looking on the interweb to see if there were any good examples on how to initialize shared members within a class while still initializing instance variables.[code]How do I initialize both instance and shared members without re-initializing the shared members every time an object is created from a class?

View 1 Replies

Class Members Autogenerate The The Corresponding Properties?

Sep 19, 2011

I have a Data class whichs hold 70 class members to save me a hole lot time and effort not having to type all the properties for hand I'm wondering if there is a simple tool i VS2010 that I can use to auotgenerat the "property stubbs"

[Code]...

View 2 Replies

Struct Or Class For List Members

Apr 16, 2012

I have an application that reads data from a SQL query into a list corresponding to the rows of the query. So, I have something like this:[code]What I'd like to know is if I should be using a class (as above) or a structure, and what the difference may be in terms of memory or runtime, if any.

View 3 Replies

Access A Class Members In Asp.net Vb 2008 - Different From Vs 2003?

Mar 10, 2009

This might seem like a silly question, even for a newbie but I can't access the members of a class from a user control. I am developing a shopping cart application in vb 2008. inside the app_data folder i have a folder name BusinessObjects which contains a class called Catalog. This is the code for this class:

[Code].....

View 2 Replies

C# - Handle Events Of Members From Another Class / Instance?

Jul 14, 2010

I am attempting to share a sub menu among several different parts of an application so that it is consistent (not wanting to copy/paste.) I thought it would be simple. I am doing something like this:

[Code]...

View 3 Replies

.net - Derived Class Members Not Available When Added To Custom Collectionbase?

Apr 28, 2009

I have a Base Class, called primitive Graphics. derived from this class are several different types of graphics, squares, rectangles, lines, etc. I am storing those graphics in an object that inherits collectionbase. This causes a problem because I cannot access any of the members in the derived class when they are added to the collection. Here is the default property for my primitivecollection class

[Code]...

My current workaround is to just put all of the public members in the base class, however this is starting to look ugly as I add more derived classes that need members available to the derived class only

View 3 Replies

Constructor - Whats The Best Way To Initialize Shared Members In A Class In VB.Net?

Dec 8, 2010

I was looking on the interweb to see if there were any good examples on how to initialize shared members within a class while still initializing instance variables. I did find an expression that might fit to the answer:

[code]...

How do I initialize both instance and shared members without re-initializing the shared members every time an object is created from a class? Thanks!

View 2 Replies

VS 2010 Disable Default Class Members And Methods?

Mar 13, 2011

Is there a way to disable the default members and methods inherited from the base class?

I made some classes in which elements like "Equals" and "ReferenceEquals" are confusing or I don't want them to show, or I have other methods providing similar functionality with different names and I don't want to override and use the default name.

View 3 Replies

Difference Between Private Sub / Function And Class

Oct 30, 2010

What is the difference between Private Sub /private Function / Private Class and to use them?

View 4 Replies

.net - Reflection Retrieve Private Methods Of A Class?

Sep 13, 2010

I want to retrieve private (implementation and other) methods of a class which implements an interface and also is derived from (inherits) a base class.How can I achieve this using reflection?This is wat m tryin to do. I need to view these private methods and their contents, I don't want to invoke them.

Dim assembly As System.Reflection.Assembly
Dim assemblyName As String assemblyName = System.IO.Path.GetFullPath("xyz.dll")
assembly = System.Reflection.Assembly.LoadFile(assemblyName)
assembly.GetType("myClass").Getmethods(Bindings.NonPublic)
assembly.GetType("myClass").GetMethods(BindingFlags.NonPublic) isn't working

View 2 Replies

Access Private Class Variable Names?

Jan 9, 2009

Trying to understand the best way to do this and I'm can't get it figured. Here's basically what I have:

Public Class CardParsingClass
Private iAcctIDStart as integer
Private iAcctIDLength as integer

[code]....

I've only included 2 of the class level fields here but there are actually 30, so that's why I was hoping to be able to send the name of the field to set and the value to set it at in the SetValue function. So in some other routine in the program I'd like to be able to issue the following call:

SetValue("iAcctIDStart", "3")

But then when I get into the SetValue routine, I'm not sure how to proceed. I thought about a case statement that would basically be this:

select Case strFieldToSet
case "iAcctIDStart"
iAcctIDStart = cint(strValue)

[code]....

View 5 Replies

Access Private Constants In Class Attributes?

Sep 27, 2011

I have an API that I created and currently utilize successfully in C#. I am trying to create an example of interacting with the API in VB.NET (so that the QA without C# experience can still utilize it for creating automated tests).

In C# I do the following

[TestingForm(FormName= "Land Lines", CaseType= _caseType
, Application= ApplicationNameCodes.WinRDECode, HasActions= true)]
public class LandLines : RDEMainForm

[Code]....

This gives me a compile time error because it claims that FORM_NAME and CASE_TYPE is not defined, even though the class has it defined inside.

How can I use the defined constants inside the class in the class attributes?

View 1 Replies

Class Private/Public Naming Conventions?

Mar 25, 2011

I'm relatively new to .NET and am wondering how people handle naming their private variables and the public properties that access them. Like if you want to be able to just read it, but not write to it.

[Code]...

So far I've taken to putting a 'l' (for local) in front of the all the private variables so as to be able to use the full name for the property. Is there a better way around this, or do you just always have to have different names for private variable/public properties? If so, what sort of conventions do people use?

Its not a huge deal, its just a minor annoyance and I was wondering if I was missing something.

View 4 Replies

Class, Method, Namespace, Private Vs Public?

Feb 16, 2012

what websites, books or courses you guys suggest to use so I learn the fundamentals of programming. What is a class, method, namespace, private vs public. That leads me into .Net programming. A lot of intro to programming use java or C++ as the platform but I want to find one with VB.net or maybe C# if.

View 6 Replies

Code - Missing All Of The Private Sub, And End Class Stuff

May 12, 2010

I come from ROBLOX. Anyway, whats wrong with with code, it's in a button.

ProgressBar1.Value = "100"
if ProgressBar1.Value = "100" then
Me.Close()

I do realize it's missing all of the Private Sub, and end class stuff... This is just the main body of code.

View 8 Replies

Make Form Private In Class Library?

Feb 27, 2012

I'm programming a class library, i want to add form but i need this form to be private so it cannot be seen from outside the library.

View 4 Replies

Partial Mock Of A Class With Private Constructor

Sep 9, 2011

I am trying to write some unit tests on a class that looks like this, using Moq [code] the parameterized constructor is private or internal one of the two methods relies on the result of the other.I want to check that when GetThisOrThat is called with a value, it actually calls GetThis. But I also want to mock GetThis so that it returns a specific well-known value.To me this is an example of Partial Mocking, where we create a Mock based on a class, passing the parameters for the constructor. The problem here is that there is no public constructor, and therefore, Moq can not call it..I tried using the Accessors generated by Visual Studio for MSTest, and use those accessors for the mocking, and this is what I came up with [code]

View 1 Replies

Private MyString As String - To Many Should Move To A Class?

Aug 25, 2011

vb
Private Sub OutputResponse(ByVal control As RichTextBox, ByVal output As String, ByVal color As Color)

[code].....

View 17 Replies

Class C Inherits Class D Is Class D A Superclass Or Parent Of Class C?

Dec 16, 2009

If Class X is within the scope of Class Y, is X a subclass of Y?If Class A is a sub Class of B, then is Class B considered a super class of A?if Class C inherits Class D is Class D a superclass or parent of Class C?if Class E extends Class F then we can consider Class E a child of F?if Class G inherits Class H and is within the scope of Class I then who is the parent of Class G? Classes that inherits Class J and classes that are within Class J are all sub classes of Class J?

View 1 Replies

C# - Using The Value From The Private Variable Or From The Actual Property In Class Functions?

Dec 30, 2009

When referencing class properties from a function within the class do you use the value from the actual property or the private variable value?

public class
private m_Foo as double
public property Foo() as double

[Code].....

View 7 Replies

Create A Private Shared Object In Each Class And Lock On That Instead?

Jul 13, 2009

I have created a synchronized queue and am using SyncLock on the SyncRoot property of that queue when I invoke the Enqueue/Dequeue methods. The methods are invoked from instances of standard producer/consumer classes.Is that a proper use of the SyncRoot property?

Would it be better practice to create a private shared object in each class and lock on that instead?

View 1 Replies

Transactions - Expose Private Fields Using A Partial Class?

Nov 12, 2010

I am trying to implement transactions across multiple TableAdapters in VB.NET (using Visual Studio 2010) by extending the partial class as described in the following examples:

http://blah.winsmarts.com/2006/06/18/the-definitive-tableadapters--transactions-blog-post.aspx
madprops.org/blog/typed-datasets-and-sqltransaction/
stackoverflow.com/questions/2342289/net-tableadapter-to-dataadapter

However, when I attempt to expose any of the private fields created by the designer they are underlined in the editor with the following error:

'_adapter' is not declared. It may be inaccessible due to its protection
level.

Searching this site as well as google has not revealed anything useful, but perhpas I'm searching the wrong keywords.

Here is the code in MyDataset.vb

Partial Public Class MyTableAdapter
Public Property MyTransaction() As SqlTransaction
Get

[code]....

View 1 Replies

VS 2008 - Comparing Variables In Private Sub With Public Class

Nov 11, 2009

I have these list of RS-232 strings declared in my public class
Public Class TouchInterface
Dim WatchTVbtnCmd As String = "rs232command1"
Dim VolUpbtnCmd As String = "rs232command2"
Dim VolDownbtnCmd As String = "rs232command3"
Dim SystemOffbtnCmd As String = "rs232command4"
Dim RadiobtnCmd As String = "rs232command5"
Dim MusicbtnCmd As String = "rs232command6"

I then have this private sub. For the sake of this thread, what I would like to do is get the name of the label that was clicked which in the code below is already done, convert it to string (not sure if this needs to be done), this is also done in the code below. Next I want to compare the labelnamestring to all the variables in the public class to find out which one it is equal to and then disply that variable which should be my rs232 string in the message box. I have also added "Cmd" to the variable names above so I also need to work out how to add the text "Cmd" to the string to properly compare.

Private Sub Musicbtn_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WatchTvbtn.Click, VolUpbtn.Click, VolDownbtn.Click, SystemOffbtn.Click, Radiobtn.Click, Musicbtn.Click, GardenVolUpbtn.Click, GardenVolDownbtn.Click, GardenRadiobtn.Click, GardenOffbtn.Click, GardenMusicbtn.Click, GardenMediaCenterbtn.Click
Dim labelname As Label = DirectCast(sender, Label)
[Code] .....

View 6 Replies

Form Inheritance - Error1Base Class 'MenuStrip' Specified For Class 'Lesson2' Cannot Be Different From The Base Class

Apr 15, 2010

I have put this code in the global form Inherits System.Windows.Forms.Form. And then in the form that will inherit this from the global Inherits MenuStrip. "MenuStrip" is what the global form is called. But keep getting this error: Error1Base class 'MenuStrip' specified for class 'Lesson2' cannot be different from the base class 'System.Windows.Forms.Form' of one of its other partial types.

View 5 Replies

Register The Class File - Not Recognizing My Class.Even The Intellisense Is Not Picking Up Te Class

Jul 22, 2011

I have a class (see below)

Imports Microsoft.VisualBasic
Imports System.Data.SqlClient

Public Class ClientProfile

#Region "Variables"

[CODE]...

It is in the file ClientProfile I have placed in both App_Code and also App_Code/Models

In my code behind I have the following

[CODE]...

The last word, "ClientProfile" has the scary squiggly red line below it. It is not recognizing my class.Even the Intellisense is not picking up te class. Do I have to register the class file in any way?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved