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


C# Modes类代码示例

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


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

示例1: Configure

        private void Configure()
        {
            var validLabels = new Regex("^(data|css):");

            if (validLabels.IsMatch(Parameters[0]))
            {
                string[] subParm = Parameters[0].Split(':');
                string methodName = subParm[0];

                if (methodName == "data")
                {
                    Mode = Modes.Data;
                }
                else if (methodName == "css")
                {
                    Mode = Modes.Css;
                }
                else
                {
                    throw new ArgumentException("Unknown mode for regex pseudoselector.");
                }
                Property = subParm[1];
            }
            else
            {
                Mode = Modes.Attr;
                Property = Parameters[0];
            }

            // The expression trims whitespace the same way as the original
            // Trim() would work just as well but left this way to demonstrate
            // the CsQuery "RegexReplace" extension method

            Expression = new Regex(Parameters[1].RegexReplace(@"^\s+|\s+$", ""), RegexOptions.IgnoreCase | RegexOptions.Multiline);
        }
开发者ID:emrahoner,项目名称:CsQuery,代码行数:35,代码来源:Regex.cs

示例2: Streaming

        /**
         * Constructor.
         */
        public Streaming()
        {
            log.Trace("Creating streaming server");
            this.livePublishingPoint = null;
            this.onDemandPublishingPoint = null;
            this.onDemandState = State.Stopped;
            this.liveState = State.Stopped;
            this.mode = Modes.None;

            this.wmServer = new WMSServerClass();

            // Remove existing publishing points
            for (int i = 0; i < this.wmServer.PublishingPoints.length; ++i)
            {
                log.Trace("Existing publishing points = " + this.wmServer.PublishingPoints.length);
                if (this.wmServer.PublishingPoints[i].Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST ||
                    this.wmServer.PublishingPoints[i].Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_ON_DEMAND)
                {
                    try
                    {
                        this.wmServer.PublishingPoints.Remove(i);
                        i--;
                    }
                    catch (Exception e)
                    {
                        log.ErrorException("Exception raised while removing publishing point: " + e.Message, e);
                    }
                }
            }
        }
开发者ID:ejgarcia,项目名称:isabel,代码行数:33,代码来源:Streaming.cs

示例3: getInternetURL

        protected override string getInternetURL(int x, int y, int zoom, Modes mode, int server_balance)
        {
            string url;
            int max = 1 << zoom;

            switch (mode)
            {
                case Modes.MAP: // Microsoft MAP http://r2.ortho.tiles.virtualearth.net/tiles/r033110?g=81&shading=hill
                    url = "http://r"+server_balance+".ortho.tiles.virtualearth.net/tiles/r";
                    url += Pos2StrMicrosoft(x, y, zoom) + ".png?g=81&shading=hill";
                    break;
                case Modes.SAT: // Microsoft SAT http://a2.ortho.tiles.virtualearth.net/tiles/a0.jpeg?g=81
                    url = "http://a" + server_balance + ".ortho.tiles.virtualearth.net/tiles/a";
                    url += Pos2StrMicrosoft(x, y, zoom) + ".jpeg?g=81";
                    break;
                case Modes.MAP_SAT: // Microsoft MAP+OVL! http://h2.ortho.tiles.virtualearth.net/tiles/h0.jpeg?g=81
                    url = "http://h" + server_balance + ".ortho.tiles.virtualearth.net/tiles/h";
                    url += Pos2StrMicrosoft(x, y, zoom) + ".jpeg?g=81";
                    break;
                default:
                    url = "";
                    break;
            }


            return url;

        }
开发者ID:rajeper,项目名称:ikarus-osd,代码行数:28,代码来源:MicrosoftProxy.cs

示例4: HardMode

 public HardMode(Modes mode, Random rnd, City[] cities)
 {
     this.mode = mode;
     this.rnd = rnd;
     this.cities = cities;
     this.removedEdges = new HashSet<Edge>();
 }
开发者ID:THEMVFFINMAN,项目名称:TSP,代码行数:7,代码来源:HardMode.cs

示例5: ReadArguments

        private static void ReadArguments(string[] args)
        {
            if (args.Length >= 3 && args[0] == "refill")
              {
            _mode = Modes.Refill;
            _refillName = args[1];
            _refillAmount = args[2];
              }
              else if (args.Length > 0 && args[0] == "spend")
              {
            _mode = Modes.Spend;
              }
              else
              {
            Console.Error.WriteLine(@"Usage:
            refill <name> <amount>
            Reader will save name and amount to any cards inserted.

            spend
            Once a card is inserted, ""<name>/<amount>"" is sent to stdout.
            The reader waits for a line on stdin - if this line has the form ""charge/<amount>"", the amount is charged from the card.
            No validation is performed; this must be done on the client side.");

            Environment.Exit(2);
              }
        }
开发者ID:jeffton,项目名称:Pervasive-Assignment-2,代码行数:26,代码来源:Program.cs

示例6: ImageQuery

 public ImageQuery(int x, int y, int zoom, Modes mode)
 {
     this.x = x;
     this.y = y;
     this.zoom = zoom;
     this.mode = mode;
 }
开发者ID:rajeper,项目名称:ikarus-osd,代码行数:7,代码来源:ImageQuery.cs

示例7: putImage

        public void putImage(int x, int y, int zoom, Modes mode, Bitmap img)
        {
            int older = 0, i;
            bool encontrado = false;
            try
            {
                if (img != null && img.Height * img.Width > 0)
                {
                    for (i = 0; i < cacheSize && !encontrado; i++)
                    {
                        if (cachelastaccess[i] < cachelastaccess[older])
                            older = i;
                        if (cacheQuery[i].x == x && cacheQuery[i].y == y && cacheQuery[i].zoom == zoom && cacheQuery[i].mode.Equals(mode))
                        {
                            cachelastaccess[i] = cachetimer;
                            cacheImage[i] = img;
                            encontrado = true;
                        }
                    }

                    if (!encontrado)
                    {
                        cacheImage[older] = img;
                        cachelastaccess[older] = cachetimer;

                        cacheQuery[older].x = x;
                        cacheQuery[older].y = y;
                        cacheQuery[older].zoom = zoom;
                        cacheQuery[older].mode = mode;
                    }
                }
            }
            catch (Exception) { Console.WriteLine("Rafa"); }
        }
开发者ID:rajeper,项目名称:ikarus-osd,代码行数:34,代码来源:ImageCache.cs

示例8: Editor

        public Editor(Viewport view, ContentManager content, int screenWidth, int screenHeight)
        {
            mode = Modes.View;

            currentLevel = new Level(new Vector2(100, 100), "");
            currentLevel.populateWithGrid(content);

            Width = 32 * 100;
            Height = 32 * 100;

            EditorCamera = new EditorCamera(view, Width, Height, 1.0f);

            Margin = 2;     // MAGIC NUMBERS YAY
            Layer = 2;

            initDialogBoxes(content, screenWidth, screenHeight);

            CursorPosition = Vector2.Zero;

            TileText = new InfoText(content, "Tilesheet", new Vector2(370, -315));  // again, MAGIC NUMBERS!

            SelectedTile = null;

            HelpDiag = false;
        }
开发者ID:zeOxx,项目名称:SideSouler,代码行数:25,代码来源:Editor.cs

示例9: GetModeChanges

        private static Modes GetModeChanges(string[] parameterWords)
        {
            var modes = new Modes();
            var modeWord = parameterWords[0];

            var currentModifier = modeWord[0];

            for (var i = 1; i < modeWord.Length; i++)
            {
                if (modeWord[i] == '+' || modeWord[i] == '-')
                {
                    if (modeWord[i] != currentModifier)
                    {
                        currentModifier = modeWord[i];
                    }
                }

                else
                {
                    var isOn = currentModifier == '+';
                    var mode = new Mode() { Identifier = modeWord[i].ToString(), IsOn = isOn };
                    modes.Add(mode);
                }
            }
            return modes;
        }
开发者ID:mikoskinen,项目名称:ircbot-dotnet,代码行数:26,代码来源:ModeChangeParser.cs

示例10: EbayBaseRepository

        public EbayBaseRepository(IUnitOfWork context, Modes mode, SiteCodeType siteCode)
            : base(context)
        {
            if (context == null) { throw new NotImplementedException("IUnitOfWork"); }

            _mode = mode;
            _siteCode = siteCode;
        }
开发者ID:MonolithCode,项目名称:DropShip,代码行数:8,代码来源:EbayBaseRepository.cs

示例11: hasMode

 public bool hasMode(Modes m)
 {
     Modes[] modos = getModes();
     for (int i = 0; i < modos.Length; i++)
         if (modos[i] == m)
             return true;
     return false;
 }
开发者ID:rajeper,项目名称:ikarus-osd,代码行数:8,代码来源:ImageProxy.cs

示例12: RelativeVector

 /// <summary>
 /// value is relative to unit's position
 /// </summary>
 /// <param name="RelativeUnit">unit to be used as a pivot</param>
 /// <param name="Angle">angle between pivot.forward and direction from pivot to this vector</param>
 /// <param name="Dist">dist from pivot to this vector</param>
 public RelativeVector(IUnit RelativeUnit, float Angle, float Dist)
 {
     relativeUnit1 = RelativeUnit;
     dist = Dist;
     angle = Angle;
     rotationOnAngle = Matrix.CreateRotation(angle);
     mode = Modes.UnitsSideAndDist;
 }
开发者ID:Lord-Prizrak,项目名称:codecraft-game,代码行数:14,代码来源:RelativeVector.cs

示例13: ScriptEngine

 public ScriptEngine()
 {
     _inDo = false;
     _mode = Modes.Simple;
     ExecutionMode = ExecutionModes.Normal;
     CurrentScript = new Script();
     CurrentDecision = new DecisionOrList();
 }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:8,代码来源:ScriptEngine.cs

示例14: NotificationBattle

 private void NotificationBattle(Modes.BattleResult battleResult)
 {
     AMing.Plugins.Core.GenericMessager.Current.SendToNotification(new Plugins.Core.Models.MessageItem
     {
         Title = string.Format("战斗结束  {0}", battleResult.WinRank),
         Content = battleResult.GetShip == null ? "没有捞到船" : string.Format("捕获到野生的 {0}", battleResult.GetShip.Name)
     });
 }
开发者ID:vista3344,项目名称:KcvPlugins,代码行数:8,代码来源:LoggerModules.cs

示例15: RequestModeChange

 public void RequestModeChange(Modes requestedMode, IView viewRegisterRequest)
 {
     if (this.registeredViews != null && this.registeredViews.Contains(viewRegisterRequest))
     {
         modeChangeRequest = true;
         modeRequested = requestedMode;
     }
 }
开发者ID:Scubaboy,项目名称:QuadUnity3DApp,代码行数:8,代码来源:BaseViewController.cs


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