Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        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);
        }
 public ModelChoser(DTE dte, SelectedItem item)
     : this()
 {
     _dte = dte;
     _selectedItem = item;
     _allModels = new List<ProjectItem>();
 }
Ejemplo n.º 5
0
        public override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
        {
            const string saveAllCommandName = "File.SaveAll";

            item.DTE.ExecuteCommand(saveAllCommandName, string.Empty);
            RunGitEx("commit", fileName);
        }
Ejemplo n.º 6
0
 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;
         }
     }
 }
 private bool IsInSpecFlowProject(SelectedItem selectedItem)
 {
     if (selectedItem.Project != null)
         return IsInSpecFlowProject(selectedItem.Project);
     if (selectedItem.ProjectItem != null)
         return IsInSpecFlowProject(selectedItem.ProjectItem.ContainingProject);
     return false;
 }
 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);
     }
 }
Ejemplo n.º 9
0
            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);
            }
Ejemplo n.º 10
0
		/// <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;
		}
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
    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();
    }
Ejemplo n.º 13
0
        /// <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");
            }
        }
Ejemplo n.º 14
0
            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);
                }
            }
Ejemplo n.º 15
0
 protected override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
 {
     RunGitEx("clone", fileName);
 }
Ejemplo n.º 16
0
 protected override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
 {
     throw new System.NotImplementedException();
 }
        /// <summary>
        /// Determines whether the specified item is ignored when publishing.
        /// </summary>
        /// <param name="item">The item to check.</param>
        /// <returns>true, if the item is ignored on publish; otherwise, false.</returns>
        private bool IsItemIgnored(SelectedItem item)
        {
            if (item == null || !(item.ProjectItem is ProjectItem))
                return false;

            // get settings
            ProjectSettings settings = SettingsStore.Get(item.GetProject());
            if (settings == null)
                return false;

            // only process project items
            string path = item.ProjectItem.GetRelativePath();
            return settings.IsItemIgnored(path);
        }
Ejemplo n.º 18
0
        //=====================================================================

        /// <summary>
        /// This is used to determine the containing project and settings filename when adding a new spell
        /// checker configuration file.
        /// </summary>
        /// <param name="containingProject">On return, this contains the containing project or null if adding
        /// a solution configuration file.</param>
        /// <param name="settingsFilename">On return, this contains the name of the settings file to be added</param>
        /// <returns>True if a settings file can be added for the item selected in the Solution Explorer window
        /// or false if not.</returns>
        private static bool DetermineContainingProjectAndSettingsFile(out Project containingProject,
                                                                      out string settingsFilename)
        {
            string folderName = null;

            containingProject = null;
            settingsFilename  = null;

            var dte2 = Utility.GetServiceFromPackage <DTE2, SDTE>(true);

            // Only add if a single file is selected
            if (dte2 == null || dte2.SelectedItems.Count != 1)
            {
                return(false);
            }

            SelectedItem item = dte2.SelectedItems.Item(1);

            if (item.Project != null && item.Project.Kind != EnvDTE.Constants.vsProjectKindSolutionItems &&
                item.Project.Kind != EnvDTE.Constants.vsProjectKindUnmodeled &&
                item.Project.Kind != EnvDTE.Constants.vsProjectKindMisc)
            {
                // Looks like a project
                Property fullPath = item.Project.Properties.Item("FullPath");

                if (fullPath != null && fullPath.Value != null)
                {
                    string path = (string)fullPath.Value;

                    if (!String.IsNullOrWhiteSpace(path))
                    {
                        var project = dte2.Solution.Projects.OfType <Project>().FirstOrDefault(p => p.Name == item.Name);

                        if (project != null)
                        {
                            containingProject = project;
                            settingsFilename  = project.FullName;
                        }
                    }
                }
            }
            else
            if (item.ProjectItem == null || item.ProjectItem.ContainingProject == null)
            {
                // Looks like a solution
                if (Path.GetFileNameWithoutExtension(dte2.Solution.FullName) == item.Name)
                {
                    settingsFilename = dte2.Solution.FullName;
                }
            }
            else
            if (item.ProjectItem.Properties != null)
            {
                // Looks like a folder or file item
                Property fullPath = item.ProjectItem.Properties.Item("FullPath");

                if (fullPath != null && fullPath.Value != null)
                {
                    string path = (string)fullPath.Value;

                    if (!String.IsNullOrWhiteSpace(path))
                    {
                        containingProject = item.ProjectItem.ContainingProject;

                        // Folder items have a trailing backslash.  We'll put the configuration file in
                        // the folder using its name as the filename.
                        if (path[path.Length - 1] == '\\')
                        {
                            folderName       = path;
                            settingsFilename = path + item.Name;
                        }
                        else
                        {
                            settingsFilename = path;
                        }
                    }
                }
            }

            if (settingsFilename != null)
            {
                if (settingsFilename.EndsWith(".vsspell", StringComparison.OrdinalIgnoreCase) ||
                    ((folderName == null && !File.Exists(settingsFilename)) ||
                     (folderName != null && !Directory.Exists(folderName))))
                {
                    settingsFilename = null;
                }
                else
                if (folderName == null)
                {
                    // Since we can't create an exhaustive list of file types that we cannot spell check,
                    // take a peek at the first 1024 bytes.  If it looks like a binary file, ignore it.
                    // Quick and dirty but mostly effective.
                    try
                    {
                        using (StreamReader sr = new StreamReader(settingsFilename, true))
                        {
                            var fileChars  = new char[1024];
                            var validChars = new[] { '\b', '\t', '\r', '\n', '\x07', '\x0B', '\x0C' };

                            // Note the length as it may be less than the maximum
                            int length = sr.Read(fileChars, 0, fileChars.Length);

                            if (fileChars.Take(length).Any(c => c < 32 && !validChars.Contains(c)))
                            {
                                settingsFilename = null;
                            }
                            else
                            {
                                settingsFilename += ".vsspell";
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        // Ignore errors, just don't offer to add a settings file
                        settingsFilename = null;
                        System.Diagnostics.Debug.WriteLine(ex);
                    }
                }
            }

            return(settingsFilename != null);
        }
Ejemplo n.º 19
0
 public abstract void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane);
Ejemplo n.º 20
0
 protected override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
 {
     RunGitEx("remotes", fileName);
 }
Ejemplo n.º 21
0
        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;
        }
        private void OptimizeContextEF5(
            LanguageOption languageOption,
            string baseFileName,
            StorageMappingItemCollection mappingCollection,
            SelectedItem selectedItem)
        {
            DebugCheck.NotEmpty(baseFileName);
            DebugCheck.NotNull(mappingCollection);

            OptimizeContextCore(
                languageOption,
                baseFileName,
                selectedItem,
                viewsPath =>
                {
                    var viewGenerator = new EntityViewGenerator(languageOption);
                    var errors = viewGenerator.GenerateViews(mappingCollection, viewsPath);
                    errors.HandleErrors(Strings.Optimize_SchemaError(baseFileName));
                });
        }
Ejemplo n.º 23
0
        public void Draw(Graphics g)
        {
            bool isActive = false;

            if (SelectedItem != null)
            {
                isActive = true;
            }

            if (SelectedItem != null)
            {
                ResizeRotate = new ResizeRotateHandler(SelectedItem.GetBounds().Size, SelectedItem.GetBounds().Location);
                ResizeRotate.Draw(g, isActive);
            }



            if (isActive == false)
            {
                ResizeRotate = null;
            }
        }
Ejemplo n.º 24
0
 public override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
 {
     P4Operations.EditFile(pane, fileName);
 }
Ejemplo n.º 25
0
 private static CommandTarget GetSelectedItemTarget(SelectedItem selectedItem, DTE2 application)
 {
     if (selectedItem.ProjectItem != null)
         return GetProjectItemTarget(selectedItem.ProjectItem);
     if (selectedItem.Project != null)
         return CommandTarget.Project;
     if (application.Solution.IsOpen)
         return CommandTarget.Solution;
     return CommandTarget.Empty;
 }
Ejemplo n.º 26
0
 public override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
 {
     RunGitEx("mergeconflicts", fileName);
 }
 public VisualStudioSelectedItem(SelectedItem selectedItem)
 {
     this.selectedItem = selectedItem;
     Initialize();
 }
        private string GetLocalPath(SelectedItem item)
        {
            string result = string.Empty;

            if (item.ProjectItem == null)
            {
                if (item.Project == null)
                {
                    // If there's no ProjectItem and no Project then it's (probably?) the solution
                    result = dte.Solution.FullName;
                }
                else
                {
                    // If there's no ProjectItem but there is a Project then the Project node is selected
                    result = item.Project.FullName;
                }
            }
            else
            {
                // Just selected a file
                // Regular items in a project seem to be zero-based
                // Items inside of solution folders seem to be one-based...
                try
                {
                    result = item.ProjectItem.get_FileNames(0);
                }
                catch (ArgumentException)
                {
                    result = item.ProjectItem.get_FileNames(1);
                }
            }
            return result;
        }
        public TravelExpensePageViewModel(INavigationService navigationService, IPageDialogService dialogService,
                                          TravelExpenseService travelExpenseService,
                                          MyUserService myUserService, TravelExpenseDetailService travelExpenseDetailService,
                                          RefreshTokenService refreshTokenService,
                                          SystemStatusService systemStatusService, AppStatus appStatus)
        {
            this.navigationService          = navigationService;
            this.dialogService              = dialogService;
            this.travelExpenseService       = travelExpenseService;
            this.myUserService              = myUserService;
            this.travelExpenseDetailService = travelExpenseDetailService;
            this.refreshTokenService        = refreshTokenService;
            this.systemStatusService        = systemStatusService;
            this.appStatus = appStatus;

            #region 新增紀錄
            AddCommand = new DelegateCommand(async() =>
            {
                NavigationParameters paras = new NavigationParameters();
                var fooObject       = new TravelExpenseDto();
                fooObject.ApplyDate = DateTime.Now.Date;

                #region 設定該使用者為預設紀錄申請者
                var myUser = myUserService.Items
                             .FirstOrDefault(x => x.Id == appStatus.SystemStatus.UserID);
                if (myUser != null)
                {
                    fooObject.MyUserId   = myUser.Id;
                    fooObject.MyUserName = myUser.Name;
                }
                #endregion

                paras.Add(MagicStringHelper.CurrentSelectdItemParameterName, fooObject);
                paras.Add(MagicStringHelper.CrudActionName, MagicStringHelper.CrudAddAction);
                await navigationService.NavigateAsync("TravelExpenseRecordPage", paras);
            });
            #endregion

            #region 點選某筆紀錄觸發命令
            ItemTappedCommand = new DelegateCommand(async() =>
            {
                NavigationParameters paras = new NavigationParameters();
                var fooObject = SelectedItem.Clone();
                paras.Add(MagicStringHelper.CurrentSelectdItemParameterName, fooObject);
                paras.Add(MagicStringHelper.CrudActionName, MagicStringHelper.CrudEditAction);
                await navigationService.NavigateAsync("TravelExpenseRecordPage", paras);
            });
            #endregion

            #region 更新遠端紀錄命令
            RefreshCommand = new DelegateCommand(async() =>
            {
                IsRefresh = true;
                await ReloadData();
                IsRefresh = false;
            });
            #endregion

            #region 顯示明細頁面
            ShowDetailCommand = new DelegateCommand <TravelExpenseDto>(async x =>
            {
                #region 讀取該筆明細清單
                using (IProgressDialog fooIProgressDialog = UserDialogs.Instance.Loading($"請稍後,更新資料中...",
                                                                                         null, null, true, MaskType.Black))
                {
                    await AppStatusHelper.ReadAndUpdateAppStatus(systemStatusService, appStatus);
                    #region 檢查 Access Token 是否還可以使用
                    bool refreshTokenResult = await RefreshTokenHelper
                                              .CheckAndRefreshToken(dialogService, refreshTokenService,
                                                                    systemStatusService, appStatus);
                    if (refreshTokenResult == false)
                    {
                        return;
                    }
                    #endregion

                    #region 取得 差旅費用明細紀錄
                    fooIProgressDialog.Title = "請稍後,取得 差旅費用明細紀錄";
                    var apiResultssss        = await travelExpenseDetailService.GetAsync(x.Id);
                    if (apiResultssss.Status == true)
                    {
                        await travelExpenseDetailService.WriteToFileAsync();

                        NavigationParameters paras = new NavigationParameters();
                        paras.Add(MagicStringHelper.MasterRecordActionName, x);
                        await navigationService.NavigateAsync("TravelExpenseDetailPage", paras);
                    }
                    else
                    {
                        await DialogHelper.ShowAPIResultIsFailureMessage(dialogService, apiResultssss);
                        return;
                    }
                    #endregion
                }
                #endregion
            });
            #endregion
        }
 private ProjectItemOrProject(SelectedItem item)
 {
     Project     = item.Project;
     ProjectItem = item.ProjectItem;
 }
        private void OptimizeContextCore(
            LanguageOption languageOption,
            string baseFileName,
            SelectedItem selectedItem,
            Action<string> generateAction)
        {
            DebugCheck.NotEmpty(baseFileName);

            var progressTimer = new Timer { Interval = 1000 };

            try
            {
                var selectedItemPath = (string)selectedItem.ProjectItem.Properties.Item("FullPath").Value;
                var viewsFileName = baseFileName
                    + ".Views"
                    + ((languageOption == LanguageOption.GenerateCSharpCode)
                        ? FileExtensions.CSharp
                        : FileExtensions.VisualBasic);
                var viewsPath = Path.Combine(
                    Path.GetDirectoryName(selectedItemPath),
                    viewsFileName);

                _package.DTE2.SourceControl.CheckOutItemIfNeeded(viewsPath);

                var progress = 1;
                progressTimer.Tick += (sender, e) =>
                    {
                        _package.DTE2.StatusBar.Progress(true, string.Empty, progress, 100);
                        progress = progress == 100 ? 1 : progress + 1;
                        _package.DTE2.StatusBar.Text = Strings.Optimize_Begin(baseFileName);
                    };

                progressTimer.Start();

                Task.Factory.StartNew(
                        () =>
                        {
                            generateAction(viewsPath);
                        })
                    .ContinueWith(
                        t =>
                        {
                            progressTimer.Stop();
                            _package.DTE2.StatusBar.Progress(false);

                            if (t.IsFaulted)
                            {
                                _package.LogError(Strings.Optimize_Error(baseFileName), t.Exception);

                                return;
                            }

                            selectedItem.ProjectItem.ContainingProject.ProjectItems.AddFromFile(viewsPath);
                            _package.DTE2.ItemOperations.OpenFile(viewsPath);

                            _package.DTE2.StatusBar.Text = Strings.Optimize_End(baseFileName, Path.GetFileName(viewsPath));
                        },
                        TaskScheduler.FromCurrentSynchronizationContext());
            }
            catch
            {
                progressTimer.Stop();
                _package.DTE2.StatusBar.Progress(false);

                throw;
            }
        }
Ejemplo n.º 32
0
 private Task ShowMessage(SelectedItem e)
 {
     Trace?.Log($"Dropdown Item Clicked: Value={e.Value} Text={e.Text}");
     return(Task.CompletedTask);
 }
Ejemplo n.º 33
0
 public abstract void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane);
        private void OptimizeContextEF6(
            LanguageOption languageOption,
            string baseFileName,
            dynamic mappingCollection,
            SelectedItem selectedItem,
            string contextTypeName)
        {
            DebugCheck.NotEmpty(baseFileName);

            OptimizeContextCore(
                languageOption,
                baseFileName,
                selectedItem,
                viewsPath =>
                {
                    var edmSchemaError = ((Type)mappingCollection.GetType()).Assembly
                        .GetType("System.Data.Entity.Core.Metadata.Edm.EdmSchemaError", true);
                    var listOfEdmSchemaError = typeof(List<>).MakeGenericType(edmSchemaError);
                    var errors = Activator.CreateInstance(listOfEdmSchemaError);
                    var views = ((Type)mappingCollection.GetType())
                        .GetMethod("GenerateViews", new[] { listOfEdmSchemaError })
                        .Invoke(mappingCollection, new[] { errors });

                    foreach (var error in (IEnumerable<dynamic>)errors)
                    {
                        if ((int)error.Severity == 1)
                        {
                            throw new EdmSchemaErrorException(Strings.Optimize_SchemaError(baseFileName));
                        }
                    }

                    var viewGenerator = languageOption == LanguageOption.GenerateVBCode
                        ? (IViewGenerator)new VBViewGenerator()
                        : new CSharpViewGenerator();
                    viewGenerator.ContextTypeName = contextTypeName;
                    viewGenerator.MappingHashValue = mappingCollection.ComputeMappingHashValue();
                    viewGenerator.Views = views;

                    File.WriteAllText(viewsPath, viewGenerator.TransformText());
                });
        }
Ejemplo n.º 35
0
        public bool MouseMoveEvent(MouseEventArgs e)
        {
            switch (Operation)
            {
            case 2:
            {
                SelectedItem.ResizeShape(e.X - MousePosition.X, e.Y - MousePosition.Y, ResizeRotateNumber);
                MousePosition = new Point(e.X, e.Y);
                return(true);
            }

            case 3:
            {
                if ((MousePosition.Y - e.Y) != 0)
                {
                    float angle = (float)RotateAngle(new Point((int)MousePosition.X, (int)MousePosition.Y), new Point(e.X, e.Y), new Point(SelectedItem.GetBounds().Location.X + SelectedItem.GetBounds().Size.Width / 2, SelectedItem.GetBounds().Location.Y + SelectedItem.GetBounds().Size.Height / 2));

                    SelectedItem.RotateShape(new Point(SelectedItem.GetBounds().Location.X + SelectedItem.GetBounds().Size.Width / 2, SelectedItem.GetBounds().Location.Y + SelectedItem.GetBounds().Size.Height / 2), angle);

                    MousePosition = new Point(e.X, e.Y);
                }
                return(true);
            }
            }
            return(false);
        }
Ejemplo n.º 36
0
        public override System.CodeDom.CodeExpression GCode_CodeDom_GetValue(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context, CodeGenerateSystem.Base.GenerateCodeContext_PreNode preNodeContext = null)
        {
            var param   = CSParam as EnumConstructParam;
            var newType = EngineNS.CEngine.Instance.MacrossDataManager.MacrossScripAssembly.GetType(param.EnumType.FullName);

            string str = "";

            if (mFlag)
            {
                var enumParam = CSParam as EnumConstructParam;
                foreach (var val in enumParam.FlagEnumValues)
                {
                    var name = System.Enum.GetName(newType, val);
                    str += name + "|";
                }
                str = str.TrimEnd('|');
            }
            else
            {
                str = SelectedItem.ToString();
            }
            return(new System.CodeDom.CodeFieldReferenceExpression(new System.CodeDom.CodeTypeReferenceExpression(param.EnumType), SelectedItem.ToString()));
        }
Ejemplo n.º 37
0
 /// <summary>Validates the selected item.</summary>
 public void Validate()
 {
     IsValid = RequiredType == null ||
               SelectedItem == null ||
               RequiredType.IsAssignableFrom(SelectedItem.GetContentType());
 }
Ejemplo n.º 38
0
 public void Execute()
 {
     SelectedItem?.Execute();
 }
 public static ProjectItemOrProject From(SelectedItem selectedItem)
 {
     return(new ProjectItemOrProject(selectedItem));
 }
Ejemplo n.º 40
0
        private void OptimizeContextCore(
            LanguageOption languageOption,
            string baseFileName,
            SelectedItem selectedItem,
            Action <string> generateAction)
        {
            DebugCheck.NotEmpty(baseFileName);

            var progressTimer = new Timer {
                Interval = 1000
            };

            try
            {
                var selectedItemPath = (string)selectedItem.ProjectItem.Properties.Item("FullPath").Value;
                var viewsFileName    = baseFileName
                                       + ".Views"
                                       + ((languageOption == LanguageOption.GenerateCSharpCode)
                        ? FileExtensions.CSharp
                        : FileExtensions.VisualBasic);
                var viewsPath = Path.Combine(
                    Path.GetDirectoryName(selectedItemPath),
                    viewsFileName);

                _package.DTE2.SourceControl.CheckOutItemIfNeeded(viewsPath);

                var progress = 1;
                progressTimer.Tick += (sender, e) =>
                {
                    _package.DTE2.StatusBar.Progress(true, string.Empty, progress, 100);
                    progress = progress == 100 ? 1 : progress + 1;
                    _package.DTE2.StatusBar.Text = Strings.Optimize_Begin(baseFileName);
                };

                progressTimer.Start();

                Task.Factory.StartNew(
                    () =>
                {
                    generateAction(viewsPath);
                })
                .ContinueWith(
                    t =>
                {
                    progressTimer.Stop();
                    _package.DTE2.StatusBar.Progress(false);

                    if (t.IsFaulted)
                    {
                        _package.LogError(Strings.Optimize_Error(baseFileName), t.Exception);

                        return;
                    }

                    selectedItem.ProjectItem.ContainingProject.ProjectItems.AddFromFile(viewsPath);
                    _package.DTE2.ItemOperations.OpenFile(viewsPath);

                    _package.DTE2.StatusBar.Text = Strings.Optimize_End(baseFileName, Path.GetFileName(viewsPath));
                },
                    TaskScheduler.FromCurrentSynchronizationContext());
            }
            catch
            {
                progressTimer.Stop();
                _package.DTE2.StatusBar.Progress(false);

                throw;
            }
        }
Ejemplo n.º 41
0
 private Task OnRadioItemChanged(CheckboxState state, SelectedItem item)
 {
     RadioDropDownItems.Add(new SelectedItem($"{RadioDropDownItems.Count() + 1}", $"城市 {RadioDropDownItems.Count()}"));
     StateHasChanged();
     return(Task.CompletedTask);
 }
Ejemplo n.º 42
0
 public void RefreshChairs()
 {
     SelectedItem.RefreshChildItems();
 }
Ejemplo n.º 43
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //ITEMSVIEW
            case nameof(ItemsSource):
                return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));

            //LISTVIEW
            case nameof(HasUnevenRows):
                return(HasUnevenRows.ToString());

            case nameof(IsGroupingEnabled):
                return(IsGroupingEnabled.ToString());

            case nameof(RowHeight):
                return(RowHeight.ToString());

            case nameof(Footer):
                return(Footer.ToString());

            case nameof(Header):
                return(Header.ToString());

            case nameof(IsPullToRefreshEnabled):
                return(IsPullToRefreshEnabled.ToString());

            case nameof(IsRefreshing):
                return(IsRefreshing.ToString());

            case nameof(SelectedItem):
                return(SelectedItem.ToString());

            case nameof(SeparatorColor):
                return(SeparatorColor.ToHex());

            case nameof(this.SeparatorVisibility):
                return(SeparatorVisibility.ToString());

            default:
                return(string.Empty);
            }
        }
Ejemplo n.º 44
0
        private void PaintCombobox()
        {
            if (_buffer == null)
            {
                _buffer = new Bitmap(ClientRectangle.Width, ClientRectangle.Height);
            }

            using (var g = Graphics.FromImage(_buffer))
            {
                var rect = new Rectangle(0, 0, ClientSize.Width, ClientSize.Height);

                var textColor = Enabled
                    ? Colors.LightText
                    : Colors.DisabledText;

                var borderColor = Colors.GreySelection;
                var fillColor   = Colors.LightBackground;

                if (Focused && TabStop)
                {
                    borderColor = Colors.BlueHighlight;
                }

                using (var b = new SolidBrush(fillColor))
                {
                    g.FillRectangle(b, rect);
                }

                using (var p = new Pen(borderColor, 1))
                {
                    var modRect = new Rectangle(rect.Left, rect.Top, rect.Width - 1, rect.Height - 1);
                    g.DrawRectangle(p, modRect);
                }

                var icon = ScrollIcons.scrollbar_arrow_hot;
                g.DrawImageUnscaled(icon,
                                    rect.Right - icon.Width - (Consts.Padding / 2),
                                    (rect.Height / 2) - (icon.Height / 2));

                var text = SelectedItem != null?SelectedItem.ToString() : Text;

                using (var b = new SolidBrush(textColor))
                {
                    var padding = 2;

                    var modRect = new Rectangle(rect.Left + padding,
                                                rect.Top + padding,
                                                rect.Width - icon.Width - (Consts.Padding / 2) - (padding * 2),
                                                rect.Height - (padding * 2));

                    var stringFormat = new StringFormat
                    {
                        LineAlignment = StringAlignment.Center,
                        Alignment     = StringAlignment.Near,
                        FormatFlags   = StringFormatFlags.NoWrap,
                        Trimming      = StringTrimming.EllipsisCharacter
                    };

                    g.DrawString(text, Font, b, modRect, stringFormat);
                }
            }
        }
Ejemplo n.º 45
0
 protected override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 46
0
 private void ShowMessage(SelectedItem e)
 {
     Trace?.Log($"Dropdown Item Clicked: Value={e.Value} Text={e.Text}");
 }
Ejemplo n.º 47
0
    public void ItemSelected(SelectedItem cItem, currentSelection CS)
    {
        AB.PlaySound(selectOption, 1);
        Debug.Log(abilitieLists_u[currentList].displays.Length);
        if (abilitieLists_u[currentList].displays[cItem.index]._number.text == "")
        {
            Debug.Log("emptySpaceBro");
            return;
        }
        else if (abilitieLists_u[currentList].abilities.Count <= cItem.index)
        {
            if (selectTyp == currentSelection.selectAbility)
            {
                abilitieLists_u[currentList].displays[cItem.index].Select(true);
                GoToAdd(cItem);
                return;
            }
            else if (selectTyp == currentSelection.selectSwap)
            {
                Add(currentItem, cItem);
                return;
            }
            else
            {
                Debug.Log("emptySpaceBro");
                return;
            }
        }
        else if (abilitieLists_u[currentList].abilities[cItem.index] == null)
        {
            if (selectTyp == currentSelection.selectAbility)
            {
                abilitieLists_u[currentList].displays[cItem.index].Select(true);
                currentItem = cItem;
                GoToSwap();
                return;
            }
            else if (selectTyp == currentSelection.selectSwap)
            {
                SwapAbility(currentItem, cItem);
                return;
            }
            else
            {
                Debug.Log("emptySpaceBro");
                return;
            }
        }


        switch (selectTyp)
        {
        case currentSelection.selectAbility:
            abilitieLists_u[currentList].displays[cItem.index].Select(true);
            ItemSelected(cItem);
            break;

        case currentSelection.selectAction:

            break;

        case currentSelection.selectSwap:
            SwapAbility(cItem, currentItem);
            break;

        case currentSelection.selectAdd:
            Add(cItem, currentItem);
            break;
        }
    }
Ejemplo n.º 48
0
        /// <summary>
        /// Handles the MouseMove on the control
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Control_MouseMove(object sender, MouseEventArgs e)
        {
            if (IsSupsended || Disposed)
            {
                return;
            }

            HitTest(e.Location);

            #region Selected ones

            if (SelectedPanel != null && SelectedPanel != HittedPanel)
            {
                SelectedPanel.SetSelected(false);
                SelectedPanel.OnMouseLeave(e);
                Control.Invalidate(SelectedPanel.Bounds);
            }

            if (SelectedItem != null && SelectedItem != HittedItem)
            {
                SelectedItem.SetSelected(false);
                SelectedItem.OnMouseLeave(e);
                Control.Invalidate(SelectedItem.Bounds);
            }

            if (SelectedSubItem != null && SelectedSubItem != HittedSubItem)
            {
                SelectedSubItem.SetSelected(false);
                SelectedSubItem.OnMouseLeave(e);
                Control.Invalidate(Rectangle.Intersect(SelectedItem.Bounds, SelectedSubItem.Bounds));
            }

            #endregion

            #region Tab Scrolls
            if (HittedTab != null)
            {
                if (HittedTab.ScrollLeftVisible)
                {
                    HittedTab.SetScrollLeftSelected(HittedTabScrollLeft);
                    Control.Invalidate(HittedTab.ScrollLeftBounds);
                }
                if (HittedTab.ScrollRightVisible)
                {
                    HittedTab.SetScrollRightSelected(HittedTabScrollRight);
                    Control.Invalidate(HittedTab.ScrollRightBounds);
                }
            }
            #endregion

            #region Panel
            if (HittedPanel != null)
            {
                if (HittedPanel == SelectedPanel)
                {
                    HittedPanel.OnMouseMove(e);
                }
                else
                {
                    HittedPanel.SetSelected(true);
                    HittedPanel.OnMouseEnter(e);
                    Control.Invalidate(HittedPanel.Bounds);
                }
            }
            #endregion

            #region Item

            if (HittedItem != null)
            {
                if (HittedItem == SelectedItem)
                {
                    HittedItem.OnMouseMove(e);
                }
                else
                {
                    HittedItem.SetSelected(true);
                    HittedItem.OnMouseEnter(e);
                    Control.Invalidate(HittedItem.Bounds);
                }
            }

            #endregion

            #region SubItem

            if (HittedSubItem != null)
            {
                if (HittedSubItem == SelectedSubItem)
                {
                    HittedSubItem.OnMouseMove(e);
                }
                else
                {
                    HittedSubItem.SetSelected(true);
                    HittedSubItem.OnMouseEnter(e);
                    Control.Invalidate(Rectangle.Intersect(HittedItem.Bounds, HittedSubItem.Bounds));
                }
            }

            #endregion
        }
Ejemplo n.º 49
0
        public void DoGenerateViewPageModel(DTE2 Dte, ITextTemplating textTemplating, SelectedItem DestinationSelectedItem, string T4TempatePath)
        {
            this.GenerateText  = "";
            this.GenerateError = "";


            ITextTemplatingSessionHost textTemplatingSessionHost = (ITextTemplatingSessionHost)textTemplating;

            textTemplatingSessionHost.Session = textTemplatingSessionHost.CreateSession();
            TPCallback tpCallback = new TPCallback();

            textTemplatingSessionHost.Session["Model"] = GeneratedModelView;
            if (string.IsNullOrEmpty(GenText))
            {
                this.GenerateText = textTemplating.ProcessTemplate(T4TempatePath, File.ReadAllText(T4TempatePath), tpCallback);
            }
            else
            {
                this.GenerateText = textTemplating.ProcessTemplate(T4TempatePath, GenText, tpCallback);
            }
            FileExtension = tpCallback.FileExtension;
            if (tpCallback.ProcessingErrors != null)
            {
                foreach (TPError tpError in tpCallback.ProcessingErrors)
                {
                    this.GenerateError = tpError.ToString() + "\n";
                }
            }
            IsReady.DoNotify(this, string.IsNullOrEmpty(this.GenerateError));
        }
Ejemplo n.º 50
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="state"></param>
 /// <param name="value"></param>
 private Task OnStateChanged(CheckboxState state, SelectedItem value)
 {
     Trace?.Log($"组件选中值: {value.Value} 显示值: {value.Text}");
     return(Task.CompletedTask);
 }
Ejemplo n.º 51
0
 /// <summary>
 /// 下拉选项改变时调用此方法
 /// </summary>
 /// <param name="item"></param>
 private Task OnItemChanged(SelectedItem item)
 {
     Trace?.Log($"SelectedItem Text: {item.Text} Value: {item.Value} Selected");
     StateHasChanged();
     return(Task.CompletedTask);
 }
Ejemplo n.º 52
0
    private void LayoutItem(SelectedItem item)
    {
        EditorGUIUtility.labelWidth = 60.0f;

        if (GUILayout.Button("X", GUILayout.Width(20)))
        {
            var component = item.Object.GetComponent <MidiController>();
            component.Inputs = component.Inputs.FindAll(i => i != item.Item);
            if (component.Inputs.Count < 1)
            {
                DestroyImmediate(component);
            }
        }

        var selectedGameObj = (GameObject)EditorGUILayout.ObjectField(item.Object, typeof(GameObject), true, GUILayout.Width(_width));

        if (selectedGameObj != null && selectedGameObj != item.Object)
        {
            /* Modifying an object is slightly complicated
             * 1. Add MidiController to the new obj if it doesn't have it
             * 2. Add a new SelectedItem to that MidiController
             * 3. Remove the old SelectedItem from the old MidiController
             * 4. Remove the MidiController component from the old object if SelectedItems are empty
             */

            var oldObject = item.Object;
            if (oldObject == null)
            {
                if (NewMappings.ContainsValue(item))
                {
                    NewMappings.Remove(item.Item.Input.Name);
                }
            }
            else
            {
                var oldComponent = oldObject.GetComponent <MidiController>();
                oldComponent.Inputs = oldComponent.Inputs.FindAll(i => i != item.Item);
                if (oldComponent.Inputs.Count < 1)
                {
                    DestroyImmediate(oldComponent);
                }
            }

            item.Object = selectedGameObj;

            var newComponent = item.Object.GetComponent <MidiController>();
            if (!newComponent)
            {
                newComponent = item.Object.AddComponent <MidiController>();
            }

            // TODO: Properly set item.Item
            item.Components = selectedGameObj.GetComponents <Component>()
                              .Select((m) => m.GetType().Name)
                              .ToList();

            newComponent.Inputs.Add(item.Item);
        }

        EditorGUILayout.BeginVertical();

        if (item.Components.Count > 0)
        {
            var componentIndex = EditorGUILayout.Popup("", item.ComponentIndex, item.Components.ToArray(),
                                                       EditorStyles.popup, GUILayout.Width(_width));
            if (componentIndex != item.ComponentIndex)
            {
                item.SetComponentIndex(componentIndex);
            }
        }

        if (item.Members.Count > 0)
        {
            item.MemberIndex =
                EditorGUILayout.Popup("", item.MemberIndex, item.Members.ToArray(), EditorStyles.popup, GUILayout.Width(_width));
            if (item.MemberIndex >= 0)
            {
                item.Item.Member = item.Members.ElementAt(item.MemberIndex);
                item.Item.Range  = EditorGUILayout.DelayedIntField("Range", item.Item.Range, GUILayout.Width(_width));
            }

            EditorGUILayout.LabelField("Value: ", _getValue(item).ToString());
        }

        EditorGUILayout.EndVertical();
        EditorGUILayout.Space();
    }
Ejemplo n.º 53
0
 private Task OnStateChanged(CheckboxState state, SelectedItem item)
 {
     KeepState = bool.Parse(item.Value);
     return(Task.CompletedTask);
 }
Ejemplo n.º 54
0
 private static object _getValue(SelectedItem item) => MidiController.GetValue(item.Item, item.Object);
Ejemplo n.º 55
0
        /// <summary>
        /// retrieves the path of the selcected item
        /// </summary>
        /// <param name="item">selected item</param>
        /// <returns>file path</returns>
        private string GetSelectedFileName(SelectedItem item)
        {
            if (item != null)
            {
                if (item.ProjectItem != null)
                {
                    return item.ProjectItem.get_FileNames(1);
                }
            }

            return null;
        }
Ejemplo n.º 56
0
    void OnGUI()
    {
        /**
         * Horizontal row of knobs 1-8
         * Photo of MIDI controller
         * Horizontal row of sliders 1-8
         *
         * Each knob/slider:
         * 1 unit per mapping
         * GameObject / Component / Name
         * Min / max / etc
         */

        var sliders = _allInputs.FindAll(i => i.Type == MidiInputType.Slider);
        var knobs   = _allInputs.FindAll(i => i.Type == MidiInputType.Knob);

        var boundInputs = FindAllBoundInputs();

        EditorGUILayout.BeginHorizontal();

        GUILayout.Space(350);

        knobs.ForEach((k) =>
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(_width));
            EditorGUILayout.LabelField(k.Name, GUILayout.Width(_width));

            if (GUILayout.Button("+ Add New", GUILayout.Width(_width)))
            {
                var item            = new SelectedItem(k, null, new List <string>());
                NewMappings[k.Name] = item;
            }

            EditorGUILayout.Space();

            var items = boundInputs.FindAll(i => i.Item.Input.Name == k.Name);
            items.ForEach(LayoutItem);

            if (NewMappings.ContainsKey(k.Name))
            {
                LayoutItem(NewMappings[k.Name]);
            }

            EditorGUILayout.EndVertical();
        });

        EditorGUILayout.EndHorizontal();

        GUILayout.Label(_image());


        EditorGUILayout.BeginHorizontal();

        GUILayout.Space(10);
        var colorText = _showBlack ? "My controller is white!" : "My controller is black!";

        if (GUILayout.Button(colorText, GUILayout.Width(140)))
        {
            _showBlack = !_showBlack;
        }


        GUILayout.Space(200);

        sliders.ForEach((s) =>
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(_width));
            EditorGUILayout.LabelField(s.Name, GUILayout.Width(_width));

            if (GUILayout.Button("+"))
            {
                var item            = new SelectedItem(s, null, new List <string>());
                NewMappings[s.Name] = item;
            }

            EditorGUILayout.Space();

            var items = boundInputs.FindAll(i => i.Item.Input.Name == s.Name);
            items.ForEach(LayoutItem);

            EditorGUILayout.EndVertical();
        });

        EditorGUILayout.EndHorizontal();
    }
Ejemplo n.º 57
0
 public override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
 {
     RunGitEx("formatpatch", fileName);
 }
Ejemplo n.º 58
0
 public static bool IsCSharpDocument(this SelectedItem visualStudioSelectedItem)
 {
     return(visualStudioSelectedItem?.ProjectItem?.FileCodeModel?.Language == CodeModelLanguageConstants.vsCMLanguageCSharp);
 }
Ejemplo n.º 59
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="state"></param>
 /// <param name="value"></param>
 private Task OnItemChanged(CheckboxState state, SelectedItem value)
 {
     BinderLog?.Log($"Selected Value: {value.Text}");
     return(Task.CompletedTask);
 }
Ejemplo n.º 60
0
 protected override void OnExecute(SelectedItem item, string fileName, OutputWindowPane pane)
 {
     RunGitEx("checkoutbranch", fileName);
 }