public EcmPluginParams(Parser p, Setting s, EcmProject e, MarkedData incoming, int calledCount) { myParser = p; mySetting = s; myProject = e; myMarkedData = incoming; myCalledCount = calledCount; }
public EcmTemplate(EcmProject proj, string templateName) { myProject = proj; mySetting = proj.Setting; myName = templateName; string templateFileName = mySetting.TemplateFullPath.FullName.TrimEnd('\\') + '\\' + templateName + '.' + mySetting.TemplateExt.TrimStart('.'); myFile = new FileInfo(templateFileName); myBackupFile = new FileInfo(GetBackupPath()); }
// �n���ꂽ ID �ɑΉ����� EcmProject ��擾���܂��B public EcmProject GetProject(string projectId) { // �v���W�F�N�g�f�[�^�̃L���b�V��������A�ŐV�Ȃ炻���Ԃ� // �f�[�^�t�@�C�����ŐV�A���ݒ肪�ŐV�ł���L���b�V����g�p���Ă悢 EcmProject result = GetProjectCache(projectId); if(result != null) return result; // �L���b�V�����g���Ȃ��ꍇ Setting s = GetSetting(projectId); if(s == null) return null; EcmProject newResult = new EcmProject(this, s); myProjectList[projectId] = newResult; return newResult; }
// �R���X�g���N�^ public TemplateRegexParser(EcmProject proj, EcmLog log, string templateName) { myProject = proj; myLog = log; myTemplateName = templateName; myPlaceHolderSets["{num}"] = new PlaceHolder("num", "-?[0-9]*", "-100"); myPlaceHolderSets["{num+}"] = new PlaceHolder("num", "-?[0-9]+", "-100"); myPlaceHolderSets["{uri}"] = new PlaceHolder("uri", "[-._~;?:@&=*+&,/#\\[\\]()a-zA-Z0-9]*", "#"); myPlaceHolderSets["{uri+}"] = new PlaceHolder("uri", "[-._~;?:@&=*+&,/#\\[\\]()a-zA-Z0-9]*", "#"); myPlaceHolderSets["{text}"] = new PlaceHolder("text", "[^\\n<]*", "�e�L�X�g�e�L�X�g�e�L�X�g"); myPlaceHolderSets["{text+}"] = new PlaceHolder("text", "[^\\n<]+", "�e�L�X�g�e�L�X�g�e�L�X�g"); myPlaceHolderSets["{any}"] = new PlaceHolder("any", ".*", "??????????"); myPlaceHolderSets["{any+}"] = new PlaceHolder("any", ".+", "??????????"); }
// ���\�b�h // �t�@�C������ǂݎ�����R�[�h��R���p�C�����܂��B // �o�̓t�@�C���� null �Ƃ���ƃI���������ŃR���p�C����s���܂��B // �R�[�h�̎�ނ͍ŏ��̃t�@�C���̊g���q�Ŕ��ʂ��܂��B public CompilerResults Compile(FileInfo[] sourceFiles, FileInfo dest, EcmProject project) { if(sourceFiles == null || sourceFiles.Length == 0) return null; CodeDomProvider compiler = null; string codeFrame = null; if(sourceFiles[0].Extension.Equals(EcmProject.CSharpFileSuffix)){ if(string.IsNullOrEmpty(CSCVersionConfig)){ compiler = new CSharpCodeProvider(); } else { compiler = new CSharpCodeProvider(new Dictionary<string, string>(){{"CompilerVersion", CSCVersionConfig}}); } codeFrame = CsCodeFrame; } else if(sourceFiles[0].Extension.Equals(EcmProject.JScriptFileSuffix)){ compiler = new JScriptCodeProvider(); codeFrame = JsCodeFrame; } else { throw new Exception("�s���ȃt�@�C���g���q�ł��B�R���p�C�����錾�ꂪ����ł��܂���B"); } string[] sourceData = new string[sourceFiles.Length]; for(int i=0; i< sourceFiles.Length; i++){ string tempData = ""; using(FileStream fs = sourceFiles[i].Open(FileMode.Open, FileAccess.Read, FileShare.Read)){ using(StreamReader sr = new StreamReader(fs)){ tempData = sr.ReadToEnd(); sr.Close(); } fs.Close(); } string fileName = Path.GetFileNameWithoutExtension(sourceFiles[i].Name).Replace("-", ""); sourceData[i] = string.Format(codeFrame, project.GetPluginNameSpace(), fileName.ToLower(), tempData); } CompilerParameters cp = new CompilerParameters(myCurrentReferenceAsmNames); if(dest ==null){ cp.GenerateInMemory = true; } else { cp.GenerateInMemory = false; cp.OutputAssembly = dest.FullName; } // Util.Throw(myCurrentReferenceAsmNames); CompilerResults cr = compiler.CompileAssemblyFromSource(cp, sourceData); return cr; }
/* �O��ꊇpublish���� �O��́u���̃v���W�F�N�g�́v�ꊇpublish���O��ۑ� */ // �R���X�g���N�^ public AllParse(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
public MemberList(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
// �R���X�g���N�^ public EcmList(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
// ����̃v���W�F�N�g��������܂��B private void ProcessProject(string[] opt) { if(opt.Length < 1){ ProjectList(); return; } string projectId = opt[0]; if(String.IsNullOrEmpty(projectId)){ ProjectList(); return; } if(!Directory.Exists(myProjectDir)){ ShowError("�f�B���N�g�� {0} ���݂���܂���B", myProjectDir); return; } string projectXmlFile = GetXmlPath(projectId); if(!File.Exists(projectXmlFile)){ ShowError("�v���W�F�N�g {0} �͂���܂���B", projectId); return; } myProject = myProjectManager[projectId]; myHandlerList = GetHandlerList(); EcmResponse result = null; EcmProjectHandler eph = null; if(opt.Length > 1){ string optname = opt[1]; foreach(Type t in Setting.HandlerTypes){ string pathname = Util.GetFieldValue(t, "PathName"); if(optname == pathname){ ConstructorInfo ci = t.GetConstructor(new Type[]{typeof(EcmProject), typeof(Xhtml)}); if(ci == null) throw new Exception(optname + "�ɂ́AEcmProject, Xhtml ������Ɏ��R���X�g���N�^������܂���B"); Object o = ci.Invoke(new Object[]{myProject, xhtml}); eph = o as EcmProjectHandler; xhtml.Body.SetAttribute("id", myProject.Setting.Id); xhtml.Body.SetAttribute("class", optname); break; } } } if(eph == null){ eph = new EcmList(myProject, xhtml); } eph.SetTitle(); if(Request.HttpMethod.Equals("post", StringComparison.CurrentCultureIgnoreCase)){ result = eph.Post(Request); } else { result = eph.Get(Request); } // HTML �Ȃ�i�r����� if(result is HtmlResponse){ HtmlResponse hres = result as HtmlResponse; hres.BodyXml.Body.PrependChild(GetHandlerNav()); } if(result != null){ result.WriteResponse(Response); } }
public PreviewManager(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
// �R���X�g���N�^ public Parser(EcmProject proj) : base(proj) { }
// �R���X�g���N�^ public ReadOnlyList(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
// �P��t�@�C������ǂݎ�����R�[�h��R���p�C�����܂��B public CompilerResults Compile(FileInfo sourceFile, FileInfo dest, EcmProject project) { return Compile(new FileInfo[]{sourceFile}, dest, project); }
public PluginManager(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
public TreeView(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
public UntrackedFilesList(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
// �R���X�g���N�^ // ID �� EcmProject ���� EcmItem ��쐬���܂��B public EcmString(string id, EcmProject proj) : this(proj) { myId = id; }
// �R���X�g���N�^ // �t���p�X��w�肵�� EcmFile ��쐬���܂��B public EcmTextFile(string path, EcmProject project) : base(path, project) { }
public EcmString(EcmProject proj) { myProject = proj; }
// �R���X�g���N�^ public EcmFileBase(string path, EcmProject project) : this(project) { this.Path = path; }
// �R���X�g���N�^ protected EcmProjectHandler(EcmProject proj, Xhtml xhtml) { myProject = proj; myXhtml = xhtml; }
public EcmFileBase(EcmProject project) : base(project) { myProject = project; }
// �R���X�g���N�^ public TemplateList(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
// コンストラクタ public EcmImageFile(string path, EcmProject project) : base(path, project) { LoadImage(); }
// ���[�h����Ă���S�Ă� EcmProject ��擾���܂��B public EcmProject[] GetAllProject() { EcmProject[] result = new EcmProject[myProjectList.Values.Count]; myProjectList.Values.CopyTo(result, 0); return result; }
public ProjectSetting(EcmProject proj, Xhtml xhtml) : base(proj, xhtml) { }
// �R���X�g���N�^ public EcmProcessorBase(EcmProject proj) { myProject = proj; mySetting = proj.Setting; }