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

C# Dir类代码示例

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

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



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

示例1: CreatePackageList

 static IEnumerable<Package> CreatePackageList(
     string name,
     string path,
     IEnumerable<Package> packageListConfig)
 {
     var firstPackage = packageListConfig.First();
     var dir = new Dir(new DirectoryInfo(path), "");
     var remainder = dir.FileList().ToHashSet();
     foreach (var p in packageListConfig.Skip(1))
     {
         var fileList = dir.FileList(p.FileList);
         remainder.ExceptWith(fileList);
         yield return new Package(
             name:
                 name +
                 "_" +
                 p.Name.Select(n => n, () => string.Empty),
             package: p,
             fileList: fileList
         );
     }
     //
     remainder.UnionWith(dir.FileList(firstPackage.FileList));
     yield return new Package(
         name: name,
         package: firstPackage,
         fileList: remainder
     );
 }
开发者ID:AndreGleichner,项目名称:getboost,代码行数:29,代码来源:Program.cs


示例2: attr

        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            Shape? shape = null,
            Length[] coords = null,
            string href = null,
            NoHref? nohref = null,
            Target target = null,
            string alt = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            char? accesskey = null,
            int? tabindex = null,
            string onfocus = null,
            string onblur = null
        )
        {
            Shape = shape;
            Coords = coords;
            Href = href;
            NoHref = nohref;
            Target = target;
            Alt = alt;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            AccessKey = accesskey;
            TabIndex = tabindex;
            OnFocus = onfocus;
            OnBlur = onblur;

            return this;
        }
开发者ID:bzure,项目名称:BSA.Net,代码行数:62,代码来源:TagArea.cs


示例3: attr

        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string abbr = null,
            string axis = null,
            string headers = null,
            Scope? scope = null,
            int? rowspan = null,
            int? colspan = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            Align? align = null,
            char? @char = null,
            Length charoff = null,
            Valign? valign = null
        )
        {
            Abbr = abbr;
            Axis = axis;
            Headers = headers;
            Scope = scope;
            RowSpan = rowspan;
            ColSpan = colspan;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            Align = align;
            Char = @char;
            CharOff = charoff;
            Valign = valign;

            return this;
        }
开发者ID:bzure,项目名称:BSA.Net,代码行数:62,代码来源:TagTd.cs


示例4: IfNoCorridor_ShouldSucceed_IfCorridorExists

        public void IfNoCorridor_ShouldSucceed_IfCorridorExists(Dir dir)
        {
            var cell = new MapCell();
            cell.Sides[dir] = Side.Empty;

            Assert.That(() => ThrowD.IfNoCorridor(cell, dir), Throws.Nothing);
        }
开发者ID:CatSkald,项目名称:Roguelike,代码行数:7,代码来源:ThrowDTests.cs


示例5: HasDir

    public bool HasDir(CellLocation location, Dir dir)
    {
        CellType testType;

        if (dir == Dir.North)
            testType = caveCellGrid[location.x, location.y, location.z + 1];

        else if (dir == Dir.South)
            testType = caveCellGrid[location.x, location.y, location.z - 1];

        else if (dir == Dir.East)
            testType = caveCellGrid[location.x + 1, location.y, location.z];

        else if (dir == Dir.West)
            testType = caveCellGrid[location.x - 1, location.y, location.z];

        else if (dir == Dir.NorthEast)
            testType = caveCellGrid[location.x + 1, location.y, location.z + 1];

        else if (dir == Dir.NorthWest)
            testType = caveCellGrid[location.x - 1, location.y, location.z + 1];

        else if (dir == Dir.SouthEast)
            testType = caveCellGrid[location.x + 1, location.y, location.z - 1];

        else
            testType = caveCellGrid[location.x - 1, location.y, location.z - 1];

        if (testType == CellType.RockFloor) {

            return true;
        }

        return false;
    }
开发者ID:Antrum,项目名称:Unity,代码行数:35,代码来源:CaveGenerator.cs


示例6: ComparisonTest

        public void ComparisonTest(DnxSdk sdk)
        {
            var file1a = new JObject
            {
                ["info"] = "foo"
            };

            var file1b = new JObject
            {
                ["info"] = "bar1"
            };

            var project1 = new Dir
            {
                ["file1"] = file1a,
                ["file2"] = file1b
            };

            var file2a = new JObject
            {
                ["info"] = "foo"
            };

            var file2b = new JObject
            {
                ["info"] = "bar2"
            };

            var project2 = new Dir
            {
                ["file1"] = file2a,
                ["file2"] = file2b
            };

            var project3 = new Dir
            {
                ["file1"] = file2a,
                ["file2"] = new DirItem(Dir.EmptyFile, skipComparison: true)
            };

            var project4 = new Dir
            {
                ["subdir1"] = project1,
                ["subdir2"] = project1
            };

            var project5 = new Dir
            {
                ["subdir1"] = new DirItem(project2, skipComparison: true),
                ["subdir2"] = project2
            };

            DirAssert.Equal(project1, project2, compareContents: false);
            DirAssert.Equal(project1, project3, compareContents: false);
            DirAssert.Equal(project1, project3);
            DirAssert.Equal(project2, project3);
            //DirAssert.Equal(project4, project5); // this should fail, but only subdir2 should be different

            TestUtils.CleanUpTestDir<DnuPublishTests>(sdk);
        }
开发者ID:rajeevkb,项目名称:dnx,代码行数:60,代码来源:DnuCommonUtilTests.cs


示例7: SwapSkyBox_Cor

    // 스카이 박스 스왑
    IEnumerator SwapSkyBox_Cor(Dir dir)
    {
        float time = 0;

        //  오른쪽으로 갈때
        while (Dir.RIGHT == dir && time < 1)
        {
            time += Time.smoothDeltaTime / durationTime;
            blend = Mathf.Lerp(blend, 1f, time);
            RenderSettings.skybox.SetFloat("_Blend", blend);

            if (blend >= 0.99)
            {
                break;
            }
            yield return null;
        }
        
        // 왼쪽으로 갈때
        while (Dir.LEFT == dir && time < 1)
        {
            time += Time.smoothDeltaTime / durationTime;
            blend = Mathf.Lerp(blend, 0f, time);
            RenderSettings.skybox.SetFloat("_Blend", blend);
            
            if (blend <= 0.01)
            {
                break;
            }
            yield return null;      
        }
    }
开发者ID:FinishProject,项目名称:Secreto,代码行数:33,代码来源:SkyBoxMgr.cs


示例8: MoveInDirection_MovesInCorrectDirection

        public void MoveInDirection_MovesInCorrectDirection(int newWidth, int newHeight, Dir dir)
        {
            var point = new Point(5, 5);

            Assert.That(DirHelper.MoveInDir(point, dir),
                Is.EqualTo(new Point(newWidth, newHeight)));
        }
开发者ID:CatSkald,项目名称:Roguelike,代码行数:7,代码来源:DirHelperTests.cs


示例9: Moveing

    public IEnumerator Moveing(Transform startTr, Dir moveDir, float speed )
    {
        StartCoroutine(OffActive());
        gameObject.transform.position = startTr.position;
        thisTr = gameObject.transform;
        moveVector = startTr.position;


        while (true)
        {
            if (!gameObject.activeSelf)
                break;

            switch (moveDir)
            {
                case Dir.LEFT:
                    moveVector.x = thisTr.position.x + (-1 * speed * Time.deltaTime);
                    break;
                case Dir.RIGHT:
                    moveVector.x = thisTr.position.x + (speed * Time.deltaTime);
                    break;
                case Dir.UP:
                    moveVector.y = thisTr.position.y + (speed * Time.deltaTime);
                    break;
                case Dir.DOWN:
                    moveVector.y = thisTr.position.y + (-1 * speed * Time.deltaTime);
                    break;
            }

            thisTr.position = moveVector;

            yield return null;
        }
    }
开发者ID:FinishProject,项目名称:Secreto,代码行数:34,代码来源:BulletObject_FourWay.cs


示例10: Update

    // Update is called once per frame
    void Update()
    {
        if(Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android){//平台为IOS或者android时
            if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved){//输入触点大于0且移动时
                if(Input.GetTouch(0).deltaPosition.x < 0 - Mathf.Epsilon)_touchDir = Dir.Left;else _touchDir = Dir.Right;
            }
            // 当输入的触点数量大于0,且手指不动时
            if(Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Stationary){
                _touchDir = Dir.Stop;
            }
        }

        // 根据手势顺序或逆序换图
        if(_touchDir != Dir.Stop){
            if(_touchDir == Dir.Left){
                curTime += Time.deltaTime;
                if(curTime > duration){
                    curTime = 0;
                    index = index == 0 ? texAll.Length - 1 : index ;
                    plane.renderer.material.mainTexture = texAll[index--];
                }
            }else{
                curTime += Time.deltaTime;
                if(curTime > duration){
                    curTime = 0;
                    index = index == texAll.Length - 1 ? 0 : index ;
                    plane.renderer.material.mainTexture = texAll[index++];
                }
            }
        }
    }
开发者ID:haozi000005,项目名称:happy2d,代码行数:32,代码来源:TestMove.cs


示例11: NextStep

        /// <summary>Выполняет один шаг алгоритма поведения мыши.</summary>
        /// <returns>Направление следующего шага мыши.</returns>
        public override Dir NextStep()
        {
            // Находим все доступные направления куда может пойти мышь из текущей клетки
            var canGoDirs = Context.GetCanGoDirs();

            // Если нет направлений в которые можно идти, то мышь окружена стенами. А-а-а!!!
            if(canGoDirs.Count() == 0)
            {
                Context.Write("Некуда идти! Мышь окружена.", Color.Coral);
                return Dir.None;
            }

            if(_prevDir != Dir.None && _status != Status.Back && Context.GetStones() != 0 && _prevStones < 4)
            {
                _status = Status.Back;
                return _prevDir.Reverse();
            }

            var index = _rnd.Next(canGoDirs.Count());
            _prevDir = canGoDirs.ElementAt(index);
            var stones = Context.GetStones();
            if(stones < 4) ++stones;
            Context.PutStones(stones);
            _prevStones = stones;
            _status = Status.Forward;
            return _prevDir;
        }
开发者ID:kiple,项目名称:mouselab,代码行数:29,代码来源:HaosMouseStrategy.cs


示例12: GetFile

 /// <summary>
 /// Returns the complete path for the specified file in the specified MP directory.
 /// </summary>
 /// <param name="directory">A <see cref="Dir"/> value, indicating the directory where the file should be located</param>
 /// <param name="fileName">The name of the file for which to return the complete path.</param>
 /// <returns>A string containing the complete path.</returns>
 public static string GetFile(Dir directory, string fileName)
 {
   if (fileName.StartsWith(@"\") || fileName.StartsWith("/"))
   {
     throw new ArgumentException("The passed file name cannot start with a slash or backslash", "fileName");
   }
   return Path.Combine(Get(directory), fileName);
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:14,代码来源:Config.cs


示例13: IfNoCorridor_ShouldThrow_IfOutsideMap

        public void IfNoCorridor_ShouldThrow_IfOutsideMap(Dir dir)
        {
            var cell = new MapCell();
            cell.Sides[dir] = Side.Wall;

            Assert.That(() => ThrowD.IfNoCorridor(cell, dir),
                Throws.InstanceOf<InvalidOperationException>());
        }
开发者ID:CatSkald,项目名称:Roguelike,代码行数:8,代码来源:ThrowDTests.cs


示例14: SwapSkyBoxAndLight

 // 스카이 박스와 라이팅 변경 ( 외부 호출 )
 public void SwapSkyBoxAndLight(int skyboxNumber, Dir dir)
 {
     Debug.Log(111);
     RenderSettings.skybox = skies[skyboxNumber];
     StopAllCoroutines();
     StartCoroutine(SwapLight(skyboxNumber, dir));
     StartCoroutine(SwapSkyBox_Cor(dir));
 }
开发者ID:FinishProject,项目名称:Secreto,代码行数:9,代码来源:SkyBoxMgr.cs


示例15: changeRoom

        public void changeRoom(DungeonModel model, Dir direction)
        {
            Dir oppositeDir = Positions.opposite(direction);
            currentRoom.exitAndDestroy(oppositeDir);

            currentRoom = makeCurrent(model.currentRoom);
            currentRoom.enterAndEnable(direction);
        }
开发者ID:Jacob-Geb,项目名称:Down,代码行数:8,代码来源:DungeonView.cs


示例16: LoadFromXml

 public override void LoadFromXml(XmlElement el, XmlNamespaceManager nsmgr)
 {
     base.LoadFromXml(el, nsmgr);
     string pr = nsmgr.LookupPrefix(ProcessDefinition.WORKFLOW_NAMESPACE);
     if (pr != null && pr.Length > 0) pr += ":";
     VariableDir = (VariableDef.Dir)Enum.Parse(typeof(VariableDef.Dir), el.GetAttribute("dir"));
     DefaultValueExpr = SchemaUtil.GetXmlElementText(el, pr + "defaultValue", nsmgr);
 }
开发者ID:alasdairhurst,项目名称:nginn,代码行数:8,代码来源:VariableDef.cs


示例17: changeRoom

        public void changeRoom(Dir direction)
        {
            if (currentRoom != null)
                currentRoom.teardown();

            var newPos = currentRoom.pos + Positions.fromDir(direction);
            currentRoom = getRoomFromPos(newPos);
        }
开发者ID:Jacob-Geb,项目名称:Down,代码行数:8,代码来源:DungeonModel.cs


示例18: GetTurnShapeRotate

 static float GetTurnShapeRotate(Dir dir, bool postHalf)
 {
     if (dir == Dir.LEFT) {
         return postHalf ? 180 : 0;
     } else {
         return postHalf ? 90 : -90;
     }
 }
开发者ID:redclock,项目名称:Runner,代码行数:8,代码来源:Snake.cs


示例19: GetTurnShapeInverse

 static bool GetTurnShapeInverse(Dir dir, bool postHalf)
 {
     if (dir == Dir.LEFT) {
         return postHalf ? true : false;
     } else {
         return postHalf ? false : true;
     }
 }
开发者ID:redclock,项目名称:Runner,代码行数:8,代码来源:Snake.cs


示例20: attr

        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string action = null,
            Method? method = null,
            MimeType enctype = null,
            Target target = null,
            string onsubmit = null,
            string onreset = null,
            MimeType[] accept = null,
            Charset[] acceptcharset = null,
            string id = null,
            string name = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null
        )
        {
            Action = action;
            Method = method;
            EncType = enctype;
            Target = target;
            OnSubmit = onsubmit;
            OnReset = onreset;
            Accept = accept;
            AcceptCharset = acceptcharset;
            Id = id;
            Name = name;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;

            return this;
        }
开发者ID:bzure,项目名称:BSA.Net,代码行数:60,代码来源:TagForm.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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