public SendError() { Microsoft.BizTalk.PipelineOM.Stage stage = this.AddStage(new System.Guid("9d0e4107-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.all); IBaseComponent comp0 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("Microsoft.BizTalk.Component.XmlAsmComp,Microsoft.BizTalk.Pipeline.Components, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");; if (comp0 is IPersistPropertyBag) { string comp0XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"EnvelopeDocSpec" + "Names\"> <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"EnvelopeSpecTargetNam" + "espaces\"> <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"DocumentSpecNames\">" + " <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"DocumentSpecTargetNamespaces" + "\"> <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"XmlAsmProcessingInstructio" + "ns\"> <Value xsi:type=\"xsd:string\"><?mso-infoPathSolution solutionVersion=\"1.0.0.35\" productV" + "ersion=\"11.0.6357\" PIVersion=\"1.0.0.0\" href=\"http://localhost:13016/Failed%20Expense%20Reports/Forms" + "/template.xsn\" name=\"urn:schemas-microsoft-com:office:infopath:Expense-Reports:http---ExpenseReports" + "-ExpenseReport\" language=\"en-us\" ?><?mso-application progid=\"InfoPath.Document\"?></Value> " + " </Property> <Property Name=\"ProcessingInstructionsOptions\"> <Value xsi:type=\"xsd:int\">1</V" + "alue> </Property> <Property Name=\"ProcessingInstructionsScope\"> <Value xsi:type=\"xsd:int\"" + ">0</Value> </Property> <Property Name=\"AddXmlDeclaration\"> <Value xsi:type=\"xsd:boolean\">" + "true</Value> </Property> <Property Name=\"TargetCharset\"> <Value xsi:type=\"xsd:string\" /> " + " </Property> <Property Name=\"TargetCodePage\"> <Value xsi:type=\"xsd:int\">0</Value> </Pro" + "perty> <Property Name=\"PreserveBom\"> <Value xsi:type=\"xsd:boolean\">true</Value> </Propert" + "y> <Property Name=\"HiddenProperties\"> <Value xsi:type=\"xsd:string\">EnvelopeSpecTargetNamespa" + "ces,DocumentSpecTargetNamespaces,TargetCodePage</Value> </Property> </Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp0XmlProperties);; ((IPersistPropertyBag)(comp0)).Load(pb, 0); } this.AddComponent(stage, comp0); }
public Env_SendPipeline() { Microsoft.BizTalk.PipelineOM.Stage stage = this.AddStage(new System.Guid("9d0e4107-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.all); IBaseComponent comp0 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("Microsoft.BizTalk.Component.XmlAsmComp,Microsoft.BizTalk.Pipeline.Components, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");; if (comp0 is IPersistPropertyBag) { string comp0XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"EnvelopeDocSpec" + "Names\"> <Value xsi:type=\"xsd:string\">SampleSchemas.SimpleEnv</Value> </Property> <Propert" + "y Name=\"EnvelopeSpecTargetNamespaces\"> <Value xsi:type=\"xsd:string\">http://SampleSchemas.Simple" + "Env</Value> </Property> <Property Name=\"DocumentSpecNames\"> <Value xsi:type=\"xsd:string\">" + "SampleSchemas.SimpleBody</Value> </Property> <Property Name=\"DocumentSpecTargetNamespaces\"> " + " <Value xsi:type=\"xsd:string\">http://SampleSchemas.SimpleBody</Value> </Property> <Property " + "Name=\"XmlAsmProcessingInstructions\" /> <Property Name=\"ProcessingInstructionsOptions\"> <Valu" + "e xsi:type=\"xsd:int\">0</Value> </Property> <Property Name=\"ProcessingInstructionsScope\"> " + "<Value xsi:type=\"xsd:int\">0</Value> </Property> <Property Name=\"AddXmlDeclaration\"> <Valu" + "e xsi:type=\"xsd:boolean\">true</Value> </Property> <Property Name=\"TargetCharset\"> <Value " + "xsi:type=\"xsd:string\" /> </Property> <Property Name=\"TargetCodePage\"> <Value xsi:type=\"xs" + "d:int\">0</Value> </Property> <Property Name=\"PreserveBom\"> <Value xsi:type=\"xsd:boolean\">" + "true</Value> </Property> <Property Name=\"HiddenProperties\"> <Value xsi:type=\"xsd:string\">" + "EnvelopeSpecTargetNamespaces,DocumentSpecTargetNamespaces,TargetCodePage</Value> </Property> </P" + "roperties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp0XmlProperties);; ((IPersistPropertyBag)(comp0)).Load(pb, 0); } this.AddComponent(stage, comp0); }
public void AddMessage(IPipelineContext pipelineContext, IBaseMessage message, bool severalMessages) { if (!this.IsAssemblingStage()) { throw new NotSupportedException("This call is legal only for the assembling stage"); } if (this.components.Count == 0) { if (severalMessages) { throw new InvalidOperationException("Can't have more than one incoming message in pipeline without assembler component"); } this.outputMessage = message; } else { IAssemblerComponent component = this.components[0] as IAssemblerComponent; IBaseComponent sender = this.components[0] as IBaseComponent; if (component != null) { this.FireCalling(sender, "AddDocument"); component.AddDocument(pipelineContext, message); this.FireCalled(sender, "AddDocument"); } else { if (severalMessages) { throw new InvalidOperationException("Can't have more than one incoming message with not an assembler component in send pipeline"); } this.outputMessage = message; } } }
public List <IGameObject> FindAllWithComponent <T>() where T : IBaseComponent { var foundObjects = new List <IGameObject>(); //Like searching for all game objects with a given metadata item, this requires us to look //at all of the gameobjects, and check if they have the given component. //A future improvement may be to store indices on components for quicker lookup. foreach (var gameObject in gameObjects.Values) { IBaseComponent component = gameObject.GetComponent <T>(); //We found the component of type T within this game object! if (component != null) { foundObjects.Add(gameObject); } } foreach (var gameObject in newGameObjects) { IBaseComponent component = gameObject.GetComponent <T>(); //We found the component of type T within this game object! if (component != null) { foundObjects.Add(gameObject); } } return(foundObjects); }
public XmlToSendPipeline() { Microsoft.BizTalk.PipelineOM.Stage stage = this.AddStage(new System.Guid("9d0e4108-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.all); IBaseComponent comp0 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("Microsoft.Practices.ESB.Namespace.PipelineComponents.RemoveNamespace,Microsoft.Practices.ESB.Namespace.PipelineComponents, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");; if (comp0 is IPersistPropertyBag) { string comp0XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"Encoding\"> " + " <Value xsi:type=\"xsd:string\">UTF8</Value> </Property> <Property Name=\"RemoveBOM\"> <Value" + " xsi:type=\"xsd:boolean\">false</Value> </Property> </Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp0XmlProperties);; ((IPersistPropertyBag)(comp0)).Load(pb, 0); } this.AddComponent(stage, comp0); IBaseComponent comp1 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("JsonPipelineComponents.DotNetTypesToJsonConverter,JsonPipelineComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3573ec9fb1123352");; if (comp1 is IPersistPropertyBag) { string comp1XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"TypeName\" /> <" + "/Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp1XmlProperties);; ((IPersistPropertyBag)(comp1)).Load(pb, 0); } this.AddComponent(stage, comp1); }
public IBaseMessage Assemble(IPipelineContext pipelineContext) { if (!this.IsAssemblingStage()) { throw new NotSupportedException("This call is legal only for the assembling stage"); } if (this.components.Count != 0) { IAssemblerComponent component = this.components[0] as IAssemblerComponent; IBaseComponent sender = this.components[0] as IBaseComponent; int num = 0; if (component != null) { this.FireCalling(sender, "Assemble"); this.outputMessage = component.Assemble(pipelineContext); this.FireCalled(sender, "Assemble"); num = 1; } for (int i = num; i < this.components.Count; i++) { sender = this.components[i] as IBaseComponent; IComponent component3 = this.components[i] as IComponent; if (component3 == null) { throw new InvalidOperationException("Component doesn't implement IComponent interface"); } this.FireCalling(sender, "Execute"); this.outputMessage = component3.Execute(pipelineContext, this.outputMessage); this.FireCalled(sender, "Execute"); } } return(this.outputMessage); }
public XSLTransform() { Microsoft.BizTalk.PipelineOM.Stage stage = this.AddStage(new System.Guid("9d0e4105-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.firstRecognized); IBaseComponent comp0 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("Microsoft.BizTalk.Component.XmlDasmComp,Microsoft.BizTalk.Pipeline.Components, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");; if (comp0 is IPersistPropertyBag) { string comp0XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"EnvelopeSpecNam" + "es\"> <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"EnvelopeSpecTargetNamesp" + "aces\"> <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"DocumentSpecNames\"> " + " <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"DocumentSpecTargetNamespaces\"> " + " <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"AllowUnrecognizedMessage\"> " + " <Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Property Name=\"ValidateDocument\"> " + " <Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Property Name=\"RecoverableInterc" + "hangeProcessing\"> <Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Property Name=" + "\"HiddenProperties\"> <Value xsi:type=\"xsd:string\">EnvelopeSpecTargetNamespaces,DocumentSpecTarge" + "tNamespaces</Value> </Property> </Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp0XmlProperties);; ((IPersistPropertyBag)(comp0)).Load(pb, 0); } this.AddComponent(stage, comp0); stage = this.AddStage(new System.Guid("9d0e410d-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.all); IBaseComponent comp1 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("BizTalkComponents.PipelineComponents.XSLTTransform,BizTalkComponents.PipelineComponents.XSLTransform, Version=1.0.0.1, Culture=neutral, PublicKeyToken=47190f56632fbc76");; if (comp1 is IPersistPropertyBag) { string comp1XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"MapName\" /> " + "<Property Name=\"Parameters\" /> </Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp1XmlProperties);; ((IPersistPropertyBag)(comp1)).Load(pb, 0); } this.AddComponent(stage, comp1); }
public XMLValidateReceivePipe() { Microsoft.BizTalk.PipelineOM.Stage stage = this.AddStage(new System.Guid("9d0e4105-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.firstRecognized); IBaseComponent comp0 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("Microsoft.BizTalk.Component.XmlDasmComp,Microsoft.BizTalk.Pipeline.Components, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");; if (comp0 is IPersistPropertyBag) { string comp0XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"EnvelopeSpecNam" + "es\"> <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"EnvelopeSpecTargetNamesp" + "aces\"> <Value xsi:type=\"xsd:string\" /> </Property> <Property Name=\"DocumentSpecNames\"> " + " <Value xsi:type=\"xsd:string\">ErrorHandling.ExpenseReportMessageType+ExpenseReport</Value> </Pr" + "operty> <Property Name=\"DocumentSpecTargetNamespaces\"> <Value xsi:type=\"xsd:string\">http://E" + "xpenseReports.ExpenseReport</Value> </Property> <Property Name=\"AllowUnrecognizedMessage\"> " + " <Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Property Name=\"ValidateDocument\"> " + " <Value xsi:type=\"xsd:boolean\">true</Value> </Property> <Property Name=\"AtomicInterchangePr" + "ocessing\"> <Value xsi:type=\"xsd:boolean\">true</Value> </Property> <Property Name=\"Recover" + "ableInterchangeProcessing\"> <Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Prop" + "erty Name=\"HiddenProperties\"> <Value xsi:type=\"xsd:string\">EnvelopeSpecTargetNamespaces,Documen" + "tSpecTargetNamespaces</Value> </Property> </Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp0XmlProperties);; ((IPersistPropertyBag)(comp0)).Load(pb, 0); } this.AddComponent(stage, comp0); }
protected virtual IBaseComponent DeserializeComponent(XElement element) { IBaseComponent component = null; //As long as we have a defined class and type, try to instantiate the corresponding component. if (element.Attribute("class") != null && element.Attribute("type") != null) { string assembly; if (element.Attribute("assembly") != null) { assembly = element.Attribute("assembly").Value; } else { assembly = Assembly.GetExecutingAssembly().FullName; } Type classType = Type.GetType(String.Format("{0},{1}", element.Attribute("class").Value, assembly)); string stringInterface = element.Attribute("type").Value; //Find the proper interface designated by the entity definition so we can store it properly in the GameObject... Type interfaceType = classType.GetInterface(stringInterface); component = GetComponent(classType); component.InterfaceType = interfaceType; component.ConcreteType = classType; component.Deserialize(element); } return(component); }
public DLSingelMsgSplitReceivePipeline() { Microsoft.BizTalk.PipelineOM.Stage stage = this.AddStage(new System.Guid("9d0e4105-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.firstRecognized); IBaseComponent comp0 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("Microsoft.BizTalk.Component.XmlDasmComp,Microsoft.BizTalk.Pipeline.Components, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");; if (comp0 is IPersistPropertyBag) { string comp0XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"EnvelopeSpecNam" + "es\"> <Value xsi:type=\"xsd:string\">Inchcape.DL.BT.PortCallSchedule.Schema.DataLoyMultipleInputSc" + "hema</Value> </Property> <Property Name=\"EnvelopeSpecTargetNamespaces\"> <Value xsi:type=\"" + "xsd:string\">http://Inchcape.DL.BT.PortCallSchedule.Schema.DataLoyMultipleInputSchema</Value> </Pr" + "operty> <Property Name=\"DocumentSpecNames\"> <Value xsi:type=\"xsd:string\">Inchcape.DL.BT.Port" + "CallSchedule.Schema.DataLoyPortCall</Value> </Property> <Property Name=\"DocumentSpecTargetName" + "spaces\"> <Value xsi:type=\"xsd:string\">http://Inchcape.DL.BT.PortCallSchedule.Schema.DataLoyPort" + "call</Value> </Property> <Property Name=\"AllowUnrecognizedMessage\"> <Value xsi:type=\"xsd:" + "boolean\">false</Value> </Property> <Property Name=\"ValidateDocument\"> <Value xsi:type=\"xs" + "d:boolean\">false</Value> </Property> <Property Name=\"RecoverableInterchangeProcessing\"> <" + "Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Property Name=\"HiddenProperties\"> " + " <Value xsi:type=\"xsd:string\">EnvelopeSpecTargetNamespaces,DocumentSpecTargetNamespaces</Value> <" + "/Property> </Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp0XmlProperties);; ((IPersistPropertyBag)(comp0)).Load(pb, 0); } this.AddComponent(stage, comp0); }
public Incoming_Resident_ReceivePipeline() { Microsoft.BizTalk.PipelineOM.Stage stage = this.AddStage(new System.Guid("9d0e4103-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.all); IBaseComponent comp0 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("NBS.Biztalk.PipelineComponents.Archiver,NBS.Biztalk.PipelineComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4998120d0cabe6c4");; if (comp0 is IPersistPropertyBag) { string comp0XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"IsDbArchive\"> " + " <Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Property Name=\"FileLocation\" /> " + " <Property Name=\"ArchiveFileNameProp\" /> </Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp0XmlProperties);; ((IPersistPropertyBag)(comp0)).Load(pb, 0); } this.AddComponent(stage, comp0); stage = this.AddStage(new System.Guid("9d0e4105-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.firstRecognized); IBaseComponent comp1 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("Microsoft.BizTalk.Component.FFDasmComp,Microsoft.BizTalk.Pipeline.Components, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");; if (comp1 is IPersistPropertyBag) { string comp1XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst" + "ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> <Properties> <Property Name=\"HeaderSpecName\"" + " /> <Property Name=\"DocumentSpecName\"> <Value xsi:type=\"xsd:string\">BTS.soap_encoding_1__1+a" + "nyType, Microsoft.BizTalk.GlobalPropertySchemas, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31" + "bf3856ad364e35</Value> </Property> <Property Name=\"TrailerSpecName\" /> <Property Name=\"Pres" + "erveHeader\"> <Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Property Name=\"Vali" + "dateDocumentStructure\"> <Value xsi:type=\"xsd:boolean\">false</Value> </Property> <Property" + " Name=\"RecoverableInterchangeProcessing\"> <Value xsi:type=\"xsd:boolean\">true</Value> </Prope" + "rty> </Properties></PropertyBag>"; PropertyBag pb = PropertyBag.DeserializeFromXml(comp1XmlProperties);; ((IPersistPropertyBag)(comp1)).Load(pb, 0); } this.AddComponent(stage, comp1); }
public IBaseMessage GetNextOutputMessage(IPipelineContext pipelineContext) { if (pipelineContext == null) { throw new ArgumentNullException("pipelineContext"); } if (!this.IsDisassemblingStage()) { throw new NotSupportedException("This call is legal only for the disassembling stage"); } IBaseMessage outputMessage = null; if (this.components.Count == 0) { outputMessage = this.outputMessage; this.outputMessage = null; return(outputMessage); } IBaseComponent sender = this.components[this.currentDisassembler] as IBaseComponent; IDisassemblerComponent component2 = this.components[this.currentDisassembler] as IDisassemblerComponent; this.FireCalling(sender, "GetNext"); if (component2 != null) { outputMessage = component2.GetNext(pipelineContext); } this.FireCalled(sender, "GetNext"); return(outputMessage); }
public void AddComponent(IBaseComponent component) { var componentType = component.GetType(); if (!this.ComponentsByType.TryAdd(componentType, component)) { Logger.Write(typeof(ComponentRegistry), LogLevel.Warn, "Cannot register component type \"{0}\", it was already registered.", componentType.FullName); } foreach (var componentInterface in componentType.GetInterfaces()) { if (!this.ComponentsByInterface.GetOrAdd(componentInterface, () => new HashSet <IBaseComponent>()).Add(component)) { Logger.Write(typeof(ComponentRegistry), LogLevel.Warn, "Cannot register component type \"{0}\" by interface \"{1}\", it was already registered.", componentType.FullName, componentInterface.FullName); } } var attribute = componentType.GetCustomAttribute <ComponentAttribute>(); if (attribute == null || string.IsNullOrEmpty(attribute.Slot) || string.Equals(attribute.Slot, ComponentSlots.None, StringComparison.OrdinalIgnoreCase)) { return; } if (!this.ComponentsBySlot.GetOrAdd(attribute.Slot, () => new HashSet <IBaseComponent>()).Add(component)) { Logger.Write(typeof(ComponentRegistry), LogLevel.Warn, "Cannot register component type \"{0}\" by slot \"{1}\", it was already registered.", componentType.FullName, attribute.Slot); } }
public IBaseComponent CreatePipelineComponent(string typeName) { Type type = Type.GetType(typeName); if (type != null) { IBaseComponent component = (IBaseComponent)Activator.CreateInstance(type); if (component != null) { return(component); } } string path = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\BizTalk Server\3.0").GetValue("InstallPath").ToString() + "Pipeline Components"; if (typeName.IndexOf(',') >= 0) { typeName = typeName.Substring(0, typeName.IndexOf(',')); } foreach (FileInfo info in new DirectoryInfo(path).GetFiles("*.dll")) { try { IBaseComponent component2 = (IBaseComponent)Assembly.LoadFrom(info.FullName).CreateInstance(typeName); if (component2 != null) { return(component2); } } catch { } } throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "Can't instantiate pipeline component component with type name {0}.", new object[] { typeName })); }
private IBaseComponent CreatePipelineComponent(XmlNode componentNode) { XmlNode node = componentNode.SelectSingleNode("Name"); if (node == null) { throw new InvalidOperationException("Component name node is not found"); } IBaseComponent component = this.CreatePipelineComponent(node.InnerText); IPropertyBag propertyBag = (IPropertyBag) new BTMPropertyBag(); foreach (XmlNode node2 in componentNode.SelectNodes("Properties/Property")) { if (node2.Attributes["Name"] == null) { throw new InvalidOperationException("Name attribute is not found for a property node"); } string innerText = node2.Attributes["Name"].InnerText; XmlNode valueNode = node2.SelectSingleNode("Value"); if (valueNode != null) { object typedPropertyValue = this.GetTypedPropertyValue(valueNode); propertyBag.Write(innerText, ref typedPropertyValue); } } ((IPersistPropertyBag)component).Load(propertyBag, 0); return(component); }
public void AddComponent(IBaseComponent component) { if (component == null) { throw new ArgumentNullException("component"); } this.components.Add(component); }
public void AddComponent(Type baseInterfaceType, IBaseComponent component) { if (!components.ContainsKey(baseInterfaceType)) { components.Add(baseInterfaceType, component); component.Parent = this; } }
public Task WriteAsync(IBaseComponent component, LogLevel level, string message, params object[] args) { #if NET40 return(TaskEx.FromResult(false)); #else return(Task.CompletedTask); #endif }
public bool IsErrorEnabled(IBaseComponent component) { #if DEBUG return(true); #else return(false); #endif }
public void FF_CanAddHeaderSpec() { IBaseComponent disassembler = Disassembler.FlatFile() .WithHeaderSpec <Schema1_NPP>().End(); FFDasmComp ff = disassembler as FFDasmComp; Assert.IsNotNull(ff.HeaderSpecName); }
public void Xml_WithRIP() { IBaseComponent disassembler = Disassembler.Xml() .WithRecoverableInterchange(true).End(); XmlDasmComp xml = disassembler as XmlDasmComp; Assert.AreEqual(true, xml.RecoverableInterchangeProcessing); }
public void Xml_WithValidation() { IBaseComponent disassembler = Disassembler.Xml() .WithValidation(true).End(); XmlDasmComp xml = disassembler as XmlDasmComp; Assert.AreEqual(true, xml.ValidateDocument); }
public void Xml_CanAddEnvelopeSpec() { IBaseComponent disassembler = Disassembler.Xml() .WithEnvelopeSpec <SimpleEnv>().End(); XmlDasmComp xml = disassembler as XmlDasmComp; Assert.AreEqual(1, xml.EnvelopeSpecNames.Count); }
public void FF_WithRIP() { IBaseComponent disassembler = Disassembler.FlatFile() .WithRecoverableInterchange(true).End(); FFDasmComp ff = disassembler as FFDasmComp; Assert.AreEqual(true, ff.RecoverableInterchangeProcessing); }
public void FF_WithPreserveHeader() { IBaseComponent disassembler = Disassembler.FlatFile() .WithPreserveHeader(true).End(); FFDasmComp ff = disassembler as FFDasmComp; Assert.AreEqual(true, ff.PreserveHeader); }
public void Xml_WithPreserveBom() { IBaseComponent assembler = Assembler.Xml() .WithPreserveBom(true).End(); XmlAsmComp xml = assembler as XmlAsmComp; Assert.AreEqual(true, xml.PreserveBom); }
public void Xml_WithXmlDeclaration() { IBaseComponent assembler = Assembler.Xml() .WithXmlDeclaration(true).End(); XmlAsmComp xml = assembler as XmlAsmComp; Assert.AreEqual(true, xml.AddXMLDeclaration); }
public void FF_CanAddDocumentSpec() { IBaseComponent assembler = Assembler.FlatFile() .WithDocumentSpec <Schema1_NPP>().End(); FFAsmComp ff = assembler as FFAsmComp; Assert.IsNotNull(ff.DocumentSpecName); }
/// <summary> /// Updates the display for <paramref name="component"/> /// </summary> /// <param name="component"></param> public void Update(IBaseComponent component) { // Get the new info var newInfo = _CurrentSection.Current.Item1.GetInfo(component); // Assign it to proper properties Info = newInfo.Item1; InterpretedInfo = newInfo.Item2; }
public void FF_WithValidation() { IBaseComponent disassembler = Disassembler.FlatFile() .WithValidation(true).End(); FFDasmComp ff = disassembler as FFDasmComp; Assert.AreEqual(true, ff.ValidateDocumentStructure); }
public override void CopyInto(IBaseComponent newObject) { var damageComp = newObject as DamageComponent; Debug.Assert(damageComp != null, "damageComp != null"); damageComp.Damage = Damage; base.CopyInto(newObject); }
public override void CopyInto(IBaseComponent newObject) { var healthComp = newObject as InvincibleHealthComponent; Debug.Assert(healthComp != null, "healthComp != null"); healthComp.IsInvincible = IsInvincible; base.CopyInto(newObject); }
public override void CopyInto(IBaseComponent newObject) { var baseInputComponent = newObject as BaseInputComponent; Debug.Assert(baseInputComponent != null, "baseInputComponent != null"); baseInputComponent.InputHandler = InputHandler; base.CopyInto(newObject); }
public override void CopyInto(IBaseComponent newObject) { var healthComp = newObject as IntervalInvincibleHealthComponent; Debug.Assert(healthComp != null, "intervalHealthComponent != null"); healthComp.InvincibleInterval = InvincibleInterval; healthComp.CurrInvincibleTime = CurrInvincibleTime; base.CopyInto(newObject); }
public override void CopyInto(IBaseComponent newObject) { var healthComp = newObject as HealthComponent; Debug.Assert(healthComp != null, "healthComp != null"); healthComp.MaxHealth = MaxHealth; healthComp.CurrHealth = CurrHealth; base.CopyInto(newObject); }
public static void TestFlatFile(IBaseComponent component) { var components = new List<Tuple<IBaseComponent, PipelineStage>> { new Tuple<IBaseComponent, PipelineStage>(component, PipelineStage.Validate) }; var result = ExecuteReceivePipeline(TestFiles.FlatFileFilePath, components); using (var reader = new StreamReader(result[0].BodyPart.Data)) { var line = reader.ReadLine(); Assert.IsTrue(line != null && line.Equals("test test"), "Text file is not unchanged"); } }
public override void CopyInto(IBaseComponent newObject) { var collisionComp = newObject as CollisionComponent; Debug.Assert(collisionComp != null, "collisionComp != null"); collisionComp.BoundingBox2D = (BoundingBox2D) BoundingBox2D.DeepCopy(); collisionComp.CollisionPriority = CollisionPriority; base.CopyInto(newObject); }
public override void CopyInto(IBaseComponent newObject) { var behaviorComp = newObject as BehaviorComponent; Debug.Assert(behaviorComp != null, "behaviorComp != null"); foreach (var behavior in behaviors.Values) { var newBehavior = behaviorFactory.GetBehavior(behavior.GetType()); behavior.CopyInto(newBehavior); newBehavior.Parent = behaviorComp; behaviorComp.behaviors.Add(newBehavior.Name, newBehavior); } base.CopyInto(newObject); }
public override void CopyInto(IBaseComponent newObject) { var movementComponent = newObject as MovementComponent; Debug.Assert(movementComponent != null, "movementComponent != null"); movementComponent.MaxVelocity = MaxVelocity; movementComponent.MoveVelocity = MoveVelocity; movementComponent.VelocityDampingPercent = VelocityDampingPercent; base.CopyInto(newObject); }
public virtual void CopyInto(IBaseComponent newObject) { newObject.InterfaceType = InterfaceType; newObject.ConcreteType = ConcreteType; }
public override void CopyInto(IBaseComponent newObject) { var physicsComponent = newObject as PhysicsComponent; Debug.Assert(physicsComponent != null, "physicsComponent != null"); physicsComponent.MaxVelocity = MaxVelocity; physicsComponent.Solid = Solid; foreach (KeyValuePair<string, Body> bodyEntry in Bodies) { var body = bodyEntry.Value.DeepClone(); ((FarseerUserData)body.UserData).Owner = physicsComponent; physicsComponent.AddBody(bodyEntry.Value.DeepClone(), bodyEntry.Key); physicsManager.RegisterBody(body); } foreach (KeyValuePair<string, Joint> joint in Joints) { physicsComponent.copyJoints.Add(joint.Key, joint.Value); } base.CopyInto(newObject); }
public override void CopyInto(IBaseComponent newObject) { var renderComponent = newObject as RenderComponent; Debug.Assert(renderComponent != null, "renderComponent != null"); renderComponent.Visible = true; foreach (var renderableKeyValue in renderables) { var newRenderable = renderableKeyValue.Value.DeepClone(); newRenderable.Visible = true; renderComponent.AddRenderable(newRenderable, renderableKeyValue.Key); } base.CopyInto(newObject); }