The settings class is a Serializable class that you define with properties that are necessary to configure your external store object. The configuration object is used to dynamically generate a user interface to configure your external store object. The properties can be of the following types:
The configuration class must be marked with the [Serializable] with attribute because the configuration settings for your external store object are serialized and stored in the advanced.config file. It also must be marked with the[ExternalStoreConfigurationAttribute] attribute so that the framework can locate the configuration class in your external store-addin.
Each property is decorated with one or more attributes:
DisplayNameAttribute
ControlAttribute
The constructor of the configuration class is used to assign default values for all class members, and the defaults will be the initial values displayed when the tutorial external store user-interface is displayed for the first time.
For the tutorial, we will create an external store addin that stores the DICOM datasets in a folder that you specify in the external store configuration UI.
We will create a configuration that causes the following user interface to be generated:
Most of the user-interface will be not actually be used to configure the external store add-in, but instead serves as a demonstration of the different user-interface objects that can be created.
External Store Generated User Interface
We now define the following class to generate this user-interface:
Copy Code
// Configuration Class
[Serializable]
[ExternalStoreConfigurationAttribute]
public class TutorialConfiguration
{
[DisplayNameAttribute("User ID")]
[ControlAttribute(Width = 400)]
public string UserId
{
get;
set;
}
[DisplayNameAttribute("Password")]
[ControlAttribute(Width = 400, Password = true)]
public string Password
{
get;
set;
}
[DisplayNameAttribute("Name")]
[ControlAttribute(Width = 400)]
public string Name
{
get;
set;
}
TutorialGenderEnum _gender;
[DisplayNameAttribute("Gender")]
[ControlAttribute(Width = 200, Height = 30)]
public TutorialGenderEnum Gender
{
get { return _gender; }
set { _gender = value; }
}
[DisplayNameAttribute("Age (0..99)")]
[RangeAttribute(0, 99)]
public int Age
{
get;
set;
}
[DisplayNameAttribute("Location")]
[ControlAttribute(Width = 400)]
public string Location
{
get;
set;
}
private bool _storeLocally;
[DisplayNameAttribute("Store Locally")]
public bool StoreLocally
{
get { return _storeLocally; }
set { _storeLocally = value; }
}
public TutorialConfiguration()
{
UserId = "Enter User ID";
Password = "Enter Password";
Name = "Enter Name";
Age = 18;
StoreLocally = true;
Location = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ExternalStoreTutorialStore");
}
}
public enum TutorialGenderEnum
{
[Description("Male")]
Male = 0,
[Description("Female")]
Female = 1,
[Description("Unknown")]
Unknown = 2
}
Products |
Support |
Feedback: Unique Configuration Class |
Introduction |
Help Version 19.0.2017.6.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.