Exemplo n.º 1
0
        public void SetupFixture()
        {
            using (TextReader reader = PythonBindingAddInFile.ReadAddInFile()) {
                addin = AddIn.Load(reader, String.Empty);

                fileFilterCodon     = GetCodon("/SharpDevelop/Workbench/FileFilter", "Python");
                pythonMenuCodon     = GetCodon("/SharpDevelop/Workbench/MainMenu", "Python");
                displayBindingCodon = GetCodon("/SharpDevelop/Workbench/DisplayBindings", "PythonDisplayBinding");

                const string runMenuExtensionPath = "/SharpDevelop/Workbench/MainMenu/Python";
                pythonRunMenuItemCodon = GetCodon(runMenuExtensionPath, "Run");
                pythonWithoutDebuggerRunMenuItemCodon = GetCodon(runMenuExtensionPath, "RunWithoutDebugger");
                pythonStopMenuItemCodon = GetCodon(runMenuExtensionPath, "Stop");

                fileTemplatesCodon = GetCodon("/SharpDevelop/BackendBindings/Templates", "Python");
                optionsPanelCodon  = GetCodon("/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions", "PythonOptionsPanel");
                parserCodon        = GetCodon("/Workspace/Parser", "Python");
                additionalMSBuildPropertiesCodon = GetCodon("/SharpDevelop/MSBuildEngine/AdditionalProperties", "PythonBinPath");
                languageBindingCodon             = GetCodon("/SharpDevelop/Workbench/LanguageBindings", "Python");
                projectFileFilterCodon           = GetCodon("/SharpDevelop/Workbench/Combine/FileFilter", "PythonProject");
                codeCompletionBindingCodon       = GetCodon("/AddIns/DefaultTextEditor/CodeCompletion", "Python");
                applicationSettingsOptionsCodon  = GetCodon("/SharpDevelop/BackendBindings/ProjectOptions/Python", "Application");
                buildEventsCodon          = GetCodon("/SharpDevelop/BackendBindings/ProjectOptions/Python", "BuildEvents");
                compilingOptionsCodon     = GetCodon("/SharpDevelop/BackendBindings/ProjectOptions/Python", "CompilingOptions");
                debugOptionsCodon         = GetCodon("/SharpDevelop/BackendBindings/ProjectOptions/Python", "DebugOptions");
                convertCodeCodon          = GetCodon("/SharpDevelop/Workbench/MainMenu/Tools/ConvertCode", "ConvertToPython");
                pythonFileIconCodon       = GetCodon("/Workspace/Icons", "PythonFileIcon");
                pythonProjectIconCodon    = GetCodon("/Workspace/Icons", "PythonProjectIcon");
                convertCSharpProjectCodon = GetCodon("/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectActions/Convert", "CSharpProjectToPythonProjectConverter");
                convertVBNetProjectCodon  = GetCodon("/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectActions/Convert", "VBNetProjectToPythonProjectConverter");
                formattingStrategyCodon   = GetCodon("/AddIns/DefaultTextEditor/Formatter/Python", "PythonFormatter");

                // Get the PythonBinding runtime.
                foreach (Runtime runtime in addin.Runtimes)
                {
                    if (runtime.Assembly == "PythonBinding.dll")
                    {
                        pythonBindingRuntime = runtime;
                    }
                    else if (runtime.Assembly == "$ICSharpCode.FormsDesigner/FormsDesigner.dll")
                    {
                        formsDesignerRuntime = runtime;
                    }
                }

                // Get the forms designer dependency.
                foreach (AddInReference addInRef in addin.Manifest.Dependencies)
                {
                    if (addInRef.Name == "ICSharpCode.FormsDesigner")
                    {
                        formsDesignerAddInRef = addInRef;
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        bool AddDependencyRow(Dictionary <string, Version> addInDict, AddInReference dep, int rowIndex, string requiredByName)
        {
            string  text = requiredByName ?? GetDisplayName(dep.Name);
            Version versionFound;
            Label   label = new Label();

            label.AutoSize = true;
            label.Text     = text;
            PictureBox box = new PictureBox();

            box.BorderStyle = BorderStyle.None;
            box.Size        = new Size(16, 16);
            bool isOK = dep.Check(addInDict, out versionFound);

            box.SizeMode = PictureBoxSizeMode.CenterImage;
            box.Image    = isOK ? ResourceService.GetBitmap("Icons.16x16.OK") : ResourceService.GetBitmap("Icons.16x16.DeleteIcon");
            dependencyTable.Controls.Add(label, 1, rowIndex);
            dependencyTable.Controls.Add(box, 0, rowIndex);
            return(isOK);
        }
Exemplo n.º 3
0
        public AddInDependency(AddInReference reference)
        {
            if (reference != null)
            {
                Id = reference.Name;

                // Hint: An absolutely minimal or maximal version means no version constraint at all!
                Version absMinimumVersion = new Version(0, 0, 0, 0);
                Version absMaximumVersion = new Version(Int32.MaxValue, Int32.MaxValue);

                if ((reference.MinimumVersion != null) && (reference.MinimumVersion != absMinimumVersion))
                {
                    MinimumVersion = reference.MinimumVersion;
                }
                if ((reference.MaximumVersion != null) && (reference.MaximumVersion != absMaximumVersion))
                {
                    MaximumVersion = reference.MaximumVersion;
                }

                IncludeMinimumVersion = true;
                IncludeMaximumVersion = true;
            }
        }