DeleteParameter() public method

Removes an existing object from the data store.
public DeleteParameter ( ParameterInfo key ) : void
key ParameterInfo Parameter identifier.
return void
Esempio n. 1
0
 public static void ImportProviderSettings(int moduleId, XmlNode settingsNode, string providerName)
 {
     if ((settingsNode != null))
     {
         var pc = new ParameterController(providerName);
         foreach (var p in pc.GetParameters(moduleId))
         {
             pc.DeleteParameter(p.Key);
         }
         foreach (XmlNode node in settingsNode.SelectNodes(Portable.ParamElement))
         {
             if (node.Attributes == null)
             {
                 continue;
             }
             var p = new ParameterInfo
             {
                 ModuleId = moduleId,
                 Name     = node.Attributes["name"].Value,
                 Type     = node.Attributes[Portable.TypeAttribute].Value
             };
             if (p.IsArgumentRequired())
             {
                 p.TypeArgument = node.Attributes[Portable.ArgAttribute].Value;
             }
             p.IsValueRequired = (node.Attributes[Portable.ValueRequiredAttribute] != null);
             pc.AddParameter(p);
         }
     }
 }
Esempio n. 2
0
        protected void GrdParams_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                // init vars
                var objController = new ParameterController(Purpose);
                var objParamKey   = new ParameterInfo.UniqueKey
                {
                    Id = Convert.ToInt32(grdParams.DataKeys[e.Item.ItemIndex])
                };

                // delete parameter
                objController.DeleteParameter(objParamKey);

                // reset edit row
                grdParams.EditItemIndex = -1;
                BindParameters();
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        protected void GrdParams_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                // init vars
                var objController = new ParameterController(Purpose);
                var objParamKey = new ParameterInfo.UniqueKey
                                      {
                                          Id = Convert.ToInt32(grdParams.DataKeys[e.Item.ItemIndex])
                                      };

                // delete parameter
                objController.DeleteParameter(objParamKey);

                // reset edit row
                grdParams.EditItemIndex = -1;
                BindParameters();
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
 public static void ImportProviderSettings(int moduleId, XmlNode settingsNode, string providerName)
 {
     if ((settingsNode != null))
     {
         var pc = new ParameterController(providerName);
         foreach (var p in pc.GetParameters(moduleId))
         {
             pc.DeleteParameter(p.Key);
         }
         foreach (XmlNode node in settingsNode.SelectNodes(Portable.ParamElement))
         {
             if (node.Attributes == null) continue;
             var p = new ParameterInfo
                         {
                             ModuleId = moduleId,
                             Name = node.Attributes["name"].Value,
                             Type = node.Attributes[Portable.TypeAttribute].Value
                         };
             if (p.IsArgumentRequired())
                 p.TypeArgument = node.Attributes[Portable.ArgAttribute].Value;
             p.IsValueRequired = (node.Attributes[Portable.ValueRequiredAttribute] != null);
             pc.AddParameter(p);
         }
     }
 }