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

C# PathType类代码示例

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

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



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

示例1: GetPathFromRegistry

		private static string GetPathFromRegistry(PathType type)
		{
			var mainKey = type == PathType.User ? Registry.CurrentUser : Registry.LocalMachine;

			try
			{
				var subKey = mainKey.OpenSubKey(type == PathType.User ? UserPathKey : SystemPathKey);
				if (subKey == null)
					throw new Exception();
				var path = subKey
					.GetValue("Path", "", RegistryValueOptions.DoNotExpandEnvironmentNames) as string;
				return path;
			}
			catch (SecurityException)
			{
				MessageBox.Show("An error has occured while trying to open registry.\n" +
								"Your account probably doesn't have necessary permissions.");
				Application.Current.Shutdown();
			}
			catch (UnauthorizedAccessException)
			{
				MessageBox.Show("An error has occured while trying to open registry.\n" +
								"Your account probably doesn't have necessary permissions.");
				Application.Current.Shutdown();
			}
			catch (Exception e)
			{
				MessageBox.Show("An unknown error has occured while trying to open registry:\n" + e.Message);
				Application.Current.Shutdown();
			}
			return "";
		}
开发者ID:tablesmit,项目名称:PathEdit,代码行数:32,代码来源:PathReader.cs


示例2: FillPathData

        private void FillPathData(Windows.UI.Xaml.Shapes.Path pathInstance, PathType typeOfPath){
            
            var dataPath = string.Empty ;

            if (typeOfPath == PathType.Book)
            {
                dataPath = "M8.15192985534668,0L8.16493034362793,0 8.16493034362793,39.189998626709C8.16493034362793,39.6419982910156 8.31793022155762,40.0549983978271 8.55592918395996,40.2599983215332 8.79993057250977,40.4699993133545 9.08692932128906,40.4329986572266 9.30992889404297,40.173999786377L15.2389297485352,33.1699991226196 20.8559303283691,40.1579990386963C20.9839305877686,40.3139991760254,21.1359310150146,40.3959999084473,21.2879314422607,40.3959999084473L21.6139316558838,40.2689990997314C21.8609313964844,40.0629997253418,22.0179309844971,39.6469993591309,22.0179309844971,39.189998626709L22.0179309844971,0 52.1599340438843,0C53.090934753418,0,53.8439350128174,0.757999420166016,53.8439350128174,1.6879997253418L53.8439350128174,49.3569984436035C53.8439350128174,50.2879981994629,53.090934753418,51.0459976196289,52.1599340438843,51.0459976196289L52.1399345397949,51.0410003662109C52.0039348602295,51.0699996948242,51.8759346008301,51.0909996032715,51.7449340820313,51.0909996032715L8.14793014526367,51.0909996032715C5.61592864990234,51.0909996032715 3.5399284362793,53.0789985656738 3.39693069458008,55.5789985656738 3.39693069458008,55.7309989929199 3.40092849731445,55.8460006713867 3.40092849731445,55.9209976196289L3.39292907714844,56.0529975891113C3.49493026733398,58.5929985046387,5.58692932128906,60.6279983520508,8.14793014526367,60.6279983520508L50.4719343185425,60.6279983520508 50.4719343185425,55.9669990539551C50.4719343185425,55.0359992980957 51.2299346923828,54.2779998779297 52.1599340438843,54.2779998779297 53.090934753418,54.2779998779297 53.8439350128174,55.0359992980957 53.8439350128174,55.9669990539551L53.8439350128174,62.3120002746582C53.8439350128174,63.246997833252,53.090934753418,64,52.1599340438843,64L7.89292907714844,64 7.63792991638184,63.9749984741211C3.3879280090332,63.7070007324219,0.00792694091796875,60.1749992370605,0.00792694091796875,55.8589973449707L0.0229301452636719,55.5669975280762C-0.0290718078613281,50.5599994659424,0.0229301452636719,12.4609990119934,0.0279273986816406,8.3179988861084L0.0119285583496094,8.14099884033203C0.0119285583496094,3.65299892425537,3.6649284362793,0,8.15192985534668,0z";
               
            }
            else if (typeOfPath == PathType.Key) {

                dataPath = "M16.547848,26.872497C14.451092,26.916562 12.365034,27.710413 10.729302,29.266098 7.2240894,32.589393 7.0834706,38.118687 10.403706,41.615683 13.72137,45.118677 19.252512,45.263676 22.752474,41.941881 26.247238,38.621584 26.401036,33.097193 23.078072,29.594298 21.314234,27.73567 18.92417,26.822555 16.547848,26.872497z M47.555126,0.0002117157C47.726013,0.0044841766,47.895291,0.073574066,48.021641,0.20638657L52.778168,5.1985388C53.03077,5.4641666,53.020371,5.888484,52.754769,6.1409225L52.232945,6.6370945 58.379608,13.115402C58.632122,13.382402,58.621121,13.806803,58.354809,14.058203L56.356011,15.956708C56.089798,16.207609,55.665879,16.197409,55.413365,15.930308L49.269745,9.4546347 48.00716,10.655153 52.407509,15.294587C52.660187,15.560289,52.649086,15.984593,52.382813,16.237495L50.384396,18.133013C50.118122,18.386015,49.694359,18.375215,49.441685,18.109612L45.04353,13.473104 30.99349,26.832494 31.170538,27.124847C35.031944,33.685067 34.017586,42.279621 28.253817,47.748075 21.549486,54.107365 10.954499,53.828564 4.5965569,47.125475 -1.7705653,40.417484 -1.4855343,29.826198 5.21898,23.462906 10.672487,18.294763 18.680851,17.507213 24.908787,20.994482L25.088602,21.09812 47.078934,0.18294907C47.211735,0.056484222,47.384236,-0.0040607452,47.555126,0.0002117157z";
            }


            if (!string.IsNullOrEmpty(dataPath))
            {
                var b = new Binding { Source = dataPath };

                BindingOperations.SetBinding(pathInstance, Windows.UI.Xaml.Shapes.Path.DataProperty, b);
            }
        


        }
开发者ID:ValdimarThor,项目名称:X,代码行数:25,代码来源:Path.cs


示例3: AddOption

        public void AddOption(PathType type, Delivery delivery)
        {
            if (delivery == null)
                throw new ArgumentException("Delivery cannot be null", "delivery");

            options[type] = delivery;
        }
开发者ID:patrick478,项目名称:SWEN301-KPSmart,代码行数:7,代码来源:DeliveryOption.cs


示例4: Path

        /// <summary>
        /// Create a path from XZ nodes defined in a pathFile.
        /// The file must be accessible from the executable environment.
        /// </summary>
        /// <param name="theStage"> "world's stage" </param>
        /// <param name="aPathType"> SINGLE, REVERSE, or LOOP path traversal</param>
        /// <param name="pathFile"> text file, each line a node of X Z values, separated by a single space </x></param>
        public Path(Stage theStage, PathType aPathType, string pathFile)
            : base(theStage)
        {
            node = new List<NavNode>();
            stage = theStage;
            nextNode = 0;
            pathType = aPathType;
            done = false;

            // read file
            using (StreamReader fileIn = File.OpenText(pathFile)) {
                int x, z;
                string line;
                string[] tokens;
                line = fileIn.ReadLine();

                do {
                    // use default separators
                    tokens = line.Split(new char[] { });
                    x = Int32.Parse(tokens[0]);
                    z = Int32.Parse(tokens[1]);
                    node.Add(new NavNode(new Vector3(x, 0, z), NavNode.NavNodeEnum.WAYPOINT));
                    line = fileIn.ReadLine();
                }
                while (line != null);
            }
        }
开发者ID:channguyen,项目名称:virtual-reality-game-xna,代码行数:34,代码来源:Path.cs


示例5: DiskSpaceNotification

 public DiskSpaceNotification(string path, PathType pathType, double freeSpaceInBytes, double freeSpaceInPercentage)
 {
     Path = path;
     PathType = pathType;
     FreeSpaceInBytes = freeSpaceInBytes;
     FreeSpaceInPercentage = freeSpaceInPercentage;
 }
开发者ID:j2jensen,项目名称:ravendb,代码行数:7,代码来源:DiskSpaceNotification.cs


示例6: FileChecksum

        /// <summary>
        /// Initializes a new instance of the FileChecksum class, and loads the file's hash (computed immediately)
        /// </summary>
        /// <param name="fileName">File to compute hash of</param>
        /// <param name="basePath">Base path</param>
        /// <param name="pathType">Path type</param>
        /// <param name="checksumType">Checksum type</param>
        public FileChecksum(string fileName, string basePath, PathType pathType, ChecksumType checksumType)
        {
            FilePath = fileName;

            ResolvedFileName = GetFileName(FilePath, basePath, pathType);

            Checksum = FileUtils.GetFileChecksum(fileName, checksumType);
        }
开发者ID:nicjansma,项目名称:checksum-verifier,代码行数:15,代码来源:FileChecksum.cs


示例7: ReadDisabledItems

		public static IEnumerable<PathEntry> ReadDisabledItems(PathType type)
		{
			var name = type == PathType.User ? DisabledUserItemsFileName : DisabledSystemItemsFileName;
			var fullPath = Path.Combine(AppDataPath.AppDataDirPath, name);
			if (!File.Exists(fullPath))
				return new List<PathEntry>();
			return File.ReadAllLines(fullPath).Select(x => new PathEntry(x) { Enabled = false });
		}
开发者ID:tablesmit,项目名称:PathEdit,代码行数:8,代码来源:DisabledItems.cs


示例8: CookieStatus

		internal CookieStatus(string name, string path, BrowserType browserType, PathType pathType)
		{
			_name = name;
			_path = path;
			_browserType = browserType;
			_pathType = pathType;
			_displayName = null;
		}
开发者ID:nico-lab,项目名称:niconama-ocv,代码行数:8,代码来源:CookieStatus.cs


示例9: PathElement

 public PathElement(string name, PathType type)
 {
     if (string.IsNullOrEmpty(name) && type != PathType.Root)
     {
         throw new ArgumentException("Can't have empty name for non root path element");
     }
     _pathType = type;
     _name = name;
 }
开发者ID:npuBug,项目名称:epublibrary,代码行数:9,代码来源:PathElement.cs


示例10: Path

 /// <summary>
 /// Create a path
 /// </summary>
 /// <param name="theStage"> "world's stage" </param>
 /// <param name="apath"> collection of nodes in path</param>
 /// <param name="aPathType"> SINGLE, REVERSE, or LOOP path traversal</param>
 public Path(Stage theStage, List<NavNode> aPath, PathType aPathType)
     : base(theStage)
 {
     node = aPath;
     nextNode = 0;
     pathType = aPathType;
     stage = theStage;
     done = false;
 }
开发者ID:WebDevGirl,项目名称:Comp565_TerrainAndTreasure,代码行数:15,代码来源:Path.cs


示例11: SaveDisabledItems

		public static void SaveDisabledItems(PathType type, IEnumerable<PathEntry> items)
		{
			var name = type == PathType.User ? DisabledUserItemsFileName : DisabledSystemItemsFileName;
			var fullPath = Path.Combine(AppDataPath.AppDataDirPath, name);

			var disabledItems = items.Where(x => x.Enabled == false).Select(x => x.Path);

			File.WriteAllLines(fullPath, disabledItems);
		}
开发者ID:tablesmit,项目名称:PathEdit,代码行数:9,代码来源:DisabledItems.cs


示例12: SavePathToRegistry

		public static void SavePathToRegistry(PathType type, string path)
		{
#if DEBUG
			System.Diagnostics.Debug.WriteLine(path);
#else
			Environment.SetEnvironmentVariable("Path", path,
				type == PathType.User ? EnvironmentVariableTarget.User : EnvironmentVariableTarget.Machine);
#endif
		}
开发者ID:tablesmit,项目名称:PathEdit,代码行数:9,代码来源:PathReader.cs


示例13: Contains

        public static bool Contains(Route route, PathType type)
        {
            for (uint i = 0x0; i < route.GetNumPaths(); i++)
            {
                PathData pathData = route.GetPathData(i);
                if (pathData.PathType == type) return true;
            }

            return false;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:10,代码来源:Routes.cs


示例14: Path

        // ***********************************************************************************
        // CONSTRUCTOR
        // ***********************************************************************************

        public Path(PathType type, Vector3[] waypoints, int subdivisionsXSegment, Color? gizmoColor = null)
        {
            this.type = type;
            this.subdivisionsXSegment = subdivisionsXSegment;
            if (gizmoColor != null) this.gizmoColor = (Color)gizmoColor;
            AssignWaypoints(waypoints, true);
            AssignDecoder(type);

            if (DOTween.isUnityEditor) DOTween.GizmosDelegates.Add(Draw);
        }
开发者ID:Grogal,项目名称:dotween,代码行数:14,代码来源:Path.cs


示例15: CreateTemporaryPath

 public static PathSpec CreateTemporaryPath(PathType type)
 {
     var path = Path.GetRandomFileName();
     var spec = path.ToPathSpec().Value;
     if (type == PathType.File)
         spec.Create(PathType.File);
     if (type == PathType.Folder)
         spec.Create(PathType.Folder);
     return spec;
 }
开发者ID:ApocalypticOctopus,项目名称:Apocalyptic.Utilities.Net,代码行数:10,代码来源:PathUtility.cs


示例16: Config

 /** 初始化处理 */
 protected virtual void Config(string vRes, PathType vType)
 {
     if (vType == PathType.localResource)
     {
         resPath = vRes;
         loadLinesFromResource ();
         readLines ();
         lines = null; // 处理完后清理源缓存
     }
 }
开发者ID:tonyshow,项目名称:cardGame,代码行数:11,代码来源:ConfigBasic.cs


示例17: Path

        public Path(Point startPoint, Point endPoint, int radius, int width, PathType direction)
        {
            this.startPoint = startPoint;
            this.endPoint = endPoint;
            this.radius = radius;
            this.width = width;
            this.direction = direction;
            this.StepDistance = 40;
            CalculateOrigin();

            this.outliner = new PathOutliner(this, this.Origin);
        }
开发者ID:curtmantle,项目名称:Geometry,代码行数:12,代码来源:Path.cs


示例18: ScmRepository

 public ScmRepository(string scmtype, string path, PathType type)
 {
     Path = DeserializePath (path);
     origPath = path;
     pathType = type;
     this.scmType = scmtype;
     Status = ScmRepositoryStatus.Unknown;
     statusUpdateTime = DateTime.MinValue;
     ActiveStatusUpdateInterval = -1;
     IdleStatusUpdateInterval = -1;
     Disable = false;
 }
开发者ID:pocorall,项目名称:scm-notifier,代码行数:12,代码来源:ScmRepository.cs


示例19: FileUsesFramework

        /// <summary>
        /// Tests whether the given file contents uses the framework.
        /// </summary>
        /// <param name="fileContents">Contents of the file as a string to test.</param>
        /// <param name="bestGuess">True if the method should fall back from definitive to best guess detection.</param>
        /// <param name="pathType">The type of the file being tests</param>
        /// <returns>True if the file is a framework dependency, otherwise false.</returns>
        public virtual bool FileUsesFramework(string fileContents, bool bestGuess, PathType pathType)
        {
            if (bestGuess)
            {
                var regex = FrameworkSignatureJavaScript;
                return regex != null && regex.IsMatch(fileContents);
            }

            Match match = FrameworkReferenceRegex.Match(fileContents);
            return match.Success &&
                   match.Groups["framework"].Value.Equals(FrameworkKey, StringComparison.OrdinalIgnoreCase);
        }
开发者ID:miparnisari,项目名称:chutzpah,代码行数:19,代码来源:BaseFrameworkDefinition.cs


示例20: EventLogQuery

        public EventLogQuery(string path, PathType pathType, string query) {

            this.session = EventLogSession.GlobalSession;
            this.path = path;   // can be null
            this.pathType = pathType;

            if (query == null) {
                if (path == null)
                    throw new ArgumentNullException("path");
            }
            else {
                this.query = query;
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:14,代码来源:EventLogQuery.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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