private async Task<ProjectMap> CreateProjectMapAsync(ConcurrentSet<SymbolAndProjectId> symbols)
        {
            using (Logger.LogBlock(FunctionId.FindReference_CreateProjectMapAsync, _cancellationToken))
            {
                var projectMap = new ProjectMap();

                var scope = _documents?.Select(d => d.Project).ToImmutableHashSet();
                foreach (var symbolAndProjectId in symbols)
                {
                    foreach (var finder in _finders)
                    {
                        _cancellationToken.ThrowIfCancellationRequested();

                        var projects = await finder.DetermineProjectsToSearchAsync(symbolAndProjectId.Symbol, _solution, scope, _cancellationToken).ConfigureAwait(false);
                        foreach (var project in projects.Distinct().WhereNotNull())
                        {
                            if (scope == null || scope.Contains(project))
                            {
                                projectMap.Add(project, (symbolAndProjectId, finder));
                            }
                        }
                    }
                }

                Contract.ThrowIfTrue(projectMap.Any(kvp => kvp.Value.Count != kvp.Value.ToSet().Count));
                return projectMap;
            }
        }
        private void ProjectPropertyPageFixup(ProjectMap.SccDocumentData dd)
        {
            // Ok, we have a project setting page here.
            // Project settings pages break (our) SCC handling in a number of ways
            //   * It creates an editor buffer for the AssemblyInfo file, but does
            //     not notify changes or tell the user that you should save the file
            //   * It makes the project dirty without notifying
            //   * Saving the setting pages doesn't save your projec
            //
            // To work around this we poll all files in the current project for dirty

            IVsSccProject2 prj = dd.Hierarchy as IVsSccProject2;

            if (prj != null)
            {
                SvnProject project = new Ankh.Selection.SvnProject(null, prj);

                foreach (string file in GetService<IProjectFileMapper>().GetAllFilesOf(project))
                {
                    SccDocumentData itemData;
                    if (_docMap.TryGetValue(file, out itemData))
                        itemData.CheckDirty();
                }
            }
        }
        private async Task<ProjectToDocumentMap> CreateProjectToDocumentMapAsync(ProjectMap projectMap)
        {
            using (Logger.LogBlock(FunctionId.FindReference_CreateDocumentMapAsync, _cancellationToken))
            {
                var finalMap = new ProjectToDocumentMap();

                foreach (var kvp in projectMap)
                {
                    var project = kvp.Key;
                    var projectQueue = kvp.Value;

                    var documentMap = new DocumentMap();

                    foreach (var symbolAndFinder in projectQueue)
                    {
                        _cancellationToken.ThrowIfCancellationRequested();

                        var symbolAndProjectId = symbolAndFinder.symbolAndProjectId;
                        var symbol = symbolAndProjectId.Symbol;
                        var finder = symbolAndFinder.finder;

                        var documents = await finder.DetermineDocumentsToSearchAsync(symbol, project, _documents, _cancellationToken).ConfigureAwait(false);
                        foreach (var document in documents.Distinct().WhereNotNull())
                        {
                            if (_documents == null || _documents.Contains(document))
                            {
                                documentMap.Add(document, symbolAndFinder);
                            }
                        }
                    }

                    Contract.ThrowIfTrue(documentMap.Any(kvp1 => kvp1.Value.Count != kvp1.Value.ToSet().Count));

                    if (documentMap.Count > 0)
                    {
                        finalMap.Add(project, documentMap);
                    }
                }

                return finalMap;
            }
        }
Пример #4
0
 public ProjectIconReference GetPathIconHandle(string path)
 {
     return(ProjectMap.GetPathIconHandle(path));
 }
Пример #5
0
 public ISccProjectInfo GetProjectInfo(Selection.SccProject project)
 {
     return(ProjectMap.GetProjectInfo(project));
 }
Пример #6
0
 public bool IsProjectFileOrSolution(string path)
 {
     return(ProjectMap.IsProjectFileOrSolution(path));
 }
Пример #7
0
 bool IProjectFileMapper.IsSccExcluded(string path)
 {
     return(ProjectMap.IsSccExcluded(path));
 }
Пример #8
0
 internal void AddedToSolution(string path)
 {
     // Force an initial status into the SvnItem
     StatusCache.SetSolutionContained(path, true, ProjectMap.IsSccExcluded(path));
 }
Пример #9
0
 public IEnumerable <string> GetAllFilesOf(ICollection <Selection.SccProject> projects)
 {
     return(ProjectMap.GetAllFilesOf(projects, false));
 }
Пример #10
0
 public IEnumerable <Selection.SccProject> GetAllSccProjects()
 {
     return(ProjectMap.GetAllSccProjects());
 }
        internal DocumentId GetDocumentId(ProjectId projectId, string name)
        {
            var projectData = ProjectMap.GetData(projectId);

            return(projectData?.DocumentData.Get(name));
        }
 internal MonoDevelop.Projects.Project GetMonoProject(ProjectId projectId)
 => ProjectMap.GetMonoProject(projectId);
 internal ProjectId[] GetProjectIds(MonoDevelop.Projects.Project project)
 => ProjectMap.GetIds(project);
 internal ProjectId GetProjectId(MonoDevelop.Projects.Project project)
 => ProjectMap.GetId(project);
 internal bool Contains(ProjectId projectId)
 => ProjectMap.Contains(projectId);
Пример #16
0
 public bool IsSccExcluded(string path)
 {
     return(ProjectMap.IsSccExcluded(path));
 }
Пример #17
0
 public bool IgnoreEnumerationSideEffects(Microsoft.VisualStudio.Shell.Interop.IVsSccProject2 sccProject)
 {
     return(ProjectMap.IgnoreEnumerationSideEffects(sccProject));
 }
Пример #18
0
 public IEnumerable <Selection.SccProject> GetAllProjectsContaining(IEnumerable <string> paths)
 {
     return(ProjectMap.GetAllProjectsContaining(paths));
 }
Пример #19
0
 public ICollection <string> GetAllFilesOfAllProjects()
 {
     return(ProjectMap.GetAllFilesOfAllProjects(false));
 }
Пример #20
0
 public IEnumerable <string> GetAllFilesOf(SccProject project)
 {
     return(ProjectMap.GetAllFilesOf(project, false));
 }
Пример #21
0
 protected virtual void OnProjectClosed(SccProjectData data, bool removed)
 {
     data.OnClose();
     ProjectMap.RemoveProject(data.SccProject);
 }
Пример #22
0
 public IEnumerable <string> GetAllFilesOf(ICollection <Selection.SccProject> projects, bool exceptExcluded)
 {
     return(ProjectMap.GetAllFilesOf(projects, exceptExcluded));
 }
 public void SerializeSccExcludeData(System.IO.Stream store, bool writeData)
 {
     ProjectMap.SerializeSccExcludeData(store, writeData);
 }
Пример #24
0
 public ICollection <string> GetAllFilesOfAllProjects(bool exceptExcluded)
 {
     return(ProjectMap.GetAllFilesOfAllProjects(exceptExcluded));
 }
Пример #25
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Settings);
            string dbPath = System.IO.Path.Combine(
                System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
                "localkimaidata.db3");

            db = new SQLiteConnection(dbPath);
            // Create your application here
            SetContentView(Resource.Layout.Settings);
            Context        mContext = Application.Context;
            AppPreferences ap       = new AppPreferences(mContext);
            TextView       txtField = FindViewById <TextView>(Resource.Id.edit_url);

            txtField.Text = ap.getAccessKey("URL");

            txtField      = FindViewById <TextView>(Resource.Id.edit_username);
            txtField.Text = ap.getAccessKey("USERNAME");

            txtField      = FindViewById <TextView>(Resource.Id.edit_password);
            txtField.Text = ap.getAccessKey("PASSWORD");

            Button sql_lite = FindViewById <Button>(Resource.Id.btn_view_data);

            sql_lite.Click += delegate
            {
                StartActivity(typeof(SqliteActivity));
            };


            Button save_button = FindViewById <Button>(Resource.Id.btn_save);

            save_button.Click += delegate
            {
                char[]   charsToTrim = { '*', ' ', '\'' };
                TextView url         = FindViewById <TextView>(Resource.Id.edit_url);
                string   strApiUrl   = url.Text.Trim(charsToTrim);

                TextView username       = FindViewById <TextView>(Resource.Id.edit_username);
                string   strApiUserName = username.Text.Trim(charsToTrim);

                TextView password       = FindViewById <TextView>(Resource.Id.edit_password);
                string   strApiPassword = password.Text.Trim(charsToTrim);
                TextView statusMessage  = FindViewById <TextView>(Resource.Id.status_message);

                ap.saveAccessKey("URL", strApiUrl, true);
                ap.saveAccessKey("USERNAME", strApiUserName, true);
                ap.saveAccessKey("PASSWORD", strApiPassword, true);

                List <string> Parameters = new List <string>();
                Parameters.Add(strApiUserName);
                Parameters.Add(strApiPassword);
                KimaiServer MyKimai = new KimaiServer(strApiUrl + "/core/json.php");
                System.Threading.Tasks.Task taskA = System.Threading.Tasks.Task.Factory.StartNew(() => MyKimai.ConnectAsync("authenticate", Parameters));
                taskA.Wait();

                AuthenticateMap AuthObject = new AuthenticateMap();
                AuthObject = JsonConvert.DeserializeObject <AuthenticateMap>(MyKimai.JsonResultString);
                bool Success = AuthObject.Result.Success;
                if (Success)
                {
                    string apikey = AuthObject.Result.Items[0].apiKey;
                    ap.saveAccessKey("APIKEY", AuthObject.Result.Items[0].apiKey, true);
                    Parameters.Clear();
                    Parameters.Add(apikey);
                    System.Threading.Tasks.Task CustomersTask = System.Threading.Tasks.Task.Factory.StartNew(() => MyKimai.ConnectAsync("getCustomers", Parameters));
                    CustomersTask.Wait();
                    CustomerMap CustomerObject = new CustomerMap();
                    CustomerObject = JsonConvert.DeserializeObject <CustomerMap>(MyKimai.JsonResultString);
                    Success        = CustomerObject.Result.Success;
                    if (Success)
                    {
                        db.CreateTable <KimaiDatadase.Customer>();
                        db.DeleteAll <KimaiDatadase.Customer>();
                        var newCustomer = new KimaiDatadase.Customer();
                        foreach (JsonKimaiMaps.Customer item in CustomerObject.Result.Items)
                        {
                            newCustomer.CustomerID = item.customerID;
                            newCustomer.Name       = item.name;

                            db.Insert(newCustomer);
                        }
                    }

                    Parameters.Clear();
                    Parameters.Add(apikey);
                    Parameters.Add("1"); // nest in the activities
                    System.Threading.Tasks.Task ProjectsTask = System.Threading.Tasks.Task.Factory.StartNew(() => MyKimai.ConnectAsync("getProjects", Parameters));
                    ProjectsTask.Wait();
                    ProjectMap ProjectObject = new ProjectMap();
                    ProjectObject = JsonConvert.DeserializeObject <ProjectMap>(MyKimai.JsonResultString);
                    Success       = ProjectObject.Result.Success;
                    if (Success)
                    {
                        db.CreateTable <KimaiDatadase.Project>();
                        db.DeleteAll <KimaiDatadase.Project>();
                        db.CreateTable <ProjectActivity>();
                        db.DeleteAll <ProjectActivity>();
                        var newProject = new KimaiDatadase.Project();
                        foreach (JsonKimaiMaps.Project item in ProjectObject.Result.Items)
                        {
                            newProject.CustomerID = item.customerID;
                            newProject.ProjectID  = item.projectID;
                            newProject.Name       = item.name;
                            var newActivity = new ProjectActivity();
                            foreach (JsonKimaiMaps.Task i in item.Tasks)
                            {
                                newActivity.ActivityID = i.activityID;
                                newActivity.ProjectID  = item.projectID;
                                newActivity.Name       = i.name;
                                db.Insert(newActivity);
                            }
                            db.Insert(newProject);
                        }
                        StartActivity(typeof(MainActivity));
                    }
                }
                else
                {
                    Toast mesg = Toast.MakeText(this, "Login Failed", ToastLength.Short);
                    mesg.Show();
                }
            };

            Button cancel_button = FindViewById <Button>(Resource.Id.btn_cancel);

            cancel_button.Click += delegate
            {
                StartActivity(typeof(MainActivity));
            };
        }