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

C# Modes类代码示例

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

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



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


示例16: StartMode

        // Start the specified game mode
        public void StartMode(Modes.Mode mode)
        {
            m_CurrentMode = mode;

            GridMainMenu.Visibility = Visibility.Collapsed;
            GridGameScreen.Visibility = Visibility.Visible;

            mode.StartMode();
        }
开发者ID:ImWithDerp,项目名称:BallPaddle,代码行数:10,代码来源:MainWindow.xaml.cs


示例17: AzureFileSystem

        // Constructor
        public AzureFileSystem(String userName, String password, String containerName, Modes mode)
        {
            _userName = userName;
            _password = password;

            // Set container name (if none specified, specify the development container default)
            _containerName = !String.IsNullOrEmpty(containerName) ? containerName : "DevelopmentContainer";
            _provider = new AzureBlobStorageProvider(containerName);
        }
开发者ID:meganmcchesney,项目名称:CURTeCommerce,代码行数:10,代码来源:AzureFileSystemObject.cs


示例18: ChangeCam

 // -----------------------------------------------------
 // switch camera
 private void ChangeCam()
 {
     if(currentCam != Modes.mAligned){ // if different than last one
         currentCam++;
     }
     else{
         currentCam = 0;
     }
 }
开发者ID:nicovillanueva,项目名称:Asteroids,代码行数:11,代码来源:Cam.cs


示例19: OnInspectorGUI

	public override void OnInspectorGUI()
	{
		HouseController hc = (HouseController) target;
		DrawDefaultInspector();
		GUILayout.Label("Cells: "+hc.EditorGetCellCount());
		GUILayout.Label("House price: "+hc.EditorGetCellCount()*hc.LevelConditions.PricePerCell);

		if(GUILayout.Button(state!=Modes.Idle? "Disable editor": "Enable editor"))
		{
			if(state!=Modes.Idle)
				state = Modes.Idle;
			else
			{
				state = Modes.PlaceCell;

				hc.EditorCheckCells();
			}	
		}

		if(state!=Modes.Idle)
		{
			GUILayout.Label("Current mode: "+System.Enum.GetName(typeof(Modes),state));

			if(GUILayout.Button("Place cells"))
			{
				state = Modes.PlaceCell;
			}
			if(GUILayout.Button("Delete cell"))
			{
				state = Modes.RemoveCell;
			}
			if(GUILayout.Button("Place thick walls"))
			{
				state = Modes.PlaceThickWall;
			}
			if(GUILayout.Button("Place windows"))
			{
				state = Modes.PlaceWindow;
			}
			if(GUILayout.Button("Place entrance"))
			{
				state = Modes.PlaceEntrance;
			}
			if(GUILayout.Button("Place garage"))
			{
				state = Modes.PlaceGarage;
			}
			if(GUILayout.Button("Clear Level"))
			{

				if(EditorUtility.DisplayDialog("Clear Level?","Everything will be removed (no undo)","Ok","Cancel"))
					hc.EditorRemoveAll();
			}

		}
	}
开发者ID:PentagramPro,项目名称:HouseCraft,代码行数:56,代码来源:HouseEditor.cs


示例20: Update

	// Update is called once per frame
	void Update () {
		if(state==Modes.Moving)
		{
			transform.position = Vector3.MoveTowards(transform.position,newTargetPos,
			                                         moveSpeed*Time.smoothDeltaTime);
			if(transform.position==newTargetPos)
				state = Modes.Idle;
		}

	}
开发者ID:PentagramPro,项目名称:HouseCraft,代码行数:11,代码来源:CameraController.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Modification类代码示例发布时间:2022-05-24
下一篇:
C# Models类代码示例发布时间: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