Example #1
0
        /// <summary>
        /// Deserialize the infotmation from XML node
        /// </summary>
        /// <param name="displaySetNode"></param>
        /// <param name="version"></param>
        public void Deserialize(XmlNode displaySetNode, string version)
        {
            Name = displaySetNode.Attributes["Name"].Value;
            // Is a custom DisplaySet
            Custom = true;

            // Get all DisplaySet items
            XmlNodeList lItemNodes = displaySetNode.SelectNodes("DisplaySetItem");

            foreach (XmlNode lItemNode in lItemNodes)
            {
                DisplaySetItem item = new DisplaySetItem();
                item.Deserialize(lItemNode, version);
                DisplaySetItems.Add(item);
            }


            // Get Service info node
            XmlNodeList lServiceNodes = displaySetNode.SelectNodes("ServiceInfo");

            if (lServiceNodes.Count == 1)
            {
                ServiceInfo = new DisplaySetServiceInfo();
                ServiceInfo.Deserialize(lServiceNodes[0], version);
            }
        }
Example #2
0
        /// <summary>
        /// Checks and marks the editable items in the DisplaySet
        /// </summary>
        public void CheckEditableItems()
        {
            Editable = true;

            // Service and Agent check
            if (ServiceInfo == null || !Logic.Agent.IsActiveFacet(ServiceInfo.Agents))
            {
                Editable = false;
                return;
            }

            // Check every DisplaySet Item
            foreach (DisplaySetServiceArgumentInfo lArgInfo in ServiceInfo.ArgumentDisplaySetPairs.Values)
            {
                DisplaySetItem lItem = GetDisplaySetItemByName(lArgInfo.DSElementName);

                if ((lItem == null) || (!lItem.Visible))
                {
                    Editable = false;
                    return;
                }
                else
                {
                    lItem.Editable = true;
                }
            }
        }
Example #3
0
        /// <summary>
        /// Adds an object-valued item to the DisplaySet.
        /// </summary>
        /// <param name="name">Name of the DisplaySet item.</param>
        /// <param name="alias">Alias of the DisplaySet item.</param>
        /// <param name="className">Definition class.</param>
        /// <param name="idXML">IdXML of the DisplaySet item.</param>
        /// <param name="agents">List of agents of the DisplaySet item.</param>
        /// <param name="width">Width column of the DisplaySet item.</param>
        public void Add(string name, string alias, string className, string idXML, string[] agents, int width, string[] oidFields, DisplaySetInformation supplementaryInfo)
        {
            List <string>  lAgents         = new List <string>(agents);
            DisplaySetItem lDisplaySetItem = new DisplaySetItem(name, alias, className, idXML, lAgents, width, true, oidFields, supplementaryInfo);

            mDisplaySetItems.Add(lDisplaySetItem);
        }
Example #4
0
        /// <summary>
        /// Adds a DisplaySet item to the DisplaySet.
        /// </summary>
        /// <param name="name">Name of the DisplaySet item.</param>
        /// <param name="alias">Alias of the DisplaySet item.</param>
        /// <param name="idXML">IdXML of the DisplaySet item.</param>
        /// <param name="modelType">ModelType of the DisplaySet item.</param>
        /// <param name="nullAllowed">If the DisplaySet item allows null values.</param>
        /// <param name="definedSelectionOptions">List of defined selection options.</param>
        /// <param name="agents">List of agents of the DisplaySet item.</param>
        public void Add(string name, string alias, string idXML, ModelType modelType, bool nullAllowed, List <KeyValuePair <object, string> > definedSelectionOptions, string[] agents, int width)
        {
            List <string>  lAgents         = new List <string>(agents);
            DisplaySetItem lDisplaySetItem = new DisplaySetItem(name, alias, idXML, modelType, nullAllowed, definedSelectionOptions, lAgents, width, true);

            mDisplaySetItems.Add(lDisplaySetItem);
        }
Example #5
0
        /// <summary>
        /// Adds a DisplaySet item to the DisplaySet.
        /// </summary>
        /// <param name="name">Name of the DisplaySet item.</param>
        /// <param name="alias">Alias of the DisplaySet item.</param>
        /// <param name="idXML">IdXML of the DisplaySet item.</param>
        /// <param name="modelType">ModelType of the DisplaySet item.</param>
        /// <param name="agents">List of agents of the DisplaySet item.</param>
        /// <param name="width">Width column of the DisplaySet item.</param>
        public void Add(string name, string alias, string idXML, ModelType modelType, string[] agents, int width)
        {
            List <string>  lAgents         = new List <string>(agents);
            DisplaySetItem lDisplaySetItem = new DisplaySetItem(name, alias, idXML, modelType, lAgents, width, true);

            mDisplaySetItems.Add(lDisplaySetItem);
        }
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="displaySetName"></param>
 public DisplaySetInformation(DisplaySetInformation displaySetToBeCopied)
     : this(displaySetToBeCopied.Name)
 {
     Custom = displaySetToBeCopied.Custom;
     foreach (DisplaySetItem item in displaySetToBeCopied.DisplaySetItems)
     {
         DisplaySetItem newItem = new DisplaySetItem(item);
         DisplaySetItems.Add(newItem);
     }
     if (displaySetToBeCopied.ServiceInfo != null)
     {
         ServiceInfo = new DisplaySetServiceInfo(displaySetToBeCopied.ServiceInfo);
     }
 }
Example #7
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="displaySetName"></param>
 public DisplaySetInformation(DisplaySetInformation displaySetToBeCopied)
     : this(displaySetToBeCopied.Name)
 {
     Custom = displaySetToBeCopied.Custom;
     foreach (DisplaySetItem item in displaySetToBeCopied.DisplaySetItems)
     {
         DisplaySetItem newItem = new DisplaySetItem(item);
         DisplaySetItems.Add(newItem);
     }
     if (displaySetToBeCopied.ServiceInfo != null)
     {
         ServiceInfo = new DisplaySetServiceInfo(displaySetToBeCopied.ServiceInfo);
     }
 }
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="item">Item to be copied</param>
 public DisplaySetItem(DisplaySetItem item)
 {
     mName                    = item.Name;
     mAlias                   = item.Alias;
     mIdXML                   = item.IdXML;
     mModelType               = item.ModelType;
     mNullAllowed             = item.NullAllowed;
     mDefinedSelectionOptions = item.DefinedSelectionOptions;
     mAgents                  = item.Agents;
     mVisible                 = item.Visible;
     mWidth                   = item.Width;
     mClassName               = item.ClassName;
     mOIDFields               = item.OIDFields;
     mSupplementaryInfo       = item.SupplementaryInfo;
 }
 /// <summary>
 /// Receives the Query controller of the scenario to be customized
 /// </summary>
 /// <param name="queryController">Query Controller</param>
 public void Initialize(DisplaySetItem item)
 {
     mItem = item;
     ApplyMultilanguage();
     LoadValues();
 }
Example #10
0
        /// <summary>
        /// Add a new DisplaySet item and opens the edit scenario
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddItem_Click(object sender, EventArgs e)
        {
            // Only custom DisplaySets can be modified
            if (SelectedDisplaySet == null || !SelectedDisplaySet.Custom)
                return;

            try
            {
                List<string> agents = new List<string>();
                agents.Add(Logics.Logic.Agent.ClassName);
                DisplaySetItem item = new DisplaySetItem("", "", "", ModelType.String, agents, 0, true);
                SelectedDisplaySet.DisplaySetItems.Add(item);

                EditDisplaySetItemForm form = new EditDisplaySetItemForm();
                form.Initialize(item);
                if (form.ShowDialog() != DialogResult.OK)
                {
                    SelectedDisplaySet.DisplaySetItems.Remove(item);
                    return;
                }
            }
            catch
            {
            }
            ShowDisplaySetItems(SelectedDisplaySet);
            gridItems.Rows[gridItems.Rows.Count - 1].Selected = true;
        }
        /// <summary>
        /// Deserialize the infotmation from XML node
        /// </summary>
        /// <param name="displaySetNode"></param>
        /// <param name="version"></param>
        public void Deserialize(XmlNode displaySetNode, string version)
        {
            Name = displaySetNode.Attributes["Name"].Value;
            // Is a custom DisplaySet
            Custom = true;

            // Get all DisplaySet items
            XmlNodeList lItemNodes = displaySetNode.SelectNodes("DisplaySetItem");
            foreach (XmlNode lItemNode in lItemNodes)
            {
                DisplaySetItem item = new DisplaySetItem();
                item.Deserialize(lItemNode, version);
                DisplaySetItems.Add(item);
            }

            // Get Service info node
            XmlNodeList lServiceNodes = displaySetNode.SelectNodes("ServiceInfo");
            if (lServiceNodes.Count == 1)
            {
                ServiceInfo = new DisplaySetServiceInfo();
                ServiceInfo.Deserialize(lServiceNodes[0], version);
            }
        }
 /// <summary>
 /// Adds an object-valued item to the DisplaySet.
 /// </summary>
 /// <param name="name">Name of the DisplaySet item.</param>
 /// <param name="alias">Alias of the DisplaySet item.</param>
 /// <param name="className">Definition class.</param>
 /// <param name="idXML">IdXML of the DisplaySet item.</param>
 /// <param name="agents">List of agents of the DisplaySet item.</param>
 /// <param name="width">Width column of the DisplaySet item.</param>
 public void Add(string name, string alias, string className, string idXML, string[] agents, int width, string[] oidFields, DisplaySetInformation supplementaryInfo)
 {
     List<string> lAgents = new List<string>(agents);
     DisplaySetItem lDisplaySetItem = new DisplaySetItem(name, alias, className, idXML, lAgents, width, true,oidFields, supplementaryInfo);
     mDisplaySetItems.Add(lDisplaySetItem);
 }
 /// <summary>
 /// Adds a DisplaySet item to the DisplaySet.
 /// </summary>
 /// <param name="name">Name of the DisplaySet item.</param>
 /// <param name="alias">Alias of the DisplaySet item.</param>
 /// <param name="idXML">IdXML of the DisplaySet item.</param>
 /// <param name="modelType">ModelType of the DisplaySet item.</param>
 /// <param name="nullAllowed">If the DisplaySet item allows null values.</param>
 /// <param name="definedSelectionOptions">List of defined selection options.</param>
 /// <param name="agents">List of agents of the DisplaySet item.</param>
 public void Add(string name, string alias, string idXML, ModelType modelType, bool nullAllowed, List<KeyValuePair<object, string>> definedSelectionOptions, string[] agents, int width)
 {
     List<string> lAgents = new List<string>(agents);
     DisplaySetItem lDisplaySetItem = new DisplaySetItem(name, alias, idXML, modelType, nullAllowed, definedSelectionOptions, lAgents, width, true);
     mDisplaySetItems.Add(lDisplaySetItem);
 }
 /// <summary>
 /// Adds a DisplaySet item to the DisplaySet.
 /// </summary>
 /// <param name="name">Name of the DisplaySet item.</param>
 /// <param name="alias">Alias of the DisplaySet item.</param>
 /// <param name="idXML">IdXML of the DisplaySet item.</param>
 /// <param name="modelType">ModelType of the DisplaySet item.</param>
 /// <param name="agents">List of agents of the DisplaySet item.</param>
 /// <param name="width">Width column of the DisplaySet item.</param>
 public void Add(string name, string alias, string idXML, ModelType modelType, string[] agents, int width)
 {
     List<string> lAgents = new List<string>(agents);
     DisplaySetItem lDisplaySetItem = new DisplaySetItem(name, alias, idXML, modelType, lAgents, width, true);
     mDisplaySetItems.Add(lDisplaySetItem);
 }
Example #15
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="item">Item to be copied</param>
 public DisplaySetItem(DisplaySetItem item)
 {
     mName = item.Name;
     mAlias = item.Alias;
     mIdXML = item.IdXML;
     mModelType = item.ModelType;
     mNullAllowed = item.NullAllowed;
     mDefinedSelectionOptions = item.DefinedSelectionOptions;
     mAgents = item.Agents;
     mVisible = item.Visible;
     mWidth = item.Width;
     mClassName = item.ClassName;
     mOIDFields = item.OIDFields;
     mSupplementaryInfo = item.SupplementaryInfo;
 }