Blog

posts tagged with work

C# InputBox

1 Comments
By Fons Sonnemans, 30-apr-2003

Download InputBoxSample.zip

Introduction

Visual Basic 6.0 has an InputBox() function, Visual Basic.NET has one but in C# you don't. You can solve this easily by adding a reference to 'Microsoft.VisualBasic.dll' and use the static method Microsoft.VisualBasic.Interaction.InputBox().

The VB implementation has some shortcomings which I solved in my improved InputBox class. You never know whether the user entered a empty text or clicked the Cancel button. It is also impossible to have validation on the text.


Example: InputBox

InputBox class

The InputBox class is a public class with a private constructor. You use it by calling the static Show method. This method instantiates a new instance of the class, sets it's properties and returns the result. The result is not a string but a InputBoxResult object. This object has two properties: OK and Text. OK is a boolean indicating that the user clicked the OK button and not the Cancel button. The Text contains the string the user entered.

public static InputBoxResult Show(string prompt,stringtitle, stringdefaultResponse,
                                 InputBoxValidatingHandler validator,intxpos,intypos){
    using (InputBox form=new InputBox()) {
        form.labelPrompt.Text =prompt;
        form.Text = title;
        form.textBoxText.Text =defaultResponse;
        if(xpos >=0 &&ypos >=0){
            form.StartPosition = FormStartPosition.Manual;
            form.Left = xpos;
            form.Top = ypos;
        }
        form.Validator = validator;

        DialogResult result=form.ShowDialog();

        InputBoxResult retval=new InputBoxResult();
        if(result == DialogResult.OK){
            retval.Text = form.textBoxText.Text;
            retval.OK = true;
        }
        returnretval;
    }
}

publicstatic InputBoxResult Show(string prompt,stringtitle, stringdefaultText,
                                 InputBoxValidatingHandler validator){
    return Show(prompt, title,defaultText,validator,-1,-1);
}

Usage

You activate the InputBox by calling the static Show() method. It has 4 required and 2 optional arguments (using overloading).

private void buttonTest_Click ( object sender , System.EventArgs e) {
    InputBoxResult result= InputBox.Show("Test prompt:","Some title","Default text", null);
    if(result.OK){
        textBox1.Text = result.Text;
    }
}


Validation

You can add validation logic using the validator argument. The validator is a InputBoxValidatingHandler delegate which you can use to validate the Text. The following sample checks whether the Text is not empty. If so it sets Cancel to true and the Message to 'Required'.

private void buttonTest_Click ( object sender , System.EventArgs e) {
    InputBoxResult result= InputBox.Show("Test prompt:","Some title","Default text",
                                             new InputBoxValidatingHandler(inputBox_Validating));
    if(result.OK){
        textBox1.Text = result.Text;
    }
}

privatevoid inputBox_Validating(objectsender, InputBoxValidatingArgs e){
    if(e.Text.Trim().Length ==0){
        e.Cancel =true;
        e.Message ="Required";
    }
}


Example: Required text

Conclusion

The ImputBox class is just a simple class which you can use in your Windows Forms application to prompt for a text. It can also be used from Visual Basic.NET when you compile it in a Library and reference this Library from you VB project.

Any suggestions and feedback for improving this article is most welcome. Send your suggestions and feedback to Fons.Sonnemans@reflectionit.nl

READ MORE

Free VS.NET Add-In: Spelly.NET

0 Comments
By Fons Sonnemans, 01-apr-2003

Spelly is a Visual Studio addin that allows you to easily spell-check source code and/or comments. Spelly is smart enough to understand identifiers with under_scores and MixedCase.

Spelly is available for both Visual Studio .NET and Visual C++ 5/6.

READ MORE

Reliably and quickly improve your C# code with Xtreme Simplicity's C# Refactory

0 Comments
By Fons Sonnemans, 04-feb-2003

I have found a promising C# tool which fully integrates with Visual Studio.NET. I'm going to test it soon (I hope).

Have a look yourself at http://www.xtreme-simplicity.net

READ MORE

Save your UserSettings in an Isolated Store

0 Comments
By Fons Sonnemans, 01-feb-2003

Download UserSettings.zip

Introduction

I like applications who remember my settings the next time I use it. This is an easy feature which is often forgotten. Most of the time because it is quite some work. With this article I want to help you with this and saving you a lot off work.

Then there is always the question 'where do we store the settings?'. I see a lot of applications using the Registry, ini-files or xml-files. All these solutions are causing a security risk. Especially when you want your application to be downloaded from the web using the 'no touch' deployment features of .NET.

Microsoft has solved this problem for me by introducing an isolated stores. With these stores, you can read and write data that less trusted code cannot access and prevent the exposure of sensitive information that can be saved elsewhere on the file system. Data is stored in compartments that are isolated by the current user and by the assembly in which the code exists.

The downloadable zipfile contains a UserSettingLibrary which can be used to store user settings into an isolated store.

IsolatedUserSettings class

The IsolatedUserSettings class can be used to store and retrieve user settings in and from an IsolatedStorageFile. The RegisterForm() method can be used to register a form. The location, size and windowstate of the form will be saved and restored. The SaveSetting() method saves an serializable object which can be restored using the GetSetting() method.


using System;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections;
using System.Windows.Forms;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Reflection;

namespace ReflectionIT.UserSettings
{
    /// <summary>
    /// The IsolatedUserSettings class can be used to store and retrieve user settings
    /// in and from an IsolatedStorageFile.
    /// </summary>
    public class IsolatedUserSettings : IDisposable
    {
        private Hashtable _settings;
        privatebool_closed =false;
        privatestring_fileName;

        /// <summary>
        /// Constructor
        /// </summary>
        public IsolatedUserSettings(stringfileName)
        {
            _fileName=fileName;
            IsolatedStorageFile isoFile= GetStore();
            string[] files=isoFile.GetFileNames(fileName);
            if(files.Length == 1){
                // file exists -> Deserialize
                using(IsolatedStorageFileStream stream= new IsolatedStorageFileStream(
                         fileName, FileMode.Open, isoFile)){
                    BinaryFormatter formatter=new BinaryFormatter();
                    try{
                        _settings= (Hashtable)formatter.Deserialize(stream);
                    }
                    catch(SerializationException){
                        _settings= new Hashtable();
                    }
                }
            }else{
                // start fresh
                _settings= new Hashtable();
            }
        }

        /// <summary>
        /// ND Destructor
        /// </summary>
        ~IsolatedUserSettings() {
            Dispose(false);
        }

        /// <summary>
        /// Close the IsolatedUserSettings
        /// </summary>
        publicvoid Dispose(){
            Dispose(true);
            System.GC.SuppressFinalize(this);
        }

        /// <summary>
        /// Close the IsolatedUserSettings
        /// </summary>
        /// <param key="disposing"></param>
        protectedvirtualvoid Dispose(bool disposing){
            this.Close();
        }

        /// <summary>
        /// Write the UserSettings to the IsolatedStorage
        /// </summary>
        publicvirtualvoid Close() {
            if(!_closed){
                IsolatedStorageFile isoFile= GetStore();

                using(IsolatedStorageFileStream stream= new IsolatedStorageFileStream(
                         FileName, FileMode.Create,isoFile)){
                    BinaryFormatter formatter=new BinaryFormatter();
                    formatter.Serialize(stream,_settings);
                }
                _closed= true;
            }
        }

        /// <summary>
        /// Get the fileName
        /// </summary>
        publicstring FileName {
            get{return _fileName;}
        }

        /// <summary>
        /// Return the Store
        /// </summary>
        /// <returns></returns>
        private IsolatedStorageFile GetStore(){
            return IsolatedStorageFile.GetStore(IsolatedStorageScope.Assembly |
                IsolatedStorageScope.User | IsolatedStorageScope.Domain |
                IsolatedStorageScope.Roaming, null,null);
        }

        /// <summary>
        /// Register a Form
        /// </summary>
        /// <param key="key"></param>
        /// <param key="form"></param>
        publicvirtualvoid RegisterForm(string key, Form form){
            FormSetting f;
            if(_settings.ContainsKey(key)) {
                f =(FormSetting)_settings[key];
                f.Restore(form);
            }else{
                f =new FormSetting(key);
                f.Backup(form);
                _settings.Add(key, f);
            }
            form.SizeChanged +=new EventHandler(f.FormMovedOrResized);
            form.LocationChanged +=new EventHandler(f.FormMovedOrResized);
        }

        /// <summary>
        /// UnRegister a Form
        /// </summary>
        /// <param key="key">Name of the Form. A forms with an existing key will
        /// automatically get the stored settings.</param>
        /// <param key="form"></param>
        publicvirtualvoid UnRegisterForm(string key, Form form){
            if(_settings.ContainsKey(key)) {
                FormSetting f =(FormSetting)_settings[key];
                f.Backup(form);
                form.SizeChanged -= new EventHandler(f.FormMovedOrResized);
                form.LocationChanged -= new EventHandler(f.FormMovedOrResized);
            }
        }

        /// <summary>
        /// Save a setting with a given key
        /// </summary>
        /// <param key="key">Name of the setting by which it is saved an can be
        /// restored using GetSetting().</param>
        /// <param key="setting"></param>
        publicvoid SaveSetting(stringkey,objectsetting){

            // Check Serializable attribute
            TypeAttributes attributes=setting.GetType().Attributes;
            if((attributes& TypeAttributes.Serializable)==0) {
                thrownew ArgumentException("Setting argument must be marked Serializable.");
            }

            // Add or Overwrite setting
            if(_settings.ContainsKey(key)) {
                _settings[key]= setting;
            }else{
                _settings.Add(key, setting);
            }
        }

        /// <summary>
        /// Return the setting with the given key
        /// </summary>
        /// <param key="key"></param>
        /// <returns>
        /// The setting object or null when the the given key does not exists
        /// </returns>
        publicobject GetSetting(stringkey){
            return GetSetting(key,null);
        }

        /// <summary>
        /// Return the setting with the given key
        /// </summary>
        /// <param key="key"></param>
        /// <returns></returns>
        publicobject GetSetting(stringkey,objectdefaultValue){
            if(_settings.ContainsKey(key)) {
                return_settings[key];
            }
            returndefaultValue;
        }
    }
}

The FormSetting class is used to store a form's location, size and windowstate in a serializable object. The next time you register a form with the same key the location, size and windowstate is restored to the saved values. So if you resize your form, close it and open it again the size will be the same as it was when you last closed it.

using System;
using System.Drawing;
using System.Windows.Forms;

namespace ReflectionIT.UserSettings
{
    /// <summary>
    /// Summary description for FormSetting.
    /// </summary>
    [Serializable]
    publicclass FormSetting
    {
        private Point _location;
        privatestring_name;
        private Size _size;
        private FormWindowState _windowState;

        public FormSetting(stringname)
        {
            this._name =name;
        }

        /// <summary>
        /// Get the name used for this FormSetting
        /// </summary>
        publicstring Name {
            get{return (this._name);}
        }

        /// <summary>
        /// Backup the Size, Location and WindowState (only when not Minimized)
        /// </summary>
        /// <param name="form"></param>
        publicvirtualvoid Backup(Form form){
            if(form.WindowState != FormWindowState.Minimized) {
                // Only when not Maximized
                if(form.WindowState != FormWindowState.Maximized){
                    this._location=form.Location;
                    this._size=form.Size;
                }
                this._windowState=form.WindowState;
            }
        }

        /// <summary>
        /// Eventhandler
        /// </summary>
        /// <param name="sender">Form which is Moved or Resized</param>
        /// <param name="e"></param>
        publicvirtualvoid FormMovedOrResized(object sender, EventArgs e){
            Backup((Form)sender);
        }

        /// <summary>
        /// Restore the Size, Location and WindowState for the given form
        /// </summary>
        /// <param name="form"></param>
        publicvirtualvoid Restore(Form form){
            form.Location = this._location;
            form.Size = this._size;
            form.WindowState =this._windowState;
        }
    }
}

Sample

The included sample uses the IsolatedUserSettings class to store and restore the user settings. In this case the Form (Location, Size and WindowState), the Checked property of a CheckBox and a MostRecentlyUsedList object. The settings are restored in the constructor and saved in the Closing event handler, the Form properties are saved automatically by the internally used FormSetting class. You must set the StartPosition property of the form to 'Manual', otherwise the location will not be restored.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using ReflectionIT.UserSettings;

namespace Test
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class Form1: System.Windows.Forms.Form
    {
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Button buttonMRUAdd;
        private System.Windows.Forms.TextBox textBoxMRU;
        private System.Windows.Forms.ListBox listBoxMRU;

        private MostRecentlyUsedList _mru;
        private IsolatedUserSettings _settings =new IsolatedUserSettings("settings.dat");
        private System.Windows.Forms.CheckBox checkBox1;

        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components=null;

        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Get UserSettings
            _settings.RegisterForm(this.Name,this);
            _mru=(MostRecentlyUsedList)_settings.GetSetting("mru",new MostRecentlyUsedList(5));
            checkBox1.Checked = (bool)_settings.GetSetting("checked",true);
            listBoxMRU.DataSource = _mru;
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protectedoverridevoid Dispose(bool disposing)
        {
            if(disposing )
            {
                if(components!= null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing);
        }

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        staticvoid Main()
        {
            Application.Run(new Form1());
        }

        /// <summary>
        /// Add the Text to the MRU and bind it to the datasource
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        privatevoidbuttonMRUAdd_Click(object sender, System.EventArgs e){
            _mru.Add(textBoxMRU.Text);
            textBoxMRU.Clear();
            textBoxMRU.Focus();

            listBoxMRU.DataSource = null;// force update
            listBoxMRU.DataSource =_mru;
        }

        /// <summary>
        /// Save the MRU and checkBox1.Checked to the UserSettings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        privatevoid Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e){
            _settings.SaveSetting("mru",_mru);
            _settings.SaveSetting("checked",checkBox1.Checked);
            _settings.Close();
        }
    }
}

The MostRecentlyUsedList class has a Serializable attribute which makes it possible to store it in an IsolatedUserSetting.

 

using System;
using System.Collections;

namespace Test
{
   &nbsp/// <summary>
   &nbsp/// Summary description for MostRecentlyUsedList.
   &nbsp/// </summary>
   &nbsp[Serializable]
   &nbsppublicclass MostRecentlyUsedList : IList
   &nbsp{
   &nbsp   &nbspprivateint_capacity;
   &nbsp   &nbspprivate ArrayList _list;

   &nbsp   &nbsp/// <summary>
   &nbsp   &nbsp/// Initializes a new instance of the MostRecentlyUsedList class
   &nbsp   &nbsp/// that is empty and has the specified capacity
   &nbsp   &nbsp/// </summary>
   &nbsp   &nbsp/// <param name="capacity">The number of elements that the new
   &nbsp   &nbsp/// MostRecentlyUsedList is capable of storing. </param>
   &nbsp   &nbsppublic MostRecentlyUsedList(intcapacity)
   &nbsp   &nbsp{
   &nbsp   &nbsp   &nbsp_capacity=capacity;
   &nbsp   &nbsp   &nbsp_list=new ArrayList(capacity);
   &nbsp   &nbsp}

   &nbsp   &nbsp/// <summary>
   &nbsp   &nbsp/// Add a object to the beginning of the list. If the value already
   &nbsp   &nbsp/// exists it is removed first. The length of the list will never
   &nbsp   &nbsp/// exceed the capacity.
   &nbsp   &nbsp/// </summary>
   &nbsp   &nbsp/// <param name="value">The Object to be added to the beginning
   &nbsp   &nbsp/// of the MostRecentlyUsedList</param>
   &nbsp   &nbsppublicvoid Add(objectvalue)
   &nbsp   &nbsp{
   &nbsp   &nbsp   &nbspif(_list.Contains(value)){
   &nbsp   &nbsp   &nbsp   &nbsp_list.Remove(value);
   &nbsp   &nbsp   &nbsp}else{
   &nbsp   &nbsp   &nbsp   &nbspif(this.Count ==this.Capacity){
   &nbsp   &nbsp   &nbsp   &nbsp   &nbsp_list.RemoveAt(this.Count -1);
   &nbsp   &nbsp   &nbsp   &nbsp}
   &nbsp   &nbsp   &nbsp}
   &nbsp   &nbsp   &nbsp_list.Insert(0,value);
   &nbsp   &nbsp}

   &nbsp   &nbsp/// <summary>
   &nbsp   &nbsp/// Get or sets the number of elements that the MostRecentlyUsedList
   &nbsp   &nbsp/// is capable of storing.
   &nbsp   &nbsp/// </summary>
   &nbsp   &nbsppublicint Capacity {
   &nbsp   &nbsp   &nbspget{return (this._capacity);   &nbsp}
   &nbsp   &nbsp   &nbspset{
   &nbsp   &nbsp   &nbsp   &nbspthis._capacity=value;
   &nbsp   &nbsp   &nbsp   &nbspwhile(this.Count >=this.Capacity){
   &nbsp   &nbsp   &nbsp   &nbsp   &nbsp_list.RemoveAt(this.Count -1);
   &nbsp   &nbsp   &nbsp   &nbsp}
   &nbsp   &nbsp   &nbsp}
   &nbsp   &nbsp}
   &nbsp   &nbsp....

Conclusion

The IsolatedUserSettings is an simple class which uses an isolated store to serialize and deserialize objects. With it you can enhance your applications without much effort.

Any suggestions and feedback for improving this article is most welcome. Send your suggestions and feedback to Fons.Sonnemans@reflectionit.nl

READ MORE

WinForms AcceptButton Extender

0 Comments
By Fons Sonnemans, 01-dec-2002

Download AcceptButton.zip

Introduction

The System.Windows.Forms.Form class has an AcceptButton property which can be used to set the button on the form that is clicked when the user presses the ENTER key. The accept (default) button should be the button that represents the action that the user is most likely to perform if that action isn't potentially dangerous. This button has a dark border to let the user know that it is the accept button.

This feature works great only when you have one accept button. Have a look at the following diaglog.

The OK button is in this dialog the accept button. This is the correct behavior when the textbox 'Name' and datepicker 'Date' have the focus. There should not be an accept button when the (multiline) textbox 'Description' has the focus. When listbox 'Avialiable' has the focus the '> Add >' button must be the accept button. And when listbox 'Assigned' has the focus the '> Add >' button must be the accept button.

This can be accomplished by implementing the following Enter and Leave event handlers.


private void textBoxDescription_Enter ( object sender , System.EventArgs e) {
    this.AcceptButton =null;
}

privatevoid textBoxDescription_Leave(objectsender, System.EventArgs e) {
    this.AcceptButton =buttonOK;
}

privatevoid listBoxAvailable_Enter(objectsender, System.EventArgs e) {
    this.AcceptButton =buttonAdd;
}

privatevoid listBoxAvailable_Leave(objectsender, System.EventArgs e) {
    this.AcceptButton =buttonOK;
}

privatevoid listBoxAssigned_Enter(objectsender, System.EventArgs e) {
    this.AcceptButton =buttonRemove;
}

privatevoid listBoxAssigned_Leave(objectsender, System.EventArgs e) {
    this.AcceptButton =buttonOK;
}

But why write code when the same can be accomplished by setting some properties in the designer. The AcceptButton extender class can be used to eliminate this code.

AcceptButton Extender Provider

An extender provider is a component that provides properties to other components. The AcceptButton class implements the IExtenderProvider interface making it an Extender Provider. When you add an AcceptButton control to a Form, all other controls (accept buttons) on the form have the UseDefaultAcceptButton and the AcceptButton property added to their list of properties.

You now only have to set the two properties for each control:

Control UseDefaultAcceptButton property AcceptButton property
textBoxName True (none)
textBoxDescription False (none)
dateTimePickerDate True (none)
listBoxAvailable False buttonAdd
listBoxAssigned False buttonRemove

Conclusion

The AcceptButton class is good example for which you can use Extender Providers. Extender Providers are somewhat strange to write but very powerful. I use them a lot.

Any suggestions and feedback for improving this article is most welcome. Send your suggestions and feedback to Fons.Sonnemans@reflectionit.nl

READ MORE

Janus System has released some great .NET controls

0 Comments
By Fons Sonnemans, 22-okt-2002

I have used the Janus GridEX control in many of my VB6 projects. It worked perfectly and it is very fast.

I have tested the .NET Trial version, it is even better. This is a component that everybody who is building WinForms application should buy.

Have a look at Janus GridEX Control for .NET and try it yourself.

READ MORE

Regular Expressions

0 Comments
By Fons Sonnemans, 06-sep-2002

I find Regular Expression powerful but difficult. Eric Gunnerson wrote the Regular Expression Workbench. This makes them easy.

It's a tool to create, test, and study regular expressions with this workbench. With the "Examine-o-matic" feature, hover over the regex to decode what it means

READ MORE

.NET Framework Service Pack 2

0 Comments
By Fons Sonnemans, 09-aug-2002

READ MORE

Balloon Windows for .NET

0 Comments
By Fons Sonnemans, 07-aug-2002

I have found a class that allows for balloon shaped forms in .NET.

Have a look at CodeProject.

READ MORE

WinForm SplashScreen

0 Comments
By Fons Sonnemans, 01-aug-2002

Download SplashScreen.zip

Introduction

Most commercial WinForm applications have a SplashScreen. This article explains how you can implement one using the Microsoft .NET Framework.


Example: Visual Studio.NET SplashScreen


SplashApplicationContext

The SplashApplicationContext is used to show a splash Form before the main Form is shown. It's base class is ApplicationContext.

The constructor accepts 3 arguments

  • mainForm: The main Form of the application to use for context
  • splashForm: The splash Form of the application to use for context
  • interval: The time (in milliseconds) the splash Form is visible. Specify 0 to disable the timeout.

Usage

The Application.Run(context) method creates a standard application message loop on the current thread, with an ApplicationContext.

The following code creates a SplashApplicationContext using a new Form1 as the MainForm and a new SplashForm as the SplashForm. The interval is set to 2000 which will show the SplashForm for 2 seconds. This is done in the static Main() method.

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
staticvoid Main()
{
    SplashApplicationContext myContext=
        new SplashApplicationContext(new Form1(),new SplashForm(), 2000);

    Application.Run(myContext);
}
Code: Form1.cs

You can use the time that the SplashForm is shown usefully. You can use it to connect to databases or do some other intializations. The following code simulates some activity. The status is displayed using a Label control.

private void SplashForm_Load(object sender, System.EventArgs e)
{
    // Show Form
    this.Show();
    Application.DoEvents();// Finish Paint
    Cursor.Current = Cursors.WaitCursor;

    // Simulate some activity (e.g. connect to database, caching data, retrieving defaults)
    this.labelStatus.Text ="Step 1";
    this.labelStatus.Refresh();
    System.Threading.Thread.Sleep(1000);

    // Simulate some activity
    this.labelStatus.Text ="Step 2";
    this.labelStatus.Refresh();
    System.Threading.Thread.Sleep(1000);

    // Simulate some activity
    this.labelStatus.Text ="Step 3";
    this.labelStatus.Refresh();
    System.Threading.Thread.Sleep(1000);

    // Close Form
    this.Close();
}

Code: SplashForm.cs

You must set the interval to 0 to disable the timer.

[STAThread]
staticvoid Main()
{
    SplashApplicationContext myContext=
        new SplashApplicationContext(new Form1(),new SplashForm(), 0);

    Application.Run(myContext);
}

Code: Form1.cs

Conclusion

The SplashApplicationContext class is easy solution to show a SplashScreen. It demonstrates the power of the .NET Framework.

Any suggestions and feedback for improving this article is most welcome. Send your suggestions and feedback to Fons.Sonnemans@reflectionit.nl

READ MORE

All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.