本文整理汇总了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;
}
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例6: ConnectionGroup
public ConnectionGroup(ConnectionManager manager, IPEndPoint remoteEP,LinkType link)
{
_link = link;
_manager = manager;
_remoteEP = remoteEP;
_connections = new Queue<FdfsConnection>();
}
示例7: ItemTab
public ItemTab(Item item, LinkType type, ProductionGraphViewer parent)
: base(parent)
{
this.Item = item;
this.Type = type;
centreFormat.Alignment = centreFormat.LineAlignment = StringAlignment.Center;
}
示例8: ReactionLinkCommand
public ReactionLinkCommand(SpeciesReference speciesReference, Reaction reaction, LinkType linkType, bool adding)
{
this.speciesReference = speciesReference;
this.reaction = reaction;
this.linkType = linkType;
this.adding = adding;
}
示例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);
}
示例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); }));
}
示例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);
}
示例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;
}
示例13: TorrentLink
private TorrentLink(string path, LinkType linkType)
{
if (path == null)
throw new ArgumentNullException(nameof(path));
this.path = path;
this.linkType = linkType;
}
示例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);
}
示例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;
}