本文整理汇总了C#中ItemState类的典型用法代码示例。如果您正苦于以下问题:C# ItemState类的具体用法?C# ItemState怎么用?C# ItemState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemState类属于命名空间,在下文中一共展示了ItemState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OpenPullRequestMonitor
public OpenPullRequestMonitor(TimeSpan timespan, ItemState state=ItemState.Open)
{
var pollingPeriod = timespan.TotalMilliseconds;
_timer = new Timer(pollingPeriod) {AutoReset = true};
_timer.Elapsed += (sender, eventArgs) =>
{
var prs = 0;
Task.Run(async () =>
{
var requests = await PollGitHub(state);
prs = requests.Count;
_pr = requests.FirstOrDefault();
Console.WriteLine("Polled PR count:" + prs);
}).Wait();
if (prs > OpenPrs)
{
var soundPlayer = new SoundPlayer("fanfare3.wav");
soundPlayer.PlaySync();
if (_pr != null)
{
var speech = new SpeechSynthesizer();
speech.Speak("New pull request.");
speech.Speak(_pr.Title);
}
OpenPrs = prs;
}
else if (prs < OpenPrs)
{
OpenPrs = prs;
}
};
}
开发者ID:awcoats,项目名称:PRNotifier,代码行数:34,代码来源:OpenPullRequestMonitor.cs
示例2: PullRequest
public PullRequest(Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, bool? mergeable, User mergedBy, int comments, int commits, int additions, int deletions, int changedFiles)
{
Url = url;
HtmlUrl = htmlUrl;
DiffUrl = diffUrl;
PatchUrl = patchUrl;
IssueUrl = issueUrl;
StatusesUrl = statusesUrl;
Number = number;
State = state;
Title = title;
Body = body;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
ClosedAt = closedAt;
MergedAt = mergedAt;
Head = head;
Base = @base;
User = user;
Assignee = assignee;
Mergeable = mergeable;
MergedBy = mergedBy;
Comments = comments;
Commits = commits;
Additions = additions;
Deletions = deletions;
ChangedFiles = changedFiles;
}
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:28,代码来源:PullRequest.cs
示例3: GetIcon
public static Icon GetIcon(string path, ItemType type, IconSize size, ItemState state)
{
var flags = (uint)(Interop.SHGFI_ICON | Interop.SHGFI_USEFILEATTRIBUTES);
var attribute = (uint)(object.Equals(type, ItemType.Folder) ? Interop.FILE_ATTRIBUTE_DIRECTORY : Interop.FILE_ATTRIBUTE_FILE);
if (object.Equals(type, ItemType.Folder) && object.Equals(state, ItemState.Open))
{
flags += Interop.SHGFI_OPENICON;
}
if (object.Equals(size, IconSize.Small))
{
flags += Interop.SHGFI_SMALLICON;
}
else
{
flags += Interop.SHGFI_LARGEICON;
}
var shfi = new SHFileInfo();
var res = Interop.SHGetFileInfo(path, attribute, out shfi, (uint)Marshal.SizeOf(shfi), flags);
if (object.Equals(res, IntPtr.Zero)) throw Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error());
try
{
Icon.FromHandle(shfi.hIcon);
return (Icon)Icon.FromHandle(shfi.hIcon).Clone();
}
catch
{
throw;
}
finally
{
Interop.DestroyIcon(shfi.hIcon);
}
}
开发者ID:rickflagg,项目名称:public,代码行数:33,代码来源:ShellManager.cs
示例4: GetImageSource
public static ImageSource GetImageSource(string directory, Size size, ItemState folderType)
{
using (var icon = ShellManager.GetIcon(directory, ItemType.Folder, IconSize.Large, folderType))
{
return Imaging.CreateBitmapSourceFromHIcon(icon.Handle, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromWidthAndHeight((int)size.Width, (int)size.Height));
}
}
开发者ID:jonbonne,项目名称:OCTGN,代码行数:7,代码来源:ShellManager.cs
示例5: Item
public Item(string name, string description, Texture2D image)
{
this.name = name;
this.description = description;
this.image = image;
quantity = 1;
state = ItemState.Positioned;
}
开发者ID:VicBoss,项目名称:KR,代码行数:8,代码来源:Item.cs
示例6: PollGitHub
public async Task<IReadOnlyList<PullRequest>> PollGitHub(ItemState state = ItemState.Open)
{
var gitHubClient = new GitHubClient(new ProductHeaderValue("CalPEATS"));
gitHubClient.Credentials = new Credentials("***email**", "******");
var openPullRequests = new PullRequestRequest {State = state };
var prs = await gitHubClient.PullRequest.GetAllForRepository("calicosol", "CalPEATS", openPullRequests);
return prs;
}
开发者ID:awcoats,项目名称:PRNotifier,代码行数:8,代码来源:OpenPullRequestMonitor.cs
示例7: SetupSearch
public static void SetupSearch(this Mock<IGitHubClient> github, ItemState state, params Issue[] result)
{
github.Setup(x => x.Search.SearchIssues(It.Is<SearchIssuesRequest>(s => s.State == state)))
.Returns(Task.FromResult(new SearchIssuesResult
{
Items = result.ToList(),
TotalCount = result.Length
}));
}
开发者ID:LeCantaloop,项目名称:OctoHook,代码行数:9,代码来源:MockExtensions.cs
示例8: TasklistItem
public TasklistItem(string taskId, string name, ItemState state, int total, int completed)
{
this.TaskId = taskId;
this.Name = name;
this.Description = String.Empty;
this.State = state;
this.Total = total;
this.Completed = completed;
}
开发者ID:matthiase,项目名称:odeo-mobile,代码行数:9,代码来源:TasklistItem.cs
示例9: SubItemPaintEventArgs
/// <summary>Create <see cref="ItemPaintEventArgs"/>.</summary>
/// <param name="graphics">Graphics surface to draw the item on.</param>
/// <param name="clipRectangle">Clipping rectangle.</param>
/// <param name="bounds">Rectangle that represents the bounds of the item that is being drawn.</param>
/// <param name="index">Index value of the item that is being drawn.</param>
/// <param name="state">State of the item being drawn.</param>
/// <param name="hoveredPart">Hovered part of the item.</param>
/// <param name="hostControlFocused">Host control is focused.</param>
public SubItemPaintEventArgs(
Graphics graphics, Rectangle clipRectangle, Rectangle bounds, int index,
ItemState state, int hoveredPart, bool hostControlFocused,
int columnIndex, CustomListBoxColumn column)
: base(graphics, clipRectangle, bounds, index, state, hoveredPart, hostControlFocused)
{
_columnIndex = columnIndex;
_column = column;
}
开发者ID:Kuzq,项目名称:gitter,代码行数:17,代码来源:SubItemPaintEventArgs.cs
示例10: GetImageSource
public static ImageSource GetImageSource(string directory, ItemState folderType)
{
try
{
return GetImageSource(directory, new Size(16, 16), folderType);
}
catch
{
throw;
}
}
开发者ID:DmytroMelnyk,项目名称:MyCommander,代码行数:11,代码来源:FolderManager.cs
示例11: DrawButton
public virtual void DrawButton(Graphics g, Rectangle rectangle, string text, Font font, StringFormat fmt, ItemState state, bool hasBorder, bool enabled)
{
float angle = 90;
if (rectangle.Width > 0 && rectangle.Height > 0)
{
if (!enabled)
{
using (Brush backBrush = new LinearGradientBrush(rectangle, Office2003Colors.Default[Office2003Color.Button1], Office2003Colors.Default[Office2003Color.Button2], angle))
{
g.FillRectangle(backBrush, rectangle);
}
}
else
{
switch (state)
{
case ItemState.Normal:
using (Brush backBrush = new LinearGradientBrush(rectangle, Office2003Colors.Default[Office2003Color.Button1], Office2003Colors.Default[Office2003Color.Button2], angle))
g.FillRectangle(backBrush, rectangle);
break;
case ItemState.HotTrack:
using (Brush trackBrush = new LinearGradientBrush(rectangle, Office2003Colors.Default[Office2003Color.Button1Hot], Office2003Colors.Default[Office2003Color.Button2Hot], angle))
g.FillRectangle(trackBrush, rectangle);
break;
case ItemState.Open:
case ItemState.Pressed:
using (Brush trackBrush = new LinearGradientBrush(rectangle, Office2003Colors.Default[Office2003Color.Button1Pressed], Office2003Colors.Default[Office2003Color.Button2Pressed], angle))
g.FillRectangle(trackBrush, rectangle);
break;
default:
break;
}
}
if (!string.IsNullOrEmpty(text))
{
if (enabled)
{
using (SolidBrush br = new SolidBrush(Office2003Colors.Default[Office2003Color.Text]))
g.DrawString(text, font, br, rectangle, fmt);
}
else
{
using (SolidBrush br = new SolidBrush(Office2003Colors.Default[Office2003Color.TextDisabled]))
g.DrawString(text, font, br, rectangle, fmt);
}
}
if(hasBorder)
DrawBorder(g, new Rectangle(rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1), enabled);
}
}
开发者ID:HEskandari,项目名称:FarsiLibrary,代码行数:53,代码来源:FAPainterOffice2003.cs
示例12: Milestone
public Milestone(Uri url, int number, ItemState state, string title, string description, User creator, int openIssues, int closedIssues, DateTimeOffset createdAt, DateTimeOffset? dueOn)
{
Url = url;
Number = number;
State = state;
Title = title;
Description = description;
Creator = creator;
OpenIssues = openIssues;
ClosedIssues = closedIssues;
CreatedAt = createdAt;
DueOn = dueOn;
}
开发者ID:alexgyori,项目名称:octokit.net,代码行数:13,代码来源:Milestone.cs
示例13: StateSwitch
public static void StateSwitch(PointerEventData data, ItemState state,
System.Action<PointerEventData> attachedAction,
System.Action<PointerEventData> attachedHighlightedAction,
System.Action<PointerEventData> draggingAction,
System.Action<PointerEventData> floatingAction,
System.Action<PointerEventData> instantiateAction,
System.Action<PointerEventData> noInstantiateAction)
{
switch (state)
{
case ItemState.Attached:
if (attachedAction != null)
{
attachedAction(data);
}
break;
case ItemState.AttachedHighlighted:
if (attachedHighlightedAction != null)
{
attachedHighlightedAction(data);
}
break;
case ItemState.Dragging:
if (draggingAction != null)
{
draggingAction(data);
}
break;
case ItemState.Floating:
if (floatingAction != null)
{
floatingAction(data);
}
break;
case ItemState.Instantiate:
if (instantiateAction != null)
{
instantiateAction(data);
}
break;
case ItemState.NoInstantiate:
if (noInstantiateAction != null)
{
noInstantiateAction(data);
}
break;
}
}
开发者ID:rygo6,项目名称:VisualizationFramework-Unity,代码行数:48,代码来源:ItemUtility.cs
示例14: DrawItem
public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
{
base.DrawItem(g, item, state, bounds);
PhotoInfo p = item.Tag as PhotoInfo;
if (ImageListView.View != View.Details && p != null && p.Flickr.Uploaded != null) {
// Draw the image
Image img = item.ThumbnailImage;
if (img != null) {
Size itemPadding = new Size(4, 4);
Rectangle pos = GetSizedImageBounds(img, new Rectangle(bounds.Location + itemPadding, ImageListView.ThumbnailSize));
Image overlayImage = Resource1.Uploaded;
int w = Math.Min(overlayImage.Width, pos.Width);
int h = Math.Min(overlayImage.Height, pos.Height);
g.DrawImage(overlayImage, pos.Left, pos.Bottom - h, w, h);
}
}
}
开发者ID:nikkilocke,项目名称:MyPicturesSync,代码行数:17,代码来源:FlickrInfoRenderer.cs
示例15: loadEventItemState
public void loadEventItemState(ItemState state)
{
itemId = state.id;
type = EVENT_TYPE;
level = state.level;
requiredItems = state.requiredItems;
restrictedItems = state.restrictedItems;
leadItems = state.leadItems;
hideItems = state.hideItems;
unhideItems = state.unhideItems;
eventDialogue = state.eventDialogue;
defaultDialogue = state.defaultDialogue;
idleDialogue = state.idleDialogue;
endingPoints = state.endingPoints;
isInitiallyHidden = state.isInitiallyHidden;
pt2DefaultDialogue = state.pt2DefaultDialogue;
pt2EventDialogue = state.pt2EventDialogue;
}
开发者ID:syncsophia,项目名称:CS4350Project,代码行数:18,代码来源:Item.cs
示例16: Issue
public Issue(Uri url, Uri htmlUrl, int number, ItemState state, string title, string body, User user, IReadOnlyList<Label> labels, User assignee, Milestone milestone, int comments, PullRequest pullRequest, DateTimeOffset? closedAt, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
{
Url = url;
HtmlUrl = htmlUrl;
Number = number;
State = state;
Title = title;
Body = body;
User = user;
Labels = labels;
Assignee = assignee;
Milestone = milestone;
Comments = comments;
PullRequest = pullRequest;
ClosedAt = closedAt;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
}
开发者ID:alexgyori,项目名称:octokit.net,代码行数:18,代码来源:Issue.cs
示例17: DrawButton
public void DrawButton(Graphics g, Rectangle rectangle, string text, Font font, StringFormat fmt, ItemState state, bool hasBorder, bool enabled)
{
if (rectangle.Width > 0 && rectangle.Height > 0)
{
if (!enabled)
{
ControlPaint.DrawButton(g, rectangle, ButtonState.Inactive);
}
else
{
switch (state)
{
case ItemState.Normal:
g.FillRectangle(SystemBrushes.ButtonFace, rectangle);
break;
case ItemState.HotTrack:
g.FillRectangle(SystemBrushes.ControlLightLight, rectangle);
break;
case ItemState.Open:
case ItemState.Pressed:
g.FillRectangle(SystemBrushes.ControlLight, rectangle);
break;
default:
break;
}
}
if (!string.IsNullOrEmpty(text))
{
if (enabled)
{
g.DrawString(text, font, SystemBrushes.ControlText, rectangle, fmt);
}
else
{
g.DrawString(text, font, SystemBrushes.GrayText, rectangle, fmt);
}
}
if (hasBorder)
DrawBorder(g, new Rectangle(rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1), enabled);
}
}
开发者ID:HEskandari,项目名称:FarsiLibrary,代码行数:43,代码来源:FAPainterOffice2000.cs
示例18: OnTouch
public void OnTouch(Transform _toucher)
{
Debug.LogWarning(_toucher.name);
if(!PetNetwork.PetItemConfirmDialogVisibility && !PetNetwork.PetItemDialogVisibility) {
//&& Application.loadedLevelName == "default" && Main3D_Component.SetContoler(gameObject)){
toucher = _toucher;
switch(touchState){
case ItemState.none:
//if((_toucher.gameObject.GetComponent("MoveTo") as MoveTo).user.user_lite.user_id == petDetail.user_id.ToString()){
touchState = ItemState.mytouch;
/*}else{
touchState = ItemState.touch;
}*/
break;
case ItemState.touch:
break;
}
}
}
开发者ID:GMOM-RHIE,项目名称:gesodogs_proto2,代码行数:19,代码来源:PetMove.cs
示例19: CreatePullRequest
protected static PullRequest CreatePullRequest(User user, int id, ItemState state, string title,
DateTimeOffset createdAt, DateTimeOffset updatedAt, int commentCount = 0, int reviewCommentCount = 0)
{
var uri = new Uri("https://url");
var uris = uri.ToString();
var repo = new Repository(uris, uris, uris, uris, uris, uris, uris,
1, user, "Repo", "Repo", string.Empty, string.Empty, string.Empty,
false, false, 0, 0, "master",
0, null, createdAt, updatedAt,
null, null, null,
false, false, false);
return new PullRequest(uri, uri, uri, uri, uri, uri,
id, state, title, "", createdAt, updatedAt,
null, null,
new GitReference(uri.ToString(), "foo:bar", "bar", "123", user, repo),
new GitReference(uri.ToString(), "foo:baz", "baz", "123", user, repo),
user, null, false, null,
commentCount, reviewCommentCount, 0, 0, 0, 0,
null, false);
}
开发者ID:github,项目名称:VisualStudio,代码行数:20,代码来源:TestBaseClass.cs
示例20: DrawItem
/// <summary>
/// Draws the specified item on the given graphics.
/// </summary>
/// <param name="g">The System.Drawing.Graphics to draw on.</param>
/// <param name="item">The ImageListViewItem to draw.</param>
/// <param name="state">The current view state of item.</param>
/// <param name="bounds">The bounding rectangle of item in client coordinates.</param>
public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
{
if (item.Index == mImageListView.layoutManager.FirstPartiallyVisible ||
item.Index == mImageListView.layoutManager.LastPartiallyVisible)
{
using (Brush b = new HatchBrush(HatchStyle.BackwardDiagonal, Color.Green, Color.Transparent))
{
g.FillRectangle(b, bounds);
}
}
if (item.Index == mImageListView.layoutManager.FirstVisible ||
item.Index == mImageListView.layoutManager.LastVisible)
{
using (Brush b = new HatchBrush(HatchStyle.ForwardDiagonal, Color.Red, Color.Transparent))
{
g.FillRectangle(b, bounds);
}
}
base.DrawItem(g, item, state, bounds);
}
开发者ID:priceLiu,项目名称:imgListView,代码行数:28,代码来源:DebugRenderer.cs
注:本文中的ItemState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论