Пример #1
0
        public void LoadSettings(RichTextBox rtb)
        {
            BaseIEName = GetSetting("BaseIEName", "ie");
            PopupIEName = GetSetting("PopupIEName", "iepopup");
            RunCount = Convert.ToInt32(GetSetting("RunCount", "0"));
            TypingTime = Convert.ToDouble(GetSetting("TypingTime", "1000"));
            WarnWhenUnsaved = GetSetting("WarnWhenUnsaved", 1) == 1 ? true : false;
            HideDOSWindow = GetSetting("HideDOSWindow", 1) == 1 ? true : false;
            CompilePath = GetSetting("CompilePath", AppDirectory);
            FindPattern = GetSetting("FindPattern", "name, href, url, src, value, style, innertext");
            DOMHighlightColor = Color.FromName(GetSetting("DOMHighlightColor", "Yellow"));
            ScriptFormatting = (ScriptFormats)System.Enum.Parse(typeof(ScriptFormats), GetSetting("ScriptFormatting", "Snippet"), true);
            CodeLanguage = (CodeLanguages)System.Enum.Parse(typeof(CodeLanguages), GetSetting("CodeLanguage", "CSharp"), true);

            DefaultSaveTemplate = GetSetting("DefaultSaveTemplate", "");
            DefaultRunTemplate = GetSetting("DefaultRunTemplate", "");
            DefaultCompileTemplate = GetSetting("DefaultCompileTemplate", "");

            string _fontName = GetSetting("FontName", rtb.Font.FontFamily.Name);
            float _fontSize = float.Parse(GetSetting("FontSize", rtb.Font.Size.ToString()));
            if (_fontName == "")
            {
                ScriptWindowFont = rtb.Font;
            }
            else
            {
                ScriptWindowFont = new Font(_fontName, _fontSize);
                rtb.Font = ScriptWindowFont;
            }
        }
Пример #2
0
        public void LoadSettings(RichTextBox rtb)
        {
            BaseIEName        = GetSetting("BaseIEName", "ie");
            PopupIEName       = GetSetting("PopupIEName", "iepopup");
            RunCount          = Convert.ToInt32(GetSetting("RunCount", "0"));
            TypingTime        = Convert.ToDouble(GetSetting("TypingTime", "1000"));
            WarnWhenUnsaved   = GetSetting("WarnWhenUnsaved", 1) == 1 ? true : false;
            HideDOSWindow     = GetSetting("HideDOSWindow", 1) == 1 ? true : false;
            CompilePath       = GetSetting("CompilePath", AppDirectory);
            FindPattern       = GetSetting("FindPattern", "name, href, url, src, value, style, innertext");
            DOMHighlightColor = Color.FromName(GetSetting("DOMHighlightColor", "Yellow"));
            ScriptFormatting  = (ScriptFormats)System.Enum.Parse(typeof(ScriptFormats), GetSetting("ScriptFormatting", "Snippet"), true);
            CodeLanguage      = (CodeLanguages)System.Enum.Parse(typeof(CodeLanguages), GetSetting("CodeLanguage", "CSharp"), true);

            DefaultSaveTemplate    = GetSetting("DefaultSaveTemplate", "");
            DefaultRunTemplate     = GetSetting("DefaultRunTemplate", "");
            DefaultCompileTemplate = GetSetting("DefaultCompileTemplate", "");

            string _fontName = GetSetting("FontName", rtb.Font.FontFamily.Name);
            float  _fontSize = float.Parse(GetSetting("FontSize", rtb.Font.Size.ToString()));

            if (_fontName == "")
            {
                ScriptWindowFont = rtb.Font;
            }
            else
            {
                ScriptWindowFont = new Font(_fontName, _fontSize);
                rtb.Font         = ScriptWindowFont;
            }
        }
Пример #3
0
        public CodeLanguage(CodeLanguages language, CodeStructures codeStructure = CodeStructures.None)
        {
            if (codeStructure == CodeStructures.None)
            {
                switch (language)
                {
                case CodeLanguages.HTML:
                case CodeLanguages.XML:
                    codeStructure = CodeStructures.Xml;
                    break;

                case CodeLanguages.C:
                case CodeLanguages.CSharp:
                    codeStructure = CodeStructures.C;
                    break;

                case CodeLanguages.Blazor:
                case CodeLanguages.Razor:
                    codeStructure = CodeStructures.razor;
                    break;
                }
            }

            FoundSynonymous = true;
            CodeStructure   = codeStructure;
            Language        = language;
        }
Пример #4
0
 public CodeModule()
 {
     this.name = "";
     this.language = CodeLanguages.CSharp;
     this.includes = "";
     this.vars = "";
     this.changed = false;
     this.Functions = new List<Function>();
 }
Пример #5
0
 public CodeModule()
 {
     _name     = "";
     _language = CodeLanguages.CSharp;
     _includes = "";
     _vars     = "";
     _changed  = false;
     Functions = new ArrayList();
 }
Пример #6
0
 public CodeModule()
 {
     this.name      = "";
     this.language  = CodeLanguages.CSharp;
     this.includes  = "";
     this.vars      = "";
     this.changed   = false;
     this.Functions = new List <Function>();
 }
Пример #7
0
        protected CodeModule(SerializationInfo info, StreamingContext context)
        {
            _changed  = false;
            _name     = info.GetString("n");
            _language = (CodeLanguages)info.GetValue("l", typeof(CodeLanguages));
            _includes = info.GetString("i");
            _vars     = info.GetString("v");
            Functions = new ArrayList();
            Functions = (ArrayList)info.GetValue("f", typeof(ArrayList));

            //use a try/catch block around any new vales
        }
Пример #8
0
        protected CodeModule(SerializationInfo info, StreamingContext context)
        {
            this.changed   = false;
            this.name      = info.GetString("n");
            this.language  = (CodeLanguages)info.GetValue("l", typeof(CodeLanguages));
            this.includes  = info.GetString("i");
            this.vars      = info.GetString("v");
            this.Functions = new List <Function>();
            this.Functions = (List <Function>)info.GetValue("f", typeof(List <Function>));

            //use a try/catch block around any new vales
        }
Пример #9
0
        /// <summary>
        /// Creates the solution and calls the functions to create the projects
        /// </summary>
        /// <param name="IDEObject"></param>
        /// <param name="contextParams"></param>
        public void CreateSolution(_DTE IDEObject, object[] contextParams)
        {
            #region Get Wizard Results
            // Get basic wizard results
            _projectDirectory = contextParams[(int)ContextOptions.LocalDirectory].ToString();
            _projectName      = contextParams[(int)ContextOptions.ProjectName].ToString();
            _solutionName     = contextParams[(int)ContextOptions.SolutionName].ToString();
            _fExclusive       = bool.Parse(contextParams[(int)ContextOptions.FExclusive].ToString());

            _solutionDirectory = _projectDirectory.Substring(0, _projectDirectory.LastIndexOf('\\'));

            // Get custom wizard results
            _assemblyKeyFile        = (string)_wizardResults[WizardValues.AssemblyKeyFile];
            _assemblyKeyName        = (string)_wizardResults[WizardValues.AssemblyKeyName];
            _assemblyName           = (string)_wizardResults[WizardValues.AssemblyName];
            _className              = (string)_wizardResults[WizardValues.ClassName];
            _nameSpace              = (string)_wizardResults[WizardValues.Namespace];
            _functoidID             = (string)_wizardResults[WizardValues.FunctoidID];
            _functoidBitmap         = (Image)_wizardResults[WizardValues.FunctoidBitmap];
            _functoidName           = (string)_wizardResults[WizardValues.FunctoidName];
            _functoidToolTip        = (string)_wizardResults[WizardValues.FunctoidToolTip];
            _functoidCategory       = (string)_wizardResults[WizardValues.FunctoidCategory];
            _functoidDescription    = (string)_wizardResults[WizardValues.FunctoidDescription];
            _functoidReturnType     = (string)_wizardResults[WizardValues.FunctoidReturnType];
            _functoidOutputConnType = (string)_wizardResults[WizardValues.FunctoidOutputConnType];
            _functoidInputConnType  = (string)_wizardResults[WizardValues.FunctoidInputConnType];
            _functoidExceptionText  = (string)_wizardResults[WizardValues.FunctoidExceptionText];
            _functoidMinParams      = (string)_wizardResults[WizardValues.FunctoidMinParams];
            _functoidMaxParams      = (string)_wizardResults[WizardValues.FunctoidMaxParams];
            _functoidFunctionName   = (string)_wizardResults[WizardValues.FunctoidFunctionName];

            //System.Diagnostics.Debugger.Launch();

            // Get Code Language
            switch ((string)_wizardResults[WizardValues.CodeLanguage])
            {
            case "CSharp":
                _codeLanguage = CodeLanguages.CSharp;
                break;

            case "VB":
                _codeLanguage = CodeLanguages.VisualBasicNET;
                break;
            }
            #endregion

            #region Create the resource template class & load it with wizard values
            // Create the resource template class
            _resourceTemplate = new ResourceTemplate();

            // Load template class with the wizard values
            _resourceTemplate.AssemblyKeyFile = _assemblyKeyFile;
            _resourceTemplate.AssemblyKeyName = _assemblyKeyName;
            _resourceTemplate.AssemblyName    = _assemblyName;
            _resourceTemplate.BiztalkDir      = _bizTalkInstallPath;
            _resourceTemplate.ClassName       = _className;
            _resourceTemplate.NameSpace       = _nameSpace;
            _resourceTemplate.Id                     = _functoidID;
            _resourceTemplate.Icon                   = _functoidBitmap;
            _resourceTemplate.Name                   = _functoidName;
            _resourceTemplate.ToolTip                = _functoidToolTip;
            _resourceTemplate.Category               = _functoidCategory;
            _resourceTemplate.Description            = _functoidDescription;
            _resourceTemplate.ReturnType             = _functoidReturnType;
            _resourceTemplate.OutputConnType         = _functoidOutputConnType;
            _resourceTemplate.InputConnType          = _functoidInputConnType;
            _resourceTemplate.ExceptionText          = _functoidExceptionText;
            _resourceTemplate.MinParams              = _functoidMinParams;
            _resourceTemplate.MaxParams              = _functoidMaxParams;
            _resourceTemplate.FunctionName           = _functoidFunctionName;
            _resourceTemplate.FunctoidParameters     = _functoidParameters;
            _resourceTemplate.ImplementationLanguage = _codeLanguage;
            #endregion

            #region Create Solution & Projects
            if (!_fExclusive)             //New solution or existing?
            {
                // Get a reference to the solution from the IDE Object
                _functoidSolution = IDEObject.Solution;
            }
            else
            {
                // Use the solution class to create a new solution
                _functoidSolution = IDEObject.Solution;
                //_functoidSolution.Create(_projectDirectory,_projectName);
                _functoidSolution.Create(_solutionDirectory, _solutionName);
            }

            //Create the project
            CreateFunctoidProject();

            // Save the Solution file
            _functoidSolution.SaveAs(_solutionDirectory + "\\" + _solutionName + ".sln");
            #endregion
        }
Пример #10
0
        protected CodeModule(SerializationInfo info, StreamingContext context)
        {
            this.changed = false;
            this.name = info.GetString("n");
            this.language = (CodeLanguages)info.GetValue("l", typeof(CodeLanguages));
            this.includes = info.GetString("i");
            this.vars = info.GetString("v");
            this.Functions = new List<Function>();
            this.Functions = (List<Function>)info.GetValue("f", typeof(List<Function>));

            //use a try/catch block around any new vales
        }
Пример #11
0
 public ProjectTemplate(string name, CodeLanguages.CodeLanguage language)
 {
     _name = name;
     _language = language;
 }
Пример #12
0
 public void SetLanguage(CodeLanguages language, CodeStructures codeStructure = CodeStructures.None)
 {
     FoundSynonymous = true;
     CodeStructure   = codeStructure;
     Language        = language;
 }