当前位置: 首页>>代码示例>>C#>>正文


C# Flag类代码示例

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


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

示例1: FlagData

		public string FlagData(Flag flag)
		{
			string data = "";
			if (FlagUsed(flag))
				data = (string)flagUsed[flag];
			return data;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:7,代码来源:CommandLineParser.cs

示例2: TestCustomFlag2

        public void TestCustomFlag2()
        {
            var flags = new Flag<TESTENUM>(TESTENUM._1, TESTENUM._3);

            Assert.AreEqual(false, flags[TESTENUM._2]);
            Assert.AreEqual(true, flags[TESTENUM._3]);
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:7,代码来源:FlagTest.cs

示例3: SingleBarrierOption

 public SingleBarrierOption(Flag flag, SingleBarrierFlag barrierFlag, double s, double x, double k, double h, double r, double b, double t, double sigma)
     : base(flag, s, x, r, b, t, sigma)
 {
     this.h = h;
     this.k = k;
     this.barrierFlag = barrierFlag;
 }
开发者ID:gmarklow87,项目名称:OptionLib,代码行数:7,代码来源:SingleBarrierOption.cs

示例4: AddFlag

 // FLAGS
 // clearing: Removing rubble and preparing to build. Lots must be cleared before building.
 void AddFlag(string flag, int duration)
 {
     Flag f = new Flag ();
     f.name = flag;
     f.duration = duration;
     flags.Add (f);
 }
开发者ID:amberene3d,项目名称:Survival,代码行数:9,代码来源:scrLot.cs

示例5: Account

 public Account()
 {
     Competnces = new Flag<COMPETENCE>();
     Guid = Guid.NewGuid();
     Name = Id.ToString();
     Password = Id.ToString();
 }
开发者ID:jiowchern,项目名称:Regulus,代码行数:7,代码来源:Account.cs

示例6: GapOption

 /// <summary>
 /// Creates a new instance of GapOption
 /// </summary>
 /// <param name="flag">Call/Put flag</param>
 /// <param name="s">Asset price</param>
 /// <param name="x">Strike price</param>
 /// <param name="x">Strike price 2</param>
 /// <param name="r">Risk-free interest rate</param>
 /// <param name="b">Yield</param>
 /// <param name="t">Time to expiry in years</param>
 /// <param name="sigma">Asset volatility</param>
 public GapOption(Flag flag, double s, double x1, double x2, double r, double b, double t, double sigma)
     : base(flag, s, x1, r, b, t, sigma)
 {
     this.x2 = x2;
     d1 = (Math.Log(s / x) + (r - b + (0.5 * Math.Pow(sigma, 2))) * t) / (sigma * Math.Sqrt(t));
     d2 = d1 - sigma * Math.Sqrt(t);
 }
开发者ID:gmarklow87,项目名称:OptionLib,代码行数:18,代码来源:GapOption.cs

示例7: YNode

 public YNode(int depth,object key,object o,int rf,Flag flags) {
     Depth=depth;
     Key=key;
     O=o;
     Ref=rf;
     Flags=flags;
 }
开发者ID:TestAnything,项目名称:taps-testing,代码行数:7,代码来源:yamlwriter.cs

示例8: executeAnimation

 public void executeAnimation(Flag.Face.FlagFaceState f)
 {
     switch (f) {
         case Flag.Face.FlagFaceState.STATE_BLINK:
             animator.SetTrigger("blink");
             break;
         case Flag.Face.FlagFaceState.STATE_ATTACK:
             animator.SetTrigger("attack");
             break;
         case Flag.Face.FlagFaceState.STATE_CHARGE:
             animator.SetTrigger("charge");
             break;
         case Flag.Face.FlagFaceState.STATE_DANGER:
             animator.SetTrigger("danger");
             break;
         case Flag.Face.FlagFaceState.STATE_HIT:
             animator.SetTrigger("hit");
             break;
         case Flag.Face.FlagFaceState.STATE_TELL:
             animator.SetTrigger("tell");
             break;
         default:
             break;
     }
 }
开发者ID:jane22th,项目名称:Project_SSL,代码行数:25,代码来源:Face.cs

示例9: getRssData

        private string[,] getRssData(string channel)
        {
            Console.WriteLine("LOADING FEED... Please wait.");
            XmlNodeList items;
            try
            {
                WebRequest request = WebRequest.Create(channel);
                WebResponse responce = request.GetResponse();
                Stream rssStream = responce.GetResponseStream();
                XmlDocument rssDoc = new XmlDocument();
                rssDoc.Load(rssStream);
                items = rssDoc.SelectNodes("rss/channel/item");
            }
            catch (UriFormatException)
            {
                Console.Clear();

                    Console.WriteLine("\n");
                    Console.WriteLine($"Error: {channel} doesn't seem to be a valid feed URL. Exiting.");
                    Thread.Sleep(1500);

                Console.Clear();
                Flag flag = new Flag("-help");
                flag.Do();
                return null;
            }
            catch (Exception ex)
            {
                Console.Clear();

                    Console.WriteLine("\n");
                    Console.WriteLine($"Cannot load feed. Why? {ex.Message}");
                    Thread.Sleep(1500);

                Console.Clear();
                Flag flag = new Flag("-help");
                flag.Do();
                return null;
            }

            string[,] tempRssData = new string[items.Count, 3];
            for (int i = 0; i < items.Count; i++)
            {
                XmlNode rssNode;

                rssNode = items.Item(i).SelectSingleNode("title");

                if (rssNode != null) tempRssData[i, 0] = rssNode.InnerText;
                else tempRssData[i, 0] = "";

                rssNode = items.Item(i).SelectSingleNode("description");
                if (rssNode != null) tempRssData[i, 1] = rssNode.InnerText;
                else tempRssData[i, 1] = "";

                rssNode = items.Item(i).SelectSingleNode("link");
                if (rssNode != null) tempRssData[i, 2] = rssNode.InnerText;
                else tempRssData[i, 2] = "";
            }
            return tempRssData;
        }
开发者ID:Mr-Zoidberg,项目名称:CommandParser,代码行数:60,代码来源:Rss.cs

示例10: RunUntilFinish

	/// <summary>
	/// 异步调用函数并等待其完成 (有死锁风险)
	/// </summary>
	/// <param name="action">欲调用的函数</param>
	public static void RunUntilFinish(Action action, Flag cancelFlag=null)
	{
		if (IsMainThread())
			action();
		else
			RunUntilFinish(MakeCoroutineFromAction(action), cancelFlag);
	}
开发者ID:fengqk,项目名称:Art,代码行数:11,代码来源:MainThreadTask.cs

示例11: ReadCoordinates

 private static short[] ReadCoordinates(BinaryReader input, int pointCount, Flag[] flags, Flag isByte, Flag signOrSame)
 {
     var xs = new short[pointCount];
     int x = 0;
     for (int i = 0; i < pointCount; i++)
     {
         int dx;
         if (flags[i].HasFlag(isByte))
         {
             var b = input.ReadByte();
             dx = flags[i].HasFlag(signOrSame) ? b : -b;
         }
         else
         {
             if (flags[i].HasFlag(signOrSame))
             {
                 dx = 0;
             }
             else
             {
                 dx = input.ReadInt16();
             }
         }
         x += dx;
         xs[i] = (short)x; // TODO: overflow?
     }
     return xs;
 }
开发者ID:RainsSoft,项目名称:NRasterizer,代码行数:28,代码来源:Glyf.cs

示例12: CreateFlagsXML

        public String CreateFlagsXML(Flag[] flags, String personID)
        {
            // Create the xml document
            XmlDocument doc = new XmlDocument();// Create the XML Declaration, and append it to XML document
            XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "utf-8", null);
            doc.AppendChild(dec);// Create the root element
            XmlElement root = doc.CreateElement("UpdateFlags");
            doc.AppendChild(root);
            // Note that to set the text inside the element,
            // you use .InnerText instead of .Value (which will throw an exception).
            // You use SetAttribute to set attribute
            foreach (Domain.Flag curFlag in flags)
            {
                if (curFlag != null)
                {
                    XmlElement Flag = doc.CreateElement("Flag");
                    XmlElement FlagValue = doc.CreateElement("FlagValue");
                    XmlElement FlagNumber = doc.CreateElement("FlagNumber");
                    XmlElement Person_ID = doc.CreateElement("PersonID");
                    FlagValue.InnerText = curFlag.FlagValue;
                    FlagNumber.InnerText = curFlag.FlagNumber.ToString();
                    Person_ID.InnerText = personID;
                    Flag.AppendChild(FlagValue);
                    Flag.AppendChild(FlagNumber);
                    Flag.AppendChild(Person_ID);
                    root.AppendChild(Flag);
                }
            }

            string xmlOutput = doc.OuterXml;
            return xmlOutput;
        }
开发者ID:byu-oit-appdev,项目名称:IdCard,代码行数:32,代码来源:AddFlagsPresenter.cs

示例13: Unpack

 public void Unpack()
 {
     CommandId          = (UInt16)(Buffer[1] | (((UInt16)Buffer[2]) << 8));
     Flags              = (Flag)Buffer[3];
     PacketInterval     = Buffer[4];
     KeepAliveIntervalMs= (UInt16)(Buffer[5] | (((UInt16)Buffer[6]) << 8));
 }
开发者ID:CloneDeath,项目名称:VirtualHomeTheatre,代码行数:7,代码来源:SensorConfig.cs

示例14: AddFlag

        /**
         * Adds a flag
         */
        public static Flag AddFlag(string name, bool state = false)
        {
            Flag newFlag = new Flag(name, state);

            GetInstance().flags.Add(newFlag);

            return newFlag;
        }
开发者ID:Putaitu,项目名称:unity-boilerplate,代码行数:11,代码来源:FlagManager.cs

示例15: FlaggedUsersDetails

	public FlaggedUsersDetails(FlaggedUsersViewModel viewModel, Flag flag)
    {
      InitializeComponent();
	  Icon = "badge.png";
		viewModel.Flag = flag;
		Title = flag.AlertLevel.ToString();
	  BindingContext = this.viewModel = viewModel;
    }
开发者ID:richardboegli,项目名称:KinderChat,代码行数:8,代码来源:FlaggedUsersDetails.xaml.cs


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