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


C# SelectedItem类代码示例

本文整理汇总了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);
        }
开发者ID:mnuni,项目名称:gitextensions,代码行数:7,代码来源:Commit.cs

示例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;
         }
     }
 }
开发者ID:AzarinSergey,项目名称:learn,代码行数:30,代码来源:CatalogPart.ascx.cs

示例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);
        }
开发者ID:Carbenium,项目名称:gitextensions,代码行数:29,代码来源:ItemCommandBase.cs

示例4: ModelChoser

 public ModelChoser(DTE dte, SelectedItem item)
     : this()
 {
     _dte = dte;
     _selectedItem = item;
     _allModels = new List<ProjectItem>();
 }
开发者ID:jradxl,项目名称:EF-Designer-Extension-Starter-Kit,代码行数:7,代码来源:ModelChoser.cs

示例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);
 }
开发者ID:qgppl,项目名称:gitextensions,代码行数:7,代码来源:Clone.cs

示例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();
        }
开发者ID:usedflax,项目名称:flaxbox,代码行数:31,代码来源:TitleScreen.cs

示例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;
 }
开发者ID:Galad,项目名称:SpecFlow,代码行数:8,代码来源:SpecFlowProjectSingleSelectionCommand.cs

示例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);
            }
开发者ID:Nexuapex,项目名称:niftyplugins,代码行数:12,代码来源:P4RevisionGraphItem.cs

示例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;
		}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:19,代码来源:DteHelper2.cs

示例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);
        }
开发者ID:sketchydtail,项目名称:brickles3k,代码行数:49,代码来源:Menu.cs

示例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();
    }
开发者ID:Wiebrendh,项目名称:MMORPG,代码行数:15,代码来源:Toolbar.cs

示例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");
            }
        }
开发者ID:devbar,项目名称:PB-Addin-Dw2Struct,代码行数:46,代码来源:PBHelper.cs

示例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);
                }
            }
开发者ID:Nexuapex,项目名称:niftyplugins,代码行数:20,代码来源:P4RenameItem.cs

示例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;
        }
开发者ID:0x6e6562,项目名称:webgac,代码行数:19,代码来源:Connect.cs


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