コード例 #1
0
        public static string GetSharedCodeFullFileName(this EventResponseSave instance)
        {
            var container = instance.GetContainer();

            if (container != null)
            {
                return(FileManager.GetDirectory(ProjectManager.GlueProjectFileName) + EventResponseSave.GetEventFileNameForElement(instance.GetContainer()));
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        public static string GetEventContents(this EventResponseSave instance)
        {
            IElement element = instance.GetContainer();

            string textToAssign = null;

            if (FacadeContainer.Self.GlueState.CurrentEventResponseSave != null)
            {
                if (!string.IsNullOrEmpty(instance.Contents))
                {
                    textToAssign = instance.Contents;
                }
                else
                {
                    // Is there a non-Generated.Event.cs file?
                    string fileToLookFor = FileManager.RelativeDirectory +
                                           EventResponseSave.GetEventFileNameForElement(element);

                    if (File.Exists(fileToLookFor))
                    {
                        ParsedMethod parsedMethod =
                            instance.GetParsedMethodFromAssociatedFile();

                        if (parsedMethod != null)
                        {
                            textToAssign =
                                parsedMethod.MethodContents;
                        }
                    }
                }
            }
            else
            {
                textToAssign = null;
            }
            return(textToAssign);
        }
コード例 #3
0
 public static string EventResponseSaveToString(this EventResponseSave eventResponseSave)
 {
     return(eventResponseSave.EventName + "(Event Response in " + eventResponseSave.GetContainer() + ")");
 }