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


C# LinkType.ToString方法代码示例

本文整理汇总了C#中LinkType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# LinkType.ToString方法的具体用法?C# LinkType.ToString怎么用?C# LinkType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LinkType的用法示例。


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

示例1: Create

        /// <summary>
        /// Creates a symbolic link at the specified location to the specified destination
        /// </summary>
        /// <param name="linkPath">The path where the symbolic link will be created</param>
        /// <param name="destination">The path where the symbolic link will link to</param>
        /// <param name="overrideExisting">Whether an existing file/folder should be overridden</param>
        /// <param name="type">The LinkType, a file or a directory</param>
        /// <exception cref="TargetAlreadyExistsException">The given <paramref name="linkPath"/> already exists and <paramref name="overrideExisting"/> was false</exception>
        public static void Create(string linkPath, string destination, bool overrideExisting, LinkType type)
        {
            if (type == LinkType.DirectoryLink && Directory.Exists(linkPath)) {
                if (!overrideExisting) {
                    throw new TargetAlreadyExistsException("Directory already exists");
                }
            } else if (type == LinkType.FileLink && File.Exists(linkPath)) {
                if (!overrideExisting) {
                    throw new TargetAlreadyExistsException("File already exists");
                }
            }

            // Start process with privileges
            var process = new Process();
            process.StartInfo.FileName = Assembly.GetExecutingAssembly().CodeBase;
            process.StartInfo.Verb = "runas"; // Adminrights
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.Arguments = string.Join(" ", CommandLineArgs.ArgsFromDictionary(new Dictionary<string, string> {
                { ActionArgumentTitle, ActionArgumentCreate },
                //{ DebugArgumentTitle, "=True" },
                { CreateLinkPathArgumentTitle, linkPath },
                { CreateDestinationArgumentTitle, destination },
                { CreateLinkTypeArgumentTitle, type.ToString() }}));

            process.Start();
            process.WaitForExit();
        }
开发者ID:formlesstree4,项目名称:OpenRCT2Launcher,代码行数:35,代码来源:ReparsePoint.cs

示例2: GetHrefContent

 public static string GetHrefContent(this AtomLinkCollection links, LinkType feedType = LinkType.listfeed)
 {
     foreach (var link in links)
     {
         if (link.Rel.EndsLike(feedType.ToString()))
             return link.HRef.Content;
     }
     return null;
 }
开发者ID:keith9820,项目名称:Groundfloor,代码行数:9,代码来源:ExtensionMethods.cs

示例3: Link

        public string Link(LinkType linkType = LinkType.Hot, bool AddJsonExtension = true)
        {
            string returnString = @"http://www.reddit.com/r/";

            returnString += name;
            returnString += @"/";
            returnString += linkType.ToString().ToLower();

            if (!AddJsonExtension)
            {

                return returnString;

            }
            else
            {
                return returnString + @".json";

            }
        }
开发者ID:qwertydog,项目名称:WallpaperChanger,代码行数:20,代码来源:Subreddit.cs

示例4: ShowMCSTable

 private void ShowMCSTable(LinkType linkType)
 {
     MCSTableFormEditor editor = new MCSTableFormEditor(this.m_Model, this.m_Model.McsManagement.MCSList, linkType);
     TableForm form = (TableForm) ProjectSingleton.FindProjectForm(linkType.ToString() + "MCS");
     if (form == null)
     {
         form = new TableForm(linkType.ToString() + "MCS", editor, null);
     }
     else
     {
         form.TableEditor.ClearModuleEvent();
         form.TableEditor = null;
         form.TableEditor = editor;
     }
     form.TabText = ProjectSingleton.CurrentProject.Name + ":" + linkType.ToString() + " " + TrafficModelResource.TRAFFICMODEL_LTEMCSTABLE;
     form.DgvBase.OnOpenTable(null);
     form.HideOnClose = true;
     form.LoadData();
     form.Show(ProjectSingleton.CurrentProject.DockPanel, DockState.Document);
 }
开发者ID:xiaoyj,项目名称:Space,代码行数:20,代码来源:ServiceView.cs

示例5: GetConnection

        public FdfsConnection GetConnection(LinkType link,IPEndPoint remoteEP)
        {
            Dictionary<IPEndPoint, ConnectionGroup> groups = GetGroup(link);
            FdfsConnection conn = null;

            lock (_syncRoot)
            {
                ConnectionGroup group = null;
                if (groups.TryGetValue(remoteEP, out group))
                {
                    conn = group.GetOne();
                }
                else
                {
                    group = new ConnectionGroup(this, remoteEP,link);
                    conn = group.GetOne();
                    groups.Add(remoteEP, group);
                }
            }
            LogUtil.Info(string.Format("FdfsConnection GetConnection(LinkType {0},IPEndPoint {1}) port:{2} connect {3}",link.ToString(), remoteEP.Address, remoteEP.Port, conn.IsConnected.ToString()));
            return conn;
        }
开发者ID:rainchan,项目名称:weitao,代码行数:22,代码来源:ConnectionManager.cs

示例6: RenderEditLink

        private static string RenderEditLink(Guid id, LinkType type, string cssClass, string before, string after,
                                             string linkText)
        {
            //Generate the url
            var urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
            string url = urlHelper.Action("edit", type.ToString().ToLower(), new {area = "Manager", id});

            //check to see if the css class was included otherwise don't render the class=""
            string css = string.Empty;

            if (!String.IsNullOrEmpty(cssClass))
            {
                css = String.Format("class=\"{0}\"", cssClass);
            }

            //Return the html
            return String.Format("{0}<a {1} href=\"{2}\">{3}</a>{4}", before, css, url, linkText, after);
        }
开发者ID:nickvee,项目名称:Piranha.Bootstrap,代码行数:18,代码来源:PiranhaHelpers.cs


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