I suggest you define the Enum as
public enum SizeMode
{
Stretch,Normal,Fit
}
Assuming 'sameehViewer is an
instance of a Class defined in your library:
1) If you define the Enum in the app: the Library/Class is going to need a reference to the app the Enum is defined in: that creates an undesirable dependency, and exposes the app to possible unwanted changes.
2) This is very confused code:
enum _sizeMode;
public enum SizeMode
{
set
{
_sizeMode = value;
SetSizeMode();
}
get
{
return _sizeMode;
}
}
3) Consider defining the Enum in the library with access set to public: then, when your app has a valid reference to an instance of the library, it can select one of the Enum values to pass.
namespace ViewerLibrary
{
public enum SizeMode
{
Stretch, Normal, Fit
}
public class Viewer
{
public SizeMode viewSizeMode { set; get; } = SizeMode.Normal;
public void SetSizeMode(SizeMode szMode)
{
viewSizeMode = szMode;
}
}
}
Note the use of a Method to set the Property value: having setters or getters in a Property cause side-effects is a bad code practice..
4)After you add a reference to the Viewer dll to the app: in the app main form you can then create an instance of the Viewer, and do whatever:
using ViewerLibrary;
namespace TheApp
{
private Viewer viewer = new Viewer();
private void Form1_Load(object sender, EventArgs e)
{
viewer.SetSizeMode(SizeMode.Stretch);
}
}