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


C# LinkType类代码示例

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


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

示例1: GetLinks

 /// <summary>
 /// 获取指定类型的链接
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public IEnumerable<Link> GetLinks(LinkType type)
 {
     foreach (Link link in GetAll())
     {
         if (link.Visible &&link.Type == (int)type) yield return link;
     }
 }
开发者ID:hanson-huang,项目名称:cms,代码行数:12,代码来源:LinkBLL.cs

示例2: 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

示例3: GetChildLinkObjectId

        public IQueryable<LinkObjectMaster> GetChildLinkObjectId(LinkType masterLinkType, int masterLinkId, LinkType childLinkType)
        {
            var linkObjectList = new List<LinkObjectMaster>();

            _dataEngine.InitialiseParameterList();
            _dataEngine.AddParameter("@MasterLinkTypeId", ((int)masterLinkType).ToString());
            _dataEngine.AddParameter("@MasterLinkId", masterLinkId.ToString());
            _dataEngine.AddParameter("@ChildLinkTypeId", ((int)childLinkType).ToString());

            _sqlToExecute = "SELECT * FROM [dbo].[LinkObjectMaster] ";
            _sqlToExecute += "WHERE MasterLinkTypeId = @MasterLinkTypeId ";
            _sqlToExecute += "AND MasterLinkId = @MasterLinkId ";
            _sqlToExecute += "AND ChildLinkTypeId = @ChildLinkTypeId ";

            if (!_dataEngine.CreateReaderFromSql(_sqlToExecute))
                throw new Exception("Link - GetLinkObject failed");

            while (_dataEngine.Dr.Read())
            {
                LinkObjectMaster linkObject = CreateLinkObjectFromData();
                linkObjectList.Add(linkObject);
            }

            return linkObjectList.AsQueryable();
        }
开发者ID:jonhunter1977,项目名称:BookingHunter,代码行数:25,代码来源:LinkRepository.cs

示例4: CopyFrom

 public void CopyFrom(ReceptionEquipment receptionEquip)
 {
     this.m_CIList.Clear();
     this.m_CIList.AddRange(receptionEquip.CIList);
     this.m_LinkType = receptionEquip.Link;
     this.m_Name = receptionEquip.Name;
 }
开发者ID:xiaoyj,项目名称:Space,代码行数:7,代码来源:ReceptionEquipment.cs

示例5: GetData

        public IEnumerable<LinkItem> GetData(LinkType type)
        {
            urn.items.items m_its_database = LoadData() as urn.items.items;

            if (m_its_database != null)
            {
                IList<LinkItem> itemsList = new List<LinkItem>();

                var items = from i in m_its_database.item
                            select i;

                foreach (var item in items)
                {
                    var linkItem = new LinkItem()
                    {
                        Link = item.url,
                        Title = item.title,
                        Description = item.description,
                        Date = item.date != DateTime.MinValue ? GetDate(item.date, item.type) : null,
                        Type = GetLinkType(item.type)

                    };

                    itemsList.Add(linkItem);
                }

                return itemsList.Where(c => c.Type == type);
            }

            return null;
        }
开发者ID:rajgit31,项目名称:RajWebSite,代码行数:31,代码来源:DataRepository.cs

示例6: ConnectionGroup

 public ConnectionGroup(ConnectionManager manager, IPEndPoint remoteEP,LinkType link)
 {
     _link = link;
     _manager = manager;
     _remoteEP = remoteEP;
     _connections = new Queue<FdfsConnection>();
 }
开发者ID:rainchan,项目名称:weitao,代码行数:7,代码来源:ConnectionGroup.cs

示例7: ItemTab

		public ItemTab(Item item, LinkType type, ProductionGraphViewer parent)
			: base(parent)
		{
			this.Item = item;
			this.Type = type;
			centreFormat.Alignment = centreFormat.LineAlignment = StringAlignment.Center;
		}
开发者ID:w-flo,项目名称:foreman-pkg,代码行数:7,代码来源:ItemTab.cs

示例8: ReactionLinkCommand

 public ReactionLinkCommand(SpeciesReference speciesReference, Reaction reaction, LinkType linkType, bool adding)
 {
     this.speciesReference = speciesReference;
     this.reaction = reaction;
     this.linkType = linkType;
     this.adding = adding;
 }
开发者ID:dorchard,项目名称:mucell,代码行数:7,代码来源:ReactionLinkCommand.cs

示例9: CreateLink

        public static MvcHtmlString CreateLink(this HtmlHelper htmlHelper, string text, LinkType linkType, object htmlAttributes = null, params object[] args)
        {
            string urlPattern = null;
            string anchorHtml, url;

            switch (linkType)
            {
                case LinkType.CategoryDetail:
                    urlPattern = configurationManager.GetConfigValue(SystemConstants.CategoryLinkPatternConfigKey) as string;
                    break;
                case LinkType.ProductDetail:
                    urlPattern = configurationManager.GetConfigValue(SystemConstants.ProductLinkPatternConfigKey) as string;
                    break;
                case LinkType.ManufacturerDetail:
                    urlPattern = configurationManager.GetConfigValue(SystemConstants.ManufacturerLinkPatternConfigKey) as string;
                    break;
                case LinkType.ReviewReadMore:
                    urlPattern = configurationManager.GetConfigValue(SystemConstants.ReviewReadMorePatternConfigKey) as string;
                    break;
            }

            if (!string.IsNullOrEmpty(urlPattern))
            {
                url = urlPattern.FormatWith(args);
                anchorHtml = SystemConstants.AnchorTemplate.FormatWith(url, text, "");
            }
            else
            {
                anchorHtml = "";
            }

            return new MvcHtmlString(anchorHtml);
        }
开发者ID:syil,项目名称:UrunYorum,代码行数:33,代码来源:MvcViewExtensions.cs

示例10: AddItem

 private void AddItem(Brick connection, LinkType linktype)
 {
     Button button = new Button();
     button.FlatStyle = FlatStyle.Flat;
     button.FlatAppearance.BorderColor = SystemColors.Control;
     button.FlatAppearance.BorderSize = 0;
     button.FlatAppearance.MouseOverBackColor = SystemColors.ControlLightLight;
     button.FlatAppearance.MouseDownBackColor = SystemColors.HotTrack;
     button.AutoEllipsis = false;
     if (linktype == LinkType.USB) { button.Image = global::NXTLibTesterGUI.Properties.Resources.usb2; }
     if (linktype == LinkType.Bluetooth) { button.Image = global::NXTLibTesterGUI.Properties.Resources.bluetooth; }
     button.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     button.Location = new System.Drawing.Point(3, 0);
     if (linktype == LinkType.USB) { button.Name = "USB"; }
     if (linktype == LinkType.Bluetooth) { button.Name = "BLU" + Utils.AddressByte2String(connection.brickinfo.address, true); }
     button.Size = new System.Drawing.Size(259, 20);
     button.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
     button.TabIndex = 1;
     button.Text = "       " + connection.brickinfo.name;
     button.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     button.MouseDown += Button_MouseDown;
     button.MouseClick += Item_Click;
     button.MouseUp += Button_MouseUp;
     List.Invoke(new MethodInvoker(delegate { List.Controls.Add(button); }));
 }
开发者ID:smo-key,项目名称:NXTLib,代码行数:25,代码来源:FindNXT.cs

示例11: LinkView

 public LinkView(Guid mapUid, CompendiumNode originNode, XmlDocument doc, XmlElement parent, LinkType linkType)
     : this(doc, parent, linkType)
 {
     AddAttributeByKeyValue("id", mapUid.ToLongString());
     AddAttributeByKeyValue("created", originNode.Created);
     AddAttributeByKeyValue("lastModified", originNode.LastModified);
 }
开发者ID:chris-tomich,项目名称:Glyma,代码行数:7,代码来源:LinkView.cs

示例12: Link

 /// <summary>
 /// Create a <see cref="Link"/> using the given parameters.
 /// </summary>
 /// <param name="type">The <see cref="Link.Type"/> to use.</param>
 /// <param name="id">The id to set (for artists, albums and tracks) or null.</param>
 /// <param name="user">The user to set (for playlists) or null.</param>
 /// <param name="query">The search query to set (for search) or null.</param>
 private Link(LinkType type, string id, string user, string query)
 {
     this._type = type;
     this._id = id;
     this._user = user;
     this._query = query;
 }
开发者ID:heksesang,项目名称:sharpotify,代码行数:14,代码来源:Link.cs

示例13: TorrentLink

        private TorrentLink(string path, LinkType linkType)
        {
            if (path == null)
                throw new ArgumentNullException(nameof(path));

            this.path = path;
            this.linkType = linkType;
        }
开发者ID:deaddog,项目名称:BitTorrent,代码行数:8,代码来源:TorrentLink.cs

示例14: MenuItem

 public MenuItem(string text, LinkType linkType, Action executeAction)
 {
     LinkType = linkType;
     ExecuteAction = executeAction;
     FadeEffect = new FadeImageEffect{FadeSpeed = 1.0f};
     Image = new ImageFile{Text = text};
     Image.ActivateEffect(FadeEffect);
 }
开发者ID:nakioman,项目名称:furryrun,代码行数:8,代码来源:MenuItem.cs

示例15: LipSyncUnit

 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="lipId">口形状種別ID。</param>
 /// <param name="linkType">前の音からの繋ぎ方を表す列挙値。</param>
 /// <param name="lengthPercent">
 /// フレーム長の基準値に対するパーセント値。
 /// </param>
 public LipSyncUnit(
     LipId lipId,
     LinkType linkType,
     int lengthPercent)
 {
     this.LipId = lipId;
     this.LinkType = linkType;
     this.LengthPercent = lengthPercent;
 }
开发者ID:ruche7,项目名称:ruche.mmm,代码行数:17,代码来源:LipSyncUnit.cs


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