本文整理汇总了C#中SelectedItem类的典型用法代码示例。如果您正苦于以下问题:C# SelectedItem类的具体用法?C# SelectedItem怎么用?C# SelectedItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SelectedItem类属于命名空间,在下文中一共展示了SelectedItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnExecute
public override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
{
const string saveAllCommandName = "File.SaveAll";
item.DTE.ExecuteCommand(saveAllCommandName, string.Empty);
RunGitEx("commit", fileName);
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (System.IO.Path.GetFileName(Request.Path).ToLower() == "catalog.aspx" && Request["categoryid"].IsNotEmpty())
{
switch (Request["categoryid"].ToLower())
{
case "allproducts" :
selectedItem = SelectedItem.AllProducts;
break;
case "withoutcategory":
selectedItem = SelectedItem.WithoutCategory;
break;
}
}
else if (System.IO.Path.GetFileName(Request.Path).ToLower() == "productsonmain.aspx" && Request["type"].IsNotEmpty())
{
switch (Request["type"].ToLower())
{
case "new":
selectedItem = SelectedItem.New;
break;
case "bestseller":
selectedItem = SelectedItem.Bestseller;
break;
case "discount":
selectedItem = SelectedItem.Discount;
break;
}
}
}
示例3: ExecuteOnSolutionItem
private void ExecuteOnSolutionItem(SelectedItem solutionItem, DTE2 application, OutputWindowPane pane)
{
if (solutionItem.ProjectItem != null && IsTargetSupported(GetProjectItemTarget(solutionItem.ProjectItem)))
{
//Unfortunaly FileNames[1] is not supported by .net 3.5
OnExecute(solutionItem, solutionItem.ProjectItem.get_FileNames(1), pane);
return;
}
if (solutionItem.Project != null && IsTargetSupported(CommandTarget.Project))
{
OnExecute(solutionItem, solutionItem.Project.FullName, pane);
return;
}
if (application.Solution.IsOpen && IsTargetSupported(CommandTarget.Solution))
{
OnExecute(solutionItem, application.Solution.FullName, pane);
return;
}
if (IsTargetSupported(CommandTarget.Empty))
{
OnExecute(solutionItem, null, pane);
return;
}
MessageBox.Show("You need to select a file or project to use this function.", "Git Extensions", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
示例4: ModelChoser
public ModelChoser(DTE dte, SelectedItem item)
: this()
{
_dte = dte;
_selectedItem = item;
_allModels = new List<ProjectItem>();
}
示例5: OnExecute
protected override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
{
if (!string.IsNullOrEmpty(fileName) && Path.GetInvalidPathChars().Any(fileName.Contains))
fileName = "";
var directoryName = Path.GetDirectoryName(fileName);
RunGitEx("clone", directoryName);
}
示例6: Update
public static void Update()
{
KeyboardState newState = Keyboard.GetState();
if (_oldState.IsKeyUp(Keys.Down) && newState.IsKeyDown(Keys.Down))
{
_selectedItem++;
if (_selectedItem > SelectedItem.Exit)
{
_selectedItem = SelectedItem.Singleplayer;
}
CheckSelection();
}
else if (_oldState.IsKeyUp(Keys.Up) && newState.IsKeyDown(Keys.Up))
{
_selectedItem--;
if (_selectedItem < SelectedItem.Singleplayer)
{
_selectedItem = SelectedItem.Exit;
}
CheckSelection();
}
_oldState = newState;
_singleplayer.Update();
_multiplayer.Update();
_exit.Update();
}
示例7: IsInSpecFlowProject
private bool IsInSpecFlowProject(SelectedItem selectedItem)
{
if (selectedItem.Project != null)
return IsInSpecFlowProject(selectedItem.Project);
if (selectedItem.ProjectItem != null)
return IsInSpecFlowProject(selectedItem.ProjectItem.ContainingProject);
return false;
}
示例8: OnExecute
public override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
{
string message = "You are about to revert the file '" + fileName + "'. Do you want to do this?";
if (MessageBox.Show(message, "Revert File?", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
P4Operations.RevertFile(pane, fileName);
}
}
开发者ID:transformersprimeabcxyz,项目名称:_To-Do-unreal-3D-niftyplugins-ben-marsh,代码行数:8,代码来源:P4RevertItem.cs
示例9: OnExecute
public override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
{
string dirname = Path.GetDirectoryName(fileName);
if (mMainLine)
{
Config options = (Config)Plugin.Options;
fileName = P4Operations.RemapToMain(fileName, options.MainLinePath);
}
P4Operations.RevisionGraph(pane, dirname, fileName);
}
示例10: BuildPath
/// <summary>
/// Gets an string representation from the current selected item in the solution explorer window.
/// </summary>
/// <param name="toSelectedItem"></param>
/// <returns></returns>
public static string BuildPath(SelectedItem toSelectedItem)
{
Guard.ArgumentNotNull(toSelectedItem, "toSelectedItem");
if(toSelectedItem.ProjectItem != null)
{
return BuildPath(toSelectedItem.ProjectItem);
}
else if(toSelectedItem.Project != null)
{
return BuildPath(toSelectedItem.Project);
}
return toSelectedItem.Name;
}
示例11: Update
public override void Update(GameTime gameTime)
{
keystate = Keyboard.GetState();
if (keystate.IsKeyDown(Keys.Down) && !lastState.IsKeyDown(Keys.Up))
{
selectedItem++;
}
else if (keystate.IsKeyDown(Keys.Up) && !lastState.IsKeyDown(Keys.Down))
{
selectedItem--;
}
if (selectedItem < SelectedItem.Play)
{
selectedItem = SelectedItem.Quit;
}
else if (selectedItem > SelectedItem.Quit)
{
selectedItem = SelectedItem.Play;
}
if (gameTime.TotalGameTime.Seconds > 1)
{
if ((keystate.IsKeyDown(Keys.Enter) && !lastState.IsKeyDown(Keys.Enter)) ||
(keystate.IsKeyDown(Keys.Space) && !lastState.IsKeyDown(Keys.Space)))
{
switch (selectedItem)
{
case SelectedItem.Play:
NextScene();
break;
case SelectedItem.Collectables:
break;
case SelectedItem.Highscores:
break;
case SelectedItem.Options:
break;
case SelectedItem.Quit:
game.Exit();
break;
}
}
}
lastState = keystate;
base.Update(gameTime);
}
示例12: SetSelectedItem
public void SetSelectedItem(string itemName)
{
// Deactivate the old selected item
itemObjects[(int)item].SetActive(false);
// Set item to new selected item
item = (SelectedItem)Enum.Parse(typeof(SelectedItem), itemName);
// Activate the new selected item
itemObjects[(int)item].SetActive(true);
// Check if client has to request data
if (itemName == "Levels")
sender.SendLevelsRequest();
}
示例13: GenerateNonVisualObject
/// <summary>
/// generates an nvo from the datawindow
/// </summary>
/// <param name="item"></param>
public void GenerateNonVisualObject(SelectedItem item)
{
string file = GetSelectedFileName(item);
if (!String.IsNullOrEmpty(file))
{
bool fileNew = false;
string syntax = null;
string nonv = null;
string nonvName = Regex.Replace(file.Substring(file.LastIndexOf("\\") + 1).Replace(".srd", ""), "^d_", "n_");
string nonvFile = file.Substring(0, file.LastIndexOf("\\") + 1) + nonvName + ".sru";
StreamReader reader = null;
StreamWriter writer = null;
n_dw2struct dw2struct = new n_dw2struct();
reader = new StreamReader(new FileStream(file, FileMode.Open));
syntax = reader.ReadToEnd();
reader.Close();
nonv = dw2struct.GenerateNonvisual(syntax, nonvName);
if (File.Exists(nonvFile))
{
if (MessageBox.Show("The File " + nonvFile + " does already exist. Do you want to override it?", "Override", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
return;
else
File.Delete(nonvFile);
}
else
{
fileNew = true;
}
writer = new StreamWriter(new FileStream(nonvFile, FileMode.CreateNew));
writer.Write(nonv);
writer.Flush();
writer.Close();
if(fileNew)
AddToPbl(nonvFile, nonvName + ".sru");
}
}
示例14: OnExecute
public override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "Source: " + fileName;
dlg.Multiselect = false;
dlg.CheckFileExists = false;
dlg.CheckPathExists = false;
dlg.InitialDirectory = Path.GetDirectoryName(fileName);
dlg.FileName = Path.GetFileName(fileName);
if (DialogResult.OK == dlg.ShowDialog())
{
string newName = dlg.FileName;
P4Operations.IntegrateFile(pane, newName, fileName);
P4Operations.EditFile(pane, item.ProjectItem.ContainingProject.FullName);
item.ProjectItem.Collection.AddFromFile(newName);
item.ProjectItem.Delete();
P4Operations.DeleteFile(pane, fileName);
}
}
示例15: FindProject
private Project FindProject(SelectedItem pItem, UIHierarchyItem pHItem)
{
if (pItem.Project != null) {
return pItem.Project;
}
if (pHItem.Object is Project) {
return (Project)pHItem.Object;
} else if (pHItem.Object is ProjectItem) {
return ((ProjectItem)pHItem.Object).ContainingProject;
} else if (pHItem.Collection.Parent is UIHierarchyItem) {
return FindProject(pItem, (UIHierarchyItem) pHItem.Collection.Parent);
}
// TODO: They've selected the "References" folder. So we need another mechanism to work out what project we're in.
MessageBox.Show(mWndHandleWrapper, "Cannot find Project for selected item!");
return null;
}