• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Param类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Param的典型用法代码示例。如果您正苦于以下问题:C# Param类的具体用法?C# Param怎么用?C# Param使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Param类属于命名空间,在下文中一共展示了Param类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Expected

        public Info[] Expected(Specification problem)
        {
            Function function = problem.Function.Invoke;
            Gradient gradient = problem.Gradient.Invoke;

            Param param = new Param()
            {
                m = m,
                epsilon = epsilon,
                past = past,
                delta = delta,
                max_iterations = max_iterations,
                linesearch = (int)linesearch,
                max_linesearch = max_linesearch,
                min_step = min_step,
                max_step = max_step,
                ftol = ftol,
                wolfe = wolfe,
                gtol = gtol,
                xtol = xtol,
                orthantwise_c = orthantwise_c,
                orthantwise_start = orthantwise_start,
                orthantwise_end = orthantwise_end
            };

            NativeCode = Wrapper.Libbfgs((double[])problem.Start.Clone(), function, gradient, param);

            // Convergence and success have the same
            // enumeration value in the original code
            if (NativeCode == "LBFGS_CONVERGENCE")
                NativeCode = "LBFGS_SUCCESS";

            return Wrapper.list.ToArray();
        }
开发者ID:RLaumeyer,项目名称:framework,代码行数:34,代码来源:LBFGSComparer.cs


示例2: Clone

        public virtual object Clone()
        {
            Param param = new Param();
            
            param.m_identifier = m_identifier;
            param.m_name = m_name;
            param.m_type = m_type;
            param.m_lazy = m_lazy;

            if(m_value != null)
            {
                if(m_value is IUimlElement)
                {
                    param.m_value = ((IUimlElement)m_value).Clone();
                }
                else
                {
                    param.m_value = m_value;
                }
            }
            if(m_subprop != null)
            {
                param.m_subprop = m_subprop;
            }

            param.PartTree = m_partTree;

            return param;

        }        
开发者ID:jozilla,项目名称:Uiml.net,代码行数:30,代码来源:Param.cs


示例3: AddElementToDataGridView

		private void AddElementToDataGridView(Param element)
		{
			var row = new DataGridViewRow();
			
			// пустая сточка означет разделитель между 
			// отдельными интерфейсами
			if(element.ParamName == string.Empty)
			{
				dataGridView1.Rows.Add(row);
				return;	
			}
			
			// добавляем первую ячейку
			var cell1 = new DataGridViewTextBoxCell() 
			{
			    Value = element.ParamName + ":"
			};
			cell1.Style.Font = new Font(dataGridView1.Font, FontStyle.Bold);
			row.Cells.Add(cell1);
			
			// добавляем вторую ячейку
			var cell2 = new DataGridViewTextBoxCell() 
			{
			    Value = element.ParamValue
			};
			row.Cells.Add(cell2);

			// добавляем строчку в dataGridView
			dataGridView1.Rows.Add(row);
		}
开发者ID:nemocaptm,项目名称:Mashine-side,代码行数:30,代码来源:CPU.cs


示例4: CreateSuggorateModel

        public void CreateSuggorateModel()
        {
            // configure model (do once at app startup)
            var model = RuntimeTypeModel.Default;
            model.Add(typeof(Param), false).SetSurrogate(typeof(ParamSurrogate));
            model.Add(typeof (FloatData), false).Add("Ranges", "AdjustValue", "Values");
            //TODO: other types here

            // test data
            var param = new Param
            {
                Item = new FloatData
                {
                    AdjustValue = 123.45F,
                    Ranges = new float[] { 1.0F, 2.4F },
                    Values = new float[] { 7.21F, 19.2F }
                }
            };
            // note the fallowing is the same as Serializer.DeepClone, since
            // model === RuntimeTypeModel.Default
            var clone = (Param) model.DeepClone(param);
            Assert.AreNotSame(clone, param, "Different instance");
            Assert.IsInstanceOfType(typeof(FloatData), clone.Item, "Data type");
            var data = (FloatData) clone.Item;
            Assert.AreEqual(123.45F, data.AdjustValue);
            Assert.AreEqual(2, data.Ranges.Length);
            Assert.AreEqual(1.0F, data.Ranges[0]);
            Assert.AreEqual(2.4F, data.Ranges[1]);
            Assert.AreEqual(2, data.Values.Length);
            Assert.AreEqual(7.21F, data.Values[0]);
            Assert.AreEqual(19.2F, data.Values[1]);

        }
开发者ID:GeorchW,项目名称:protobuf-net,代码行数:33,代码来源:SurrogateForObjectUsage.cs


示例5: FieldToCollection

        public static ObservableCollection<Param> FieldToCollection(string strXml)
        {
            string XmlTemplete = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + "\r\n" +
                            "<Paras>" + "\r\n" +
                            "{0}" +
                                     "</Paras>";
            XmlTemplete = string.Format(XmlTemplete, strXml);
            Byte[] b = System.Text.UTF8Encoding.UTF8.GetBytes(XmlTemplete);
            XElement xele = XElement.Load(System.Xml.XmlReader.Create(new MemoryStream(b)));

            var Param = from item in xele.Descendants("Para")
                        select item;
            ObservableCollection<Param> List = new ObservableCollection<Param>();
            foreach (var vv in Param)
            {
                Param r = new Param();
                r.FieldID = vv.Attribute("Value").Value.CvtString().Replace("{", "").Replace("}", "");
                try
                {
                    r.FieldName = vv.Attribute("ValueName").Value.CvtString();
                }
                catch
                {
                    r.FieldName = string.Empty;
                }
                r.Description = vv.Attribute("Description").Value.CvtString();
                r.TableName = vv.Attribute("TableName").Value.CvtString();
                r.ParamID = vv.Attribute("Name").Value.CvtString();
                r.ParamName = vv.Attribute("Description").Value.CvtString();
                List.Add(r);
            }
            return List;
        }
开发者ID:JuRogn,项目名称:OA,代码行数:33,代码来源:ParamOperate.cs


示例6: GetContiguousAcres

        /// <summary>
        /// Returns the contiguous acres associated with the user. This method does NOT
        /// populate the contiguous acres' wells property.
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public List<ContiguousAcres> GetContiguousAcres(int userId, bool includeNonOwned)
        {
            Param[] nonOwnedCAParams = new Param[] {};
            string[] nonOwnedCAParamNames = null;
            if (includeNonOwned) {
                var caIds = new PropertyDalc().GetAssociatedCAIds(userId);
                if (caIds.Count() == 0) {
                    // No associations exist; don't even try to retrieve them.
                    includeNonOwned = false;
                } else {
                    nonOwnedCAParams = ParameterizeInClause("caId", out nonOwnedCAParamNames, caIds.ToArray());
                }
            }

            return ExecuteDataTable(@"
            select
            ca.OBJECTID,
            ca.caID,
            ca.area as area_m2,
            ca.admin_area as area_acres,
            ca.description,
            ca.approved,
            ca.actingId
            from HP_CONTIGUOUS_ACRES" + dbTableSuffix + @" ca
            where
            (ca.actingId = @id" + (includeNonOwned
                        ? " or ca.caId in (" + string.Join(", ", nonOwnedCAParamNames) + "))"
                        : ")") + @"
            and isnull(ca.Deletion, '') <> 'True';",
                        new Param[] { new Param("@id", userId) }.Concat(nonOwnedCAParams).ToArray()
                ).AsEnumerable().Select(row => GetCAFromDataRow(row)).ToList();
        }
开发者ID:jiadreamran,项目名称:HPAuthenticate,代码行数:38,代码来源:GisDalc.cs


示例7: Parse

 /// <summary>
 /// This static method parses the command line, storing the parameter values, and
 /// returning the index of the first non-option command line argument.
 /// </summary>
 /// <param name="args"></param>
 /// <param name="rgParam"></param>
 /// <param name="index"></param>
 /// <returns></returns>
 public static bool Parse(string[] args, ref Param[] rgParam, out int index)
 {
     index = args.Length;
     try
     {
         for (int i = 0; i < args.Length; ++i)
         {
             if (args[i].StartsWith("-"))
             {
                 bool fOk;
                 if (args[i].StartsWith("--"))
                     fOk = CheckLongParamNames(args, rgParam, ref i);
                 else
                     fOk = CheckShortParamNames(args, rgParam, ref i);
                 if (!fOk)
                     throw new Exception(String.Format("Invalid option found in {0}", args[i]));
             }
             else
             {
                 index = i;
                 return true;
             }
         }
         index = args.Length;
         return true;
     }
     catch (Exception ex)
     {
         s_sError = ex.Message;
         return false;
     }
 }
开发者ID:sillsdev,项目名称:FwSupportTools,代码行数:40,代码来源:GetOptions.cs


示例8: Usage

 /// <summary>
 ///
 /// </summary>
 /// <param name="rgParam"></param>
 public static void Usage(Param[] rgParam)
 {
     int cLen = 0;
     for (int i = 0; i < rgParam.Length; ++i)
     {
         if (!String.IsNullOrEmpty(rgParam[i].LongName))
         {
             int cch = rgParam[i].LongName.Length;
             if (cLen < cch)
                 cLen = cch;
         }
     }
     cLen += 4;
     for (int i = 0; i < rgParam.Length; ++i)
     {
         string sShort;
         if (String.IsNullOrEmpty(rgParam[i].ShortName))
             sShort = "  ";
         else
             sShort = String.Format("-{0}", rgParam[i].ShortName);
         string sLong;
         if (String.IsNullOrEmpty(rgParam[i].LongName))
             sLong = "    ";
         else
             sLong = String.Format("(--{0})", rgParam[i].LongName);
         while (sLong.Length < cLen)
             sLong = sLong + " ";
         string sLine = String.Format("  {0} {1} = {2}",
             sShort, sLong, rgParam[i].Description);
         Console.WriteLine(sLine);
     }
 }
开发者ID:sillsdev,项目名称:FwSupportTools,代码行数:36,代码来源:GetOptions.cs


示例9: AddParameter

 internal void AddParameter(string name, string sval)
 {
     Param p = new Param();
     p.ParamName = name;
     p.ParamValue = sval;
     Parameters.Add(p);
 }
开发者ID:CBenghi,项目名称:UnnItBooster,代码行数:7,代码来源:ReportServer.cs


示例10: Tv

 public Tv(string nameTv, bool stateTv, Channels channelCur, byte volumeCur, byte brightCur)
     : base(nameTv, stateTv)
 {
     channel = channelCur;
     volume = new Param(volumeCur, 1, 5);
     bright = new Param(brightCur, 1, 5);
 }
开发者ID:agorishniy,项目名称:SmartHouseWebForm,代码行数:7,代码来源:Tv.cs


示例11: Expected

        public Info[] Expected(Specification problem)
        {
            Function function = problem.Function.Invoke;
            Gradient gradient = problem.Gradient.Invoke;

            Param param = new Param()
            {
                m = m,
                epsilon = epsilon,
                past = past,
                delta = delta,
                max_iterations = max_iterations,
                linesearch = (int)linesearch,
                max_linesearch = max_linesearch,
                min_step = min_step,
                max_step = max_step,
                ftol = ftol,
                wolfe = wolfe,
                gtol = gtol,
                xtol = xtol,
                orthantwise_c = orthantwise_c,
                orthantwise_start = orthantwise_start,
                orthantwise_end = orthantwise_end
            };

            NativeCode = Wrapper.Libbfgs((double[])problem.Start.Clone(), function, gradient, param);

            return Wrapper.list.ToArray();
        }
开发者ID:KommuSoft,项目名称:accord_framework,代码行数:29,代码来源:LBFGSComparer.cs


示例12: GetParamByID

        public static ParamInfo GetParamByID(int paramid)
        {
            Param pra = new Param();

            if (!enableCaching)
                return pra.GetParamByID(paramid);

            string key = "param_" + paramid;

            ParamInfo data = (ParamInfo)HttpRuntime.Cache[key];

            // Check if the data exists in the data cache
            if (data == null)
            {
                // If the data is not in the cache then fetch the data from the business logic tier
                data = pra.GetParamByID(paramid);

                // Create a AggregateCacheDependency object from the factory
                AggregateCacheDependency cd = DependencyFacade.GetDeviceDependency();

                // Store the output in the data cache, and Add the necessary AggregateCacheDependency object
                HttpRuntime.Cache.Add(key, data, cd, DateTime.Now.AddHours(ParamTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            }

            return data;

        }
开发者ID:liyangshiren,项目名称:FWMoniter,代码行数:27,代码来源:ParamDataProxy.cs


示例13: GenerateMethod

        private static void GenerateMethod()
        {
            Method method = new Method();
            method.Name = "MyNewProc";
            method.MethodType = MethodTypeEnum.Void;
            Param newParam = new Param();
            TypeReferenceExpression newTypeReferenceExpression = new TypeReferenceExpression();
            newTypeReferenceExpression.Name = CodeRush.Language.GetSimpleTypeName("System.Int32");
            newParam.MemberTypeReference = newTypeReferenceExpression;
            newParam.Name = "MyKillerParameter";

            method.Parameters.Add(newParam);

            MethodCall statement = new MethodCall();
            statement.Name = "Start";
            //UnaryIncrement newUnaryIncrement = new UnaryIncrement();
            //ElementReferenceExpression elementReferenceExpression = new ElementReferenceExpression(newParam.Name);
            //newUnaryIncrement.Expression = elementReferenceExpression;
            //statement.AddDetailNode(newUnaryIncrement);
            //int MyKillerParameter = 0;
            //MyKillerParameter++;

            method.AddNode(statement);
            string newCode = CodeRush.Language.GenerateElement(method);
            TextDocument activeTextDocument = CodeRush.Documents.ActiveTextDocument;
            if (activeTextDocument == null)
                return;

            activeTextDocument.InsertText(activeTextDocument.ActiveView.Caret.SourcePoint, newCode);
        }
开发者ID:modulexcite,项目名称:CR_OptionsInverter,代码行数:30,代码来源:PlugIn1.cs


示例14: MyMethod

		public void MyMethod(Param stateIdentifier)
		{
			GetSate(stateIdentifier);
			counter++;
			var sessionId = OperationContext.Current.SessionId;
			Trace.WriteLine(string.Format("Counter = {0}, SessionId = {1}", counter, sessionId));
			SaveState(stateIdentifier);
		}
开发者ID:Helen1987,项目名称:edu,代码行数:8,代码来源:MyService.svc.cs


示例15: AddParam

        private static void AddParam(Param p)
        {
            if (_params.Count > 0)
                _allParams.Append(", ");
            _allParams.Append(p.Name);

            _params.Add(p.Name.ToLower(), p);
        }
开发者ID:Bedrok,项目名称:800craft,代码行数:8,代码来源:LifeHandler.cs


示例16: DecryptParams

        public static Param[] DecryptParams(string Parameters)
        {
            Parameters = "*" + Parameters;      // musim pridat '*'
            Param[] retParams = null;
            const char ParamStart = '*';
            const char ParamSeparator = '&';
            const char ParamEqual = '=';
            int i = Parameters.IndexOf(ParamStart);
            //int i = 0;
            int j = i;
            int k;

            if (i >= 0)
            {
                while ((i < Parameters.Length) || (i == -1))
                {
                    j = Parameters.IndexOf(ParamEqual, i);
                    if (j > i)
                    {
                        if (retParams == null)
                        {
                            retParams = new Param[1];
                            retParams[0] = new Param();
                        }
                        else
                        {
                            Param[] rettempParams = new Param[retParams.Length + 1];
                            retParams.CopyTo(rettempParams, 0);
                            rettempParams[rettempParams.Length - 1] = new Param();
                            retParams = new Param[rettempParams.Length];
                            rettempParams.CopyTo(retParams, 0);
                        }
                        k = Parameters.IndexOf(ParamSeparator, j);
                        retParams[retParams.Length - 1].Name = Parameters.Substring(i + 1, j - i - 1);

                        if (k == j)
                        {
                            retParams[retParams.Length - 1].Value = "";
                        } 
                        else if (k > j)
                        {
                            retParams[retParams.Length - 1].Value = Parameters.Substring(j + 1, k - j - 1);
                        } 
                        else
                        {
                            retParams[retParams.Length - 1].Value = Parameters.Substring(j + 1, Parameters.Length - j - 1);
                        }
                        if (k > 0)
                            i = Parameters.IndexOf(ParamSeparator, k);
                        else
                            i = Parameters.Length;
                    }
                    else
                        i = -1;
                }
            }
            return retParams;
        }
开发者ID:TomasFilingr,项目名称:WineDispenser-BASIC,代码行数:58,代码来源:Decrypt.cs


示例17: SerialCommunicationForm

 public SerialCommunicationForm(Sync syn, PLCState plcS, Queue<Orientamento> list)
 {
     this.microToPLC = list;
     this.syncPolling = new Sync();
     this.ComPort = new SerialPort();
     this.param = Param.getInstance();
     this.plcState = plcS;
     init();
 }
开发者ID:xiaomailong,项目名称:PLC-to-STM32F4-communication-through-PC-as-gateway,代码行数:9,代码来源:SerialCommunicationForm.cs


示例18: decryptParam

        public static Param[] decryptParam(String Parameters)
        {
            Param[] retParams = null;
            int i = Parameters.IndexOf(ParamStart);
            int j = i;
            int k;
            
            if (i >= 0)
            {
                //look at the number of = and ;

                while ((i < Parameters.Length) || (i == -1))
                {
                    j = Parameters.IndexOf(ParamEqual, i);
                    if (j > i)
                    {
                        //first param!
                        if (retParams == null)
                        {
                            retParams = new Param[1];
                            retParams[0] = new Param();
                        }
                        else
                        {
                            Param[] rettempParams = new Param[retParams.Length + 1];
                            retParams.CopyTo(rettempParams, 0);
                            rettempParams[rettempParams.Length - 1] = new Param();
                            retParams = new Param[rettempParams.Length];
                            rettempParams.CopyTo(retParams, 0);
                        }
                        k = Parameters.IndexOf(ParamSeparator, j);
                        retParams[retParams.Length - 1].Name = Parameters.Substring(i + 1, j - i - 1);
                        //case'est la fin et il n'y a rien
                        if (k == j)
                        {
                            retParams[retParams.Length - 1].Value = "";
                        } // cas normal
                        else if (k > j)
                        {
                            retParams[retParams.Length - 1].Value = Parameters.Substring(j + 1, k - j - 1);
                        } //c'est la fin
                        else
                        {
                            retParams[retParams.Length - 1].Value = Parameters.Substring(j + 1, Parameters.Length - j - 1);
                        }
                        if (k > 0)
                            i = Parameters.IndexOf(ParamSeparator, k);
                        else
                            i = Parameters.Length;
                    }
                    else
                        i = -1;
                }
            }
            return retParams;
        }
开发者ID:TomasFilingr,项目名称:EASY-WINE,代码行数:56,代码来源:WebServer.cs


示例19: _value_ValueChanged

 void _value_ValueChanged(Param.Parameter sender)
 {
     if (Param == null) return;
     if (Param.Value == null)
     {
         lblProjection.Text = "";
         return;
     }
     lblProjection.Text = Param.Value.ToProj4String();
 }
开发者ID:zhongshuiyuan,项目名称:mapwindowsix,代码行数:10,代码来源:ProjectionElement.cs


示例20: PackagePayload

 /// <summary>
 /// Serializes the Payload object into a valid JSON string if no arguments are supplied, otherwise converts the arguments into a JSON string
 /// WARNING! defaults to isPublic=TRUE!
 /// </summary>
 /// <param name="param"></param>
 /// <param name="query"></param>
 /// <param name="type"></param>
 /// <param name="isPublic"></param>
 /// <param name="filter"></param>
 /// <param name="apikey"></param>
 /// <returns></returns>
 public string PackagePayload(Param param, string query =null, string type=null, bool isPublic=true, string filter=null, string apikey=null)
 {
     this.param = param;
     this.query = query;
     this.type = type;
     this.isPublic = isPublic;
     this.filter = filter;
     this.apikey = apikey;
     return JsonConvert.SerializeObject(this, jsonsettings);
 }
开发者ID:j0z,项目名称:SwanBot,代码行数:21,代码来源:Payload.cs



注:本文中的Param类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ParamCommandComment类代码示例发布时间:2022-05-24
下一篇:
C# ParallelOptions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap