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


C# Project.UpdateVars方法代码示例

本文整理汇总了C#中ProjectManager.Projects.Project.UpdateVars方法的典型用法代码示例。如果您正苦于以下问题:C# Project.UpdateVars方法的具体用法?C# Project.UpdateVars怎么用?C# Project.UpdateVars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectManager.Projects.Project的用法示例。


在下文中一共展示了Project.UpdateVars方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetProject

        void SetProject(Project project, Boolean stealFocus, Boolean internalOpening)
        {
            if (Tree.Projects.Contains(project)) return;
            if (activeProject != null) CloseProject(true);

            // configure
            var prefs = PluginMain.Settings.GetPrefs(project);
            project.TraceEnabled = prefs.DebugMode;
            project.TargetBuild = prefs.TargetBuild;
            project.UpdateVars(true);

            SetActiveProject(project);

            // events
            project.ClasspathChanged += new ChangedHandler(ProjectClasspathsChanged);
            project.BeforeSave += new BeforeSaveHandler(ProjectBeforeSave);
            listenToPathChange = true;

            // activate
            if (!internalOpening) RestoreProjectSession(project);

            if (stealFocus)
            {
                OpenPanel();
                pluginUI.Focus();
            }
            TabColors.UpdateTabColors(Settings);
        }
开发者ID:Gr33z00,项目名称:flashdevelop,代码行数:28,代码来源:PluginMain.cs

示例2: UpdateASCompletion

        public void UpdateASCompletion(IMainForm mainForm, Project project)
        {
            List<string> classPaths = new List<string>();
            List<string> hiddenPaths = new List<string>();
            int majorVersion = 0;
            int minorVersion = 0;
            string platform = "";

            if (project != null)
            {
                BuildActions.GetCompilerPath(project); // refresh project's SDK
                project.UpdateVars(true);

                // platform/version
                platform = project.MovieOptions.Platform;
                majorVersion = project.MovieOptions.MajorVersion;
                minorVersion = project.MovieOptions.MinorVersion;
                if (project.MovieOptions.Platform == AS3MovieOptions.AIR_PLATFORM
                    || project.MovieOptions.Platform == AS3MovieOptions.AIR_MOBILE_PLATFORM)
                    AS3Project.GuessFlashPlayerForAIR(ref majorVersion, ref minorVersion);

                // add project classpaths
                foreach (string cp in project.AbsoluteClasspaths)
                    if (Directory.Exists(cp)) classPaths.Add(cp);

                // add AS3 libraries
                string absPath;
                if (project is AS3Project)
                {
                    MxmlcOptions options = (project as AS3Project).CompilerOptions;
                    foreach (string relPath in options.IntrinsicPaths)
                    {
                        absPath = PathHelper.ResolvePath(relPath);
                        if (absPath == null) absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (Directory.Exists(absPath)) classPaths.Add(absPath);
                    }
                    foreach (string relPath in options.LibraryPaths)
                    {
                        absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (File.Exists(absPath)) classPaths.Add(absPath);
                        else if (Directory.Exists(absPath))
                        {
                            string[] libs = Directory.GetFiles(absPath, "*.swc");
                            foreach (string lib in libs) classPaths.Add(lib);
                        }
                    }
                    foreach (string relPath in options.IncludeLibraries)
                    {
                        absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (Directory.Exists(absPath) || File.Exists(absPath)) classPaths.Add(absPath);
                    }
                    foreach (string relPath in options.ExternalLibraryPaths)
                    {
                        absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (Directory.Exists(absPath) || File.Exists(absPath)) classPaths.Add(absPath);
                    }
                    foreach (string relPath in options.RSLPaths)
                    {
                        string[] parts = relPath.Split(',');
                        if (parts.Length < 2) continue;
                        absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (File.Exists(absPath)) classPaths.Add(absPath);
                    }
                }

                string dir = project.Directory;
                foreach (string hidPath in project.HiddenPaths)
                {
                    absPath = Path.Combine(dir, hidPath);
                    foreach (string cp in classPaths)
                        if (absPath.StartsWith(cp))
                        {
                            hiddenPaths.Add(absPath);
                            break;
                        }
                }
            }

            DataEvent de;
            Hashtable info = new Hashtable();
            // release old classpath
            if (currentLang != null && project == null)
            {
                info["lang"] = currentLang;
                info["platform"] = "";
                info["targetBuild"] = "";
                info["version"] = "0.0";
                info["classpath"] = null;
                info["hidden"] = null;

                de = new DataEvent(EventType.Command, "ASCompletion.ClassPath", info);
                EventManager.DispatchEvent(this, de);
            }

            // set new classpath
//.........这里部分代码省略.........
开发者ID:thecocce,项目名称:flashdevelop,代码行数:101,代码来源:ProjectActions.cs

示例3: UpdateASCompletion

        public void UpdateASCompletion(IMainForm mainForm, Project project)
        {
            List<string> classPaths = new List<string>();
            List<string> hiddenPaths = new List<string>();
            string version;
            string platform = "";

            if (project != null)
            {
                BuildActions.GetCompilerPath(project); // refresh project's SDK
                project.UpdateVars(true);

                // platform/version
                platform = project.MovieOptions.Platform;
                version = project.MovieOptions.Version;
                if (platform != PlatformData.FLASHPLAYER_PLATFORM
                    && project.MovieOptions.HasPlatformSupport && project.MovieOptions.PlatformSupport.IsFlashPlatform)
                    version = PlatformData.ResolveFlashPlayerVersion(project.Language, platform, version);

                // add project classpaths
                foreach (string cp in project.AbsoluteClasspaths)
                    if (Directory.Exists(cp)) classPaths.Add(cp);

                // add AS3 libraries
                string absPath;
                if (project is AS3Project)
                {
                    MxmlcOptions options = (project as AS3Project).CompilerOptions;
                    foreach (string relPath in options.IntrinsicPaths)
                    {
                        absPath = PathHelper.ResolvePath(relPath);
                        if (absPath == null) absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (Directory.Exists(absPath)) classPaths.Add(absPath);
                    }
                    foreach (string relPath in options.LibraryPaths)
                    {
                        absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (File.Exists(absPath)) classPaths.Add(absPath);
                        else if (Directory.Exists(absPath))
                        {
                            string[] libs = Directory.GetFiles(absPath, "*.swc");
                            foreach (string lib in libs) classPaths.Add(lib);
                        }
                    }
                    foreach (string relPath in options.IncludeLibraries)
                    {
                        absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (Directory.Exists(absPath) || File.Exists(absPath)) classPaths.Add(absPath);
                    }
                    foreach (string relPath in options.ExternalLibraryPaths)
                    {
                        absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (Directory.Exists(absPath) || File.Exists(absPath)) classPaths.Add(absPath);
                    }
                    foreach (string relPath in options.RSLPaths)
                    {
                        string[] parts = relPath.Split(',');
                        if (parts.Length < 2) continue;
                        absPath = project.GetAbsolutePath(relPath);
                        if (absPath == null) continue;
                        if (File.Exists(absPath)) classPaths.Add(absPath);
                    }
                }

                string dir = project.Directory;
                foreach (string hidPath in project.HiddenPaths)
                {
                    absPath = Path.Combine(dir, hidPath);
                    foreach (string cp in classPaths)
                        if (absPath.StartsWithOrdinal(cp))
                        {
                            hiddenPaths.Add(absPath);
                            break;
                        }
                }
            }
            else if (PlatformData.SupportedLanguages.ContainsKey("as3"))
            {
                var targets = PlatformData.SupportedLanguages["as3"].Platforms;
                var flashPlatform = targets[PlatformData.FLASHPLAYER_PLATFORM];
                version = flashPlatform.LastVersion.Value;
            }
            else version = "11.0";

            DataEvent de;
            Hashtable info = new Hashtable();
            // release old classpath
            if (currentLang != null && project == null)
            {
                info["lang"] = currentLang;
                info["platform"] = "";
                info["targetBuild"] = "";
                info["version"] = "0.0";
                info["classpath"] = null;
                info["hidden"] = null;

//.........这里部分代码省略.........
开发者ID:xeronith,项目名称:flashdevelop,代码行数:101,代码来源:ProjectActions.cs

示例4: SetProject

        void SetProject(Project project, Boolean stealFocus, Boolean internalOpening)
        {
            if (project == null || Tree.Projects.Contains(project)) return;
            if (activeProject != null) CloseProject(true);

            // configure
            var prefs = Settings.GetPrefs(project);
            project.TraceEnabled = prefs.DebugMode;
            project.TargetBuild = prefs.TargetBuild;
            project.UpdateVars(true);

            SetActiveProject(project);

            // events
            project.ClasspathChanged += new ChangedHandler(ProjectClasspathsChanged);
            project.BeforeSave += new BeforeSaveHandler(ProjectBeforeSave);
            listenToPathChange = true;

            // activate
            if (!internalOpening || (internalOpening && !PluginBase.Settings.RestoreFileSession))
            {
                RestoreProjectSession(project);
            }

            // track active file
            if (Settings.TrackActiveDocument) TreeSyncToCurrentFile();

            if (stealFocus)
            {
                OpenPanel();
                pluginUI.Focus();
            }
            TabColors.UpdateTabColors(Settings);
            UpdateUIStatus(ProjectManagerUIStatus.NotBuilding);
        }
开发者ID:xeronith,项目名称:flashdevelop,代码行数:35,代码来源:PluginMain.cs


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