コード例 #1
0
        public static FlowEnvironment Load(string path)
        {
            FileInfo fileInfo = new FileInfo(path);
            if (!fileInfo.Exists)
                throw new FileNotFoundException("The speficied flow path could not be found : " + path, path);

            Flow flow = null;

            switch (fileInfo.Extension)
            {
                case ".xflow":
                    XDocument document = XDocument.Load(fileInfo.FullName);
                    flow = XFlow.Load(document);
                    break;

                default:
                    throw new NotSupportedException("The specified flow format is not supported by FlowTomator service yet");
            }

            if (flow == null)
                throw new Exception("The specified flow could not be loaded");

            return new FlowEnvironment(path)
            {
                flow = flow
            };
        }
コード例 #2
0
        private void Reload()
        {
            Log.Trace("{0}oading flow {1}", flow == null ? "L" : "Rel", File.Name);
            flow = null;

            switch (File.Extension)
            {
                case ".xflow":
                    XDocument document = XDocument.Load(File.FullName);
                    flow = XFlow.Load(document);
                    break;
            }

            if (flow == null)
                throw new Exception("The specified flow format is not supported");
        }