Exemple #1
0
        internal Switch(global::Truesight.Parser.Impl.MethodBody source, global::System.IO.BinaryReader reader, global::System.Collections.ObjectModel.ReadOnlyCollection <global::Truesight.Parser.Impl.ILOp> prefixes)
            : base(source, AssertSupportedOpCode(reader), (int)reader.BaseStream.Position - global::System.Linq.Enumerable.Sum(global::System.Linq.Enumerable.Select(prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()), prefix => prefix.Size)), prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()))
        {
            // this is necessary for further verification
            var origPos = reader.BaseStream.Position;

            // initializing _targetOffsets
            _targetOffsets = ((global::System.Func <global::System.Collections.ObjectModel.ReadOnlyCollection <global::System.Tuple <int, int> > >)(() =>
            {
                var n = ReadI4(reader);
                var pivot = (int)reader.BaseStream.Position + sizeof(int) * n;

                return(global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Select(
                                                                                        global::System.Linq.Enumerable.Range(1, n), _ =>
                {
                    var relative = ReadI4(reader);
                    var absolute = pivot + relative;
                    return global::System.Tuple.Create(relative, absolute);
                })));
            }))();

            // verify that we've read exactly the amount of bytes we should
            var bytesRead = reader.BaseStream.Position - origPos;

            global::XenoGears.Assertions.AssertionHelper.AssertTrue(bytesRead == SizeOfOperand);

            // now when the initialization is completed verify that we've got only prefixes we support
            global::XenoGears.Assertions.AssertionHelper.AssertAll(Prefixes, prefix =>
            {
                return(false);
            });
        }
Exemple #2
0
        internal Switch(global::Truesight.Parser.Impl.MethodBody source, global::System.IO.BinaryReader reader, global::System.Collections.ObjectModel.ReadOnlyCollection<global::Truesight.Parser.Impl.ILOp> prefixes)
            : base(source, AssertSupportedOpCode(reader), (int)reader.BaseStream.Position - global::System.Linq.Enumerable.Sum(global::System.Linq.Enumerable.Select(prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty<global::Truesight.Parser.Impl.ILOp>()), prefix => prefix.Size)), prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty<global::Truesight.Parser.Impl.ILOp>()))
        {
            // this is necessary for further verification
            var origPos = reader.BaseStream.Position;

            // initializing _targetOffsets
            _targetOffsets = ((global::System.Func<global::System.Collections.ObjectModel.ReadOnlyCollection<global::System.Tuple<int, int>>>)(() => 
            {
                var n = ReadI4(reader);
                var pivot = (int)reader.BaseStream.Position + sizeof(int) * n;

                return global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Select(
                    global::System.Linq.Enumerable.Range(1, n), _ => 
                    {
                        var relative = ReadI4(reader);
                        var absolute = pivot + relative;
                        return global::System.Tuple.Create(relative, absolute);
                    }));
            }))();

            // verify that we've read exactly the amount of bytes we should
            var bytesRead = reader.BaseStream.Position - origPos;
            global::XenoGears.Assertions.AssertionHelper.AssertTrue(bytesRead == SizeOfOperand);

            // now when the initialization is completed verify that we've got only prefixes we support
            global::XenoGears.Assertions.AssertionHelper.AssertAll(Prefixes, prefix => 
            {
                return false;
            });
        }
        // IVectorView<T> GetView()
        public static global::System.Collections.Generic.IReadOnlyList <T> GetView <T>(
            global::System.Collections.Generic.IList <T> _this
            )
        {
            //Contract.Assert(_this != null);

            // Note: This list is not really read-only - you could QI for a modifiable
            // list.  We gain some perf by doing this.  We believe this is acceptable.
            global::System.Collections.Generic.IReadOnlyList <T> roList = _this as global::System.Collections.Generic.IReadOnlyList <T>;
            if (roList == null)
            {
                roList = new global::System.Collections.ObjectModel.ReadOnlyCollection <T>(_this);
            }
            return(roList);
        }
        /// <summary>
        /// Returns an enumeration of all the Types supported by a given Adapter.
        /// </summary>
        /// <param name="adapterId">Id of the adapter</param>
        /// <returns>Supported types by the Adapter</returns>
        public override global::System.Collections.Generic.IEnumerable <DslIntegration::SupportedType> GetExposedElementTypes(string adapterId)
        {
            // Do we support this type of adapter?
            if (!this.GetSupportedLogicalAdapterIds().Contains(adapterId))
            {
                return(new DslIntegration::SupportedType[] { });
            }

            // Cache management
            if (exposedElementTypes == null)
            {
                global::System.Collections.Generic.List <DslIntegration::SupportedType> types = new global::System.Collections.Generic.List <DslIntegration::SupportedType>();

                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractModel), "DataContractModel"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContract), "DataContract"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(ModelElementReference), "ModelElementReference"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(PrimitiveDataType), "PrimitiveDataType"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(FaultContract), "FaultContract"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractCollection), "DataContractCollection"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractEnum), "DataContractEnum"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(EnumNamedValue), "EnumNamedValue"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(PrimitiveDataTypeCollection), "PrimitiveDataTypeCollection"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(ReferenceDataType), "ReferenceDataType"));
                exposedElementTypes = types.AsReadOnly();
            }

            return(exposedElementTypes);
        }
Exemple #5
0
        /// <summary>
        /// Returns an enumeration of all the Types supported by a given Adapter.
        /// </summary>
        /// <param name="adapterId">Id of the adapter</param>
        /// <returns>Supported types by the Adapter</returns>
        public override global::System.Collections.Generic.IEnumerable <DslIntegration::SupportedType> GetExposedElementTypes(string adapterId)
        {
            // Do we support this type of adapter?
            if (!this.GetSupportedLogicalAdapterIds().Contains(adapterId))
            {
                return(new DslIntegration::SupportedType[] { });
            }

            // Cache management
            if (exposedElementTypes == null)
            {
                global::System.Collections.Generic.List <DslIntegration::SupportedType> types = new global::System.Collections.Generic.List <DslIntegration::SupportedType>();

                types.Add(
                    new DslIntegration::SupportedType(typeof(ServiceContractModel), "ServiceContractModel"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(ServiceContract), "ServiceContract"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(Operation), "Operation"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(Service), "Service"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(Message), "Message"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractMessagePart), "DataContractMessagePart"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(PrimitiveMessagePart), "PrimitiveMessagePart"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(XsdMessage), "XsdMessage"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractFault), "DataContractFault"));

                types.Add(
                    new DslIntegration::SupportedType(typeof(XsdElementFault), "XsdElementFault"));
                exposedElementTypes = types.AsReadOnly();
            }

            return(exposedElementTypes);
        }
Exemple #6
0
        /// <summary>
        /// Called to initialize the view after the corresponding document has been loaded.
        /// </summary>
        protected override bool LoadView()
        {
            base.LoadView();

            global::System.Diagnostics.Debug.Assert(this.DocData.RootElement != null);
            if (this.DocData.RootElement == null)
            {
                return(false);
            }

            // The diagram should exist in the diagram partition by now, just need to find it and connect it to this view.
            GeneratorLanguageDocDataBase docData = this.DocData as GeneratorLanguageDocDataBase;

            global::System.Diagnostics.Debug.Assert(docData != null, "DocData for GeneratorLanguageDocViewBase should be an GeneratorLanguageDocDataBase!");
            DslModeling::Partition diagramPartition = docData.GetDiagramPartition();

            if (diagramPartition != null)
            {
                global::System.Collections.ObjectModel.ReadOnlyCollection <global::Ultramarine.Generators.Language.GeneratorLanguageDiagram> diagrams = docData.GetDiagramPartition().ElementDirectory.FindElements <global::Ultramarine.Generators.Language.GeneratorLanguageDiagram>();
                if (diagrams.Count > 0)
                {
                    global::System.Diagnostics.Debug.Assert(diagrams.Count == 1, "Found more than one diagram, using the first one found.");
                    this.Diagram = (DslDiagrams::Diagram)diagrams[0];
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }

            return(true);
        }
Exemple #7
0
        internal Stelem(global::Truesight.Parser.Impl.MethodBody source, global::System.IO.BinaryReader reader, global::System.Collections.ObjectModel.ReadOnlyCollection <global::Truesight.Parser.Impl.ILOp> prefixes)
            : base(source, AssertSupportedOpCode(reader), (int)reader.BaseStream.Position - global::System.Linq.Enumerable.Sum(global::System.Linq.Enumerable.Select(prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()), prefix => prefix.Size)), prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()))
        {
            // this is necessary for further verification
            var origPos = reader.BaseStream.Position;

            // initializing _typeToken
            switch ((ushort)OpSpec.OpCode.Value)
            {
            case 0x9b:     //stelem.i
            case 0x9c:     //stelem.i1
            case 0x9d:     //stelem.i2
            case 0x9e:     //stelem.i4
            case 0x9f:     //stelem.i8
            case 0xa0:     //stelem.r4
            case 0xa1:     //stelem.r8
            case 0xa2:     //stelem.ref
                _typeToken = default(int);
                break;

            case 0xa4:     //stelem
                _typeToken = ReadMetadataToken(reader);
                break;

            default:
                throw global::XenoGears.Assertions.AssertionHelper.Fail();
            }

            // verify that we've read exactly the amount of bytes we should
            var bytesRead = reader.BaseStream.Position - origPos;

            global::XenoGears.Assertions.AssertionHelper.AssertTrue(bytesRead == SizeOfOperand);

            // now when the initialization is completed verify that we've got only prefixes we support
            global::XenoGears.Assertions.AssertionHelper.AssertAll(Prefixes, prefix =>
            {
                return(false);
            });
        }
Exemple #8
0
                private static global::System.Exception _ShowWorkItemsListDetail_CanInvoke(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args, global::System.Exception ex)
                {
                    bool result = true;

                    d.Application.WorkItemsListDetail_CanRun(ref result);
                    return(result ? null : ex);
                }
        /// <summary>
        /// Returns an enumeration of all the Types supported by a given Adapter.
        /// </summary>
        /// <param name="adapterId">Id of the adapter</param>
        /// <returns>Supported types by the Adapter</returns>
        public override global::System.Collections.Generic.IEnumerable<DslIntegration::SupportedType> GetExposedElementTypes(string adapterId)
		{
            // Do we support this type of adapter?
            if (!this.GetSupportedLogicalAdapterIds().Contains(adapterId))
			{
                return new DslIntegration::SupportedType[] { };
			}

            // Cache management
            if (exposedElementTypes == null)
            {
				global::System.Collections.Generic.List<DslIntegration::SupportedType> types = new global::System.Collections.Generic.List<DslIntegration::SupportedType>();
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractModel), "DataContractModel"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContract), "DataContract"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(ModelElementReference), "ModelElementReference"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(PrimitiveDataType), "PrimitiveDataType"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(FaultContract), "FaultContract"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractCollection), "DataContractCollection"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractEnum), "DataContractEnum"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(EnumNamedValue), "EnumNamedValue"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(PrimitiveDataTypeCollection), "PrimitiveDataTypeCollection"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(ReferenceDataType), "ReferenceDataType"));
 				exposedElementTypes = types.AsReadOnly();
           }

            return exposedElementTypes;
        }
Exemple #10
0
        private static DslModeling::ModelElement GetParentForRelationship(DslModeling::ElementLink elementLink)
        {
            global::System.Collections.ObjectModel.ReadOnlyCollection <DslModeling::ModelElement> linkedElements = elementLink.LinkedElements;

            if (linkedElements.Count == 2)
            {
                DslDiagrams::ShapeElement sourceShape = linkedElements[0] as DslDiagrams::ShapeElement;
                DslDiagrams::ShapeElement targetShape = linkedElements[1] as DslDiagrams::ShapeElement;

                if (sourceShape == null)
                {
                    DslModeling::LinkedElementCollection <DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[0]);
                    foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
                    {
                        DslDiagrams::ShapeElement shape = presentationElement as DslDiagrams::ShapeElement;
                        if (shape != null)
                        {
                            sourceShape = shape;
                            break;
                        }
                    }
                }

                if (targetShape == null)
                {
                    DslModeling::LinkedElementCollection <DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[1]);
                    foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
                    {
                        DslDiagrams::ShapeElement shape = presentationElement as DslDiagrams::ShapeElement;
                        if (shape != null)
                        {
                            targetShape = shape;
                            break;
                        }
                    }
                }

                if (sourceShape == null || targetShape == null)
                {
                    global::System.Diagnostics.Debug.Fail("Unable to find source and/or target shape for view fixup.");
                    return(null);
                }

                DslDiagrams::ShapeElement sourceParent = sourceShape.ParentShape;
                DslDiagrams::ShapeElement targetParent = targetShape.ParentShape;

                while (sourceParent != targetParent && sourceParent != null)
                {
                    DslDiagrams::ShapeElement curParent = targetParent;
                    while (sourceParent != curParent && curParent != null)
                    {
                        curParent = curParent.ParentShape;
                    }

                    if (sourceParent == curParent)
                    {
                        break;
                    }
                    else
                    {
                        sourceParent = sourceParent.ParentShape;
                    }
                }

                while (sourceParent != null)
                {
                    // ensure that the parent can parent connectors (i.e., a diagram or a swimlane).
                    if (sourceParent is DslDiagrams::Diagram || sourceParent is DslDiagrams::SwimlaneShape)
                    {
                        break;
                    }
                    else
                    {
                        sourceParent = sourceParent.ParentShape;
                    }
                }

                global::System.Diagnostics.Debug.Assert(sourceParent != null && sourceParent.ModelElement != null, "Unable to find common parent for view fixup.");
                return(sourceParent.ModelElement);
            }

            return(null);
        }
Exemple #11
0
        internal Starg(global::Truesight.Parser.Impl.MethodBody source, global::System.IO.BinaryReader reader, global::System.Collections.ObjectModel.ReadOnlyCollection <global::Truesight.Parser.Impl.ILOp> prefixes)
            : base(source, AssertSupportedOpCode(reader), (int)reader.BaseStream.Position - global::System.Linq.Enumerable.Sum(global::System.Linq.Enumerable.Select(prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()), prefix => prefix.Size)), prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()))
        {
            // this is necessary for further verification
            var origPos = reader.BaseStream.Position;

            // initializing _constValue
            _constValue = default(int?);

            // initializing _useConstValue
            _useConstValue = default(bool);

            // initializing _value
            switch ((ushort)OpSpec.OpCode.Value)
            {
            case 0x10:     //starg.s
                _value = _useConstValue ? _constValue.Value : ReadI1(reader);
                break;

            case 0xfe0b:     //starg
                _value = _useConstValue ? _constValue.Value : ReadI4(reader);
                break;

            default:
                throw global::XenoGears.Assertions.AssertionHelper.Fail();
            }

            // verify that we've read exactly the amount of bytes we should
            var bytesRead = reader.BaseStream.Position - origPos;

            global::XenoGears.Assertions.AssertionHelper.AssertTrue(bytesRead == SizeOfOperand);

            // now when the initialization is completed verify that we've got only prefixes we support
            global::XenoGears.Assertions.AssertionHelper.AssertAll(Prefixes, prefix =>
            {
                return(false);
            });
        }
Exemple #12
0
 public void NotEmpty()
 {
     if (Environment.OSVersion.Platform != PlatformID.Unix)
     {
         return;
     }
     global::System.Collections.ObjectModel.ReadOnlyCollection <TimeZoneInfo> systemTZ = TimeZoneInfo.GetSystemTimeZones();
     Assert.IsNotNull(systemTZ, "SystemTZ is null");
     Assert.IsFalse(systemTZ.Count == 0, "SystemTZ is empty");
 }
Exemple #13
0
                private static void _ShowEditableIssuesGrid_InvokeMethod(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args)
                {
                    bool handled = false;

                    d.Application.EditableIssuesGrid_Run(ref handled);
                    if (!handled)
                    {
                        d.ShowScreen("LightSwitchApplication:EditableIssuesGrid", () => global::LightSwitchApplication.EditableIssuesGrid.CreateInstance(), args);
                    }
                }
Exemple #14
0
        /// <summary>
        /// Called to initialize the view after the corresponding document has been loaded.
        /// </summary>
        protected override bool LoadView()
        {
            base.LoadView();

            global::System.Diagnostics.Debug.Assert(this.DocData.RootElement != null);
            if (this.DocData.RootElement == null)
            {
                return(false);
            }
            // The diagram should exist in the store by now, just need to find it and connect it to this view.
            global::System.Collections.ObjectModel.ReadOnlyCollection <global::ConfigurationSectionDesigner.ConfigurationSectionDesignerDiagram> diagrams = this.DocData.Store.ElementDirectory.FindElements <global::ConfigurationSectionDesigner.ConfigurationSectionDesignerDiagram>();
            if (diagrams.Count > 0)
            {
                global::System.Diagnostics.Debug.Assert(diagrams.Count == 1, "Found more than one diagram, using the first one found.");
                this.Diagram = (DslDiagrams::Diagram)diagrams[0];
            }
            else
            {
                return(false);
            }

            return(true);
        }
Exemple #15
0
        /// <summary>
        /// Returns an enumeration of all the Types supported by a given Adapter.
        /// </summary>
        /// <param name="adapterId">Id of the adapter</param>
        /// <returns>Supported types by the Adapter</returns>
        public override global::System.Collections.Generic.IEnumerable<DslIntegration::SupportedType> GetExposedElementTypes(string adapterId)
        {
            // Do we support this type of adapter?
            if (!this.GetSupportedLogicalAdapterIds().Contains(adapterId))
            {
                return new DslIntegration::SupportedType[] { };
            }

            // Cache management
            if (exposedElementTypes == null)
            {
                global::System.Collections.Generic.List<DslIntegration::SupportedType> types = new global::System.Collections.Generic.List<DslIntegration::SupportedType>();
                types.Add(
                    new DslIntegration::SupportedType(typeof(Process), "Process"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(SubProcessElement), "SubProcessElement"));
                 exposedElementTypes = types.AsReadOnly();
           }

            return exposedElementTypes;
        }
Exemple #16
0
                private static void _ShowSubscriberPhoneServiceDetail_InvokeMethod(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args)
                {
                    bool handled = false;

                    d.Application.SubscriberPhoneServiceDetail_Run(ref handled, (int)args[0]);
                    if (!handled)
                    {
                        d.ShowScreen("LightSwitchApplication:SubscriberPhoneServiceDetail", () => global::LightSwitchApplication.SubscriberPhoneServiceDetail.CreateInstance((int)args[0]), args);
                    }
                }
Exemple #17
0
                private static global::System.Exception _ShowSubscriberPhoneServiceDetail_CanInvoke(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args, global::System.Exception ex)
                {
                    bool result = true;

                    d.Application.SubscriberPhoneServiceDetail_CanRun(ref result, (int)args[0]);
                    return(result ? null : ex);
                }
Exemple #18
0
                private static void _ShowEngineerIssues_InvokeMethod(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args)
                {
                    bool handled = false;

                    d.Application.EngineerIssues_Run(ref handled, (int)args[0]);
                    if (!handled)
                    {
                        d.ShowScreen("LightSwitchApplication.HelpDeskCS.DesktopClient:EngineerIssues", () => global::LightSwitchApplication.EngineerIssues.CreateInstance((int)args[0]), args);
                    }
                }
Exemple #19
0
		/// <summary>
		/// Called to initialize the view after the corresponding document has been loaded.
		/// </summary>
		protected override bool LoadView()
		{
			base.LoadView();

			global::System.Diagnostics.Debug.Assert(this.DocData.RootElement!=null);
			if (this.DocData.RootElement == null)
			{
				return false;
			}

			// The diagram should exist in the diagram partition by now, just need to find it and connect it to this view.
			ActiveWriterDocDataBase docData = this.DocData as ActiveWriterDocDataBase;
			global::System.Diagnostics.Debug.Assert(docData != null, "DocData for ActiveWriterDocViewBase should be an ActiveWriterDocDataBase!");
			DslModeling::Partition diagramPartition = docData.GetDiagramPartition();
			if (diagramPartition != null)
			{
				global::System.Collections.ObjectModel.ReadOnlyCollection<global::Castle.ActiveWriter.ActiveRecordMapping> diagrams = docData.GetDiagramPartition().ElementDirectory.FindElements<global::Castle.ActiveWriter.ActiveRecordMapping>();
				if (diagrams.Count > 0)
				{
					global::System.Diagnostics.Debug.Assert(diagrams.Count == 1, "Found more than one diagram, using the first one found.");
					this.Diagram = (DslDiagrams::Diagram)diagrams[0];
				}
				else
				{
					return false;
				}
			}
			else
			{
				return false;
			}

			return true;
		}
Exemple #20
0
                private static void _ShowSearchJobCards_InvokeMethod(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args)
                {
                    bool handled = false;

                    d.Application.SearchJobCards_Run(ref handled);
                    if (!handled)
                    {
                        d.ShowScreen("LightSwitchApplication.Job_System_11_30.DesktopClient:SearchJobCards", () => global::LightSwitchApplication.SearchJobCards.CreateInstance(), args);
                    }
                }
Exemple #21
0
        /// <summary>
        /// Write extension element data inside the current XML element
        /// </summary>
        /// <param name="serializationContext">The current serialization context instance.</param>
        /// <param name="element">The element whose attributes have just been written.</param>
        /// <param name="writer">XmlWriter to write serialized data to.</param>
        /// <remarks>The default implemenation is to write out all non-embedded extension elements,
        /// regardless of whether they relate to the current element or not.
        /// The additional data should be written as a series of one or more
        /// XML elements.</remarks>
        internal protected virtual void WriteExtensions(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
        {
            if (serializationContext == null)
            {
                throw new global::System.ArgumentNullException("serializationContext");
            }
            if (element == null)
            {
                throw new global::System.ArgumentNullException("element");
            }
            if (writer == null)
            {
                throw new global::System.ArgumentNullException("writer");
            }

            // Build a list of extension elements to serialize
            global::System.Collections.ObjectModel.ReadOnlyCollection <DslModeling::ModelElement> allExtensionElements          = element.Partition.ElementDirectory.FindElements(DslModeling::ExtensionElement.DomainClassId, true);
            global::System.Collections.Generic.IEnumerable <DslModeling::ExtensionElement>        nonEmbeddedExtensionsElements = allExtensionElements.Where(e => DslModeling::DomainClassInfo.FindEmbeddingElementLink(e) == null).OfType <DslModeling::ExtensionElement>();

            DslModeling::SerializationUtilities.WriteExtensions(serializationContext, writer, nonEmbeddedExtensionsElements);
        }
Exemple #22
0
 public void ContainsBrussels()
 {
     if (Environment.OSVersion.Platform != PlatformID.Unix)
     {
         return;
     }
     global::System.Collections.ObjectModel.ReadOnlyCollection <TimeZoneInfo> systemTZ = TimeZoneInfo.GetSystemTimeZones();
     foreach (TimeZoneInfo tz in systemTZ)
     {
         if (tz.Id == "Europe/Brussels")
         {
             return;
         }
     }
     Assert.Fail("Europe/Brussels not found in SystemTZ");
 }
Exemple #23
0
        private void WriteChildElementsExtended(DslModeling::SerializationContext serializationContext, MetaModel element, global::System.Xml.XmlWriter writer)
        {
            // MetaModelHasDomainTypes
            global::System.Collections.ObjectModel.ReadOnlyCollection <MetaModelHasDomainTypes> allMetaModelHasDomainTypesInstances = MetaModelHasDomainTypes.GetLinksToDomainTypes(element);
            if (!serializationContext.Result.Failed && allMetaModelHasDomainTypesInstances.Count > 0)
            {
                writer.WriteStartElement("domainTypes");
                global::System.Type typeofMetaModelHasDomainTypes = typeof(MetaModelHasDomainTypes);
                foreach (MetaModelHasDomainTypes eachMetaModelHasDomainTypesInstance in allMetaModelHasDomainTypesInstances)
                {
                    if (serializationContext.Result.Failed)
                    {
                        break;
                    }

                    if (eachMetaModelHasDomainTypesInstance.GetType() != typeofMetaModelHasDomainTypes)
                    {                           // Derived relationships will be serialized in full-form.
                        DslModeling::DomainClassXmlSerializer derivedRelSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasDomainTypesInstance.GetDomainClass().Id);
                        global::System.Diagnostics.Debug.Assert(derivedRelSerializer != null, "Cannot find serializer for " + eachMetaModelHasDomainTypesInstance.GetDomainClass().Name + "!");
                        derivedRelSerializer.Write(serializationContext, eachMetaModelHasDomainTypesInstance, writer);
                    }
                    else
                    {                           // No need to serialize the relationship itself, just serialize the role-player directly.
                        DslModeling::ModelElement             targetElement    = eachMetaModelHasDomainTypesInstance.DomainType;
                        DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
                        global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
                        targetSerializer.Write(serializationContext, targetElement, writer);
                    }
                }
                writer.WriteEndElement();
            }

            // MetaModelHasValidation
            MetaModelHasValidation theMetaModelHasValidationInstance = MetaModelHasValidation.GetLinkToValidation(element);

            if (!serializationContext.Result.Failed && theMetaModelHasValidationInstance != null)
            {
                writer.WriteStartElement("validation");
                DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasValidationInstance.GetDomainClass().Id);
                global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasValidationInstance.GetDomainClass().Name + "!");
                relSerializer.Write(serializationContext, theMetaModelHasValidationInstance, writer);
                writer.WriteEndElement();
            }

            // MetaModelHasAdditionalInformation
            MetaModelHasAdditionalInformation theMetaModelHasAdditionalInformationInstance = MetaModelHasAdditionalInformation.GetLinkToAdditionalInformation(element);

            if (!serializationContext.Result.Failed && theMetaModelHasAdditionalInformationInstance != null)
            {
                writer.WriteStartElement("additionalInformation");
                DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasAdditionalInformationInstance.GetDomainClass().Id);
                global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasAdditionalInformationInstance.GetDomainClass().Name + "!");
                relSerializer.Write(serializationContext, theMetaModelHasAdditionalInformationInstance, writer);
                writer.WriteEndElement();
            }

            // MetaModelHasMetaModelLibraries
            global::System.Collections.ObjectModel.ReadOnlyCollection <MetaModelHasMetaModelLibraries> allMetaModelHasMetaModelLibrariesInstances = MetaModelHasMetaModelLibraries.GetLinksToMetaModelLibraries(element);
            if (!serializationContext.Result.Failed && allMetaModelHasMetaModelLibrariesInstances.Count > 0)
            {
                writer.WriteStartElement("metaModelLibraries");
                foreach (MetaModelHasMetaModelLibraries eachMetaModelHasMetaModelLibrariesInstance in allMetaModelHasMetaModelLibrariesInstances)
                {
                    if (serializationContext.Result.Failed)
                    {
                        break;
                    }

                    DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasMetaModelLibrariesInstance.GetDomainClass().Id);
                    global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachMetaModelHasMetaModelLibrariesInstance.GetDomainClass().Name + "!");
                    relSerializer.Write(serializationContext, eachMetaModelHasMetaModelLibrariesInstance, writer);
                }
                writer.WriteEndElement();
            }

            /*
             *          // MetaModelHasView
             *          MetaModelHasView theMetaModelHasViewInstance = MetaModelHasView.GetLinkToView(element);
             *          if (!serializationContext.Result.Failed && theMetaModelHasViewInstance != null)
             *          {
             *                  DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasViewInstance.GetDomainClass().Id);
             *                  global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasViewInstance.GetDomainClass().Name + "!");
             *                  relSerializer.Write(serializationContext, theMetaModelHasViewInstance, writer);
             *          }*/

            // MetaModelHasModelContexts
            global::System.Collections.ObjectModel.ReadOnlyCollection <MetaModelHasModelContexts> allMetaModelHasModelContextsInstances = MetaModelHasModelContexts.GetLinksToModelContexts(element);
            if (!serializationContext.Result.Failed && allMetaModelHasModelContextsInstances.Count > 0)
            {
                writer.WriteStartElement("modelContexts");
                foreach (MetaModelHasModelContexts eachMetaModelHasModelContextsInstance in allMetaModelHasModelContextsInstances)
                {
                    if (serializationContext.Result.Failed)
                    {
                        break;
                    }

                    DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasModelContextsInstance.GetDomainClass().Id);
                    global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachMetaModelHasModelContextsInstance.GetDomainClass().Name + "!");
                    relSerializer.Write(serializationContext, eachMetaModelHasModelContextsInstance, writer);
                }
                writer.WriteEndElement();
            }

            // MetaModelHasPropertyGridEditors
            global::System.Collections.ObjectModel.ReadOnlyCollection <MetaModelHasPropertyGridEditors> allMetaModelHasPropertyGridEditorsInstances = MetaModelHasPropertyGridEditors.GetLinksToPropertyGridEditors(element);
            if (!serializationContext.Result.Failed && allMetaModelHasPropertyGridEditorsInstances.Count > 0)
            {
                writer.WriteStartElement("propertyGridEditors");
                global::System.Type typeofMetaModelHasPropertyGridEditors = typeof(MetaModelHasPropertyGridEditors);
                foreach (MetaModelHasPropertyGridEditors eachMetaModelHasPropertyGridEditorsInstance in allMetaModelHasPropertyGridEditorsInstances)
                {
                    if (serializationContext.Result.Failed)
                    {
                        break;
                    }

                    if (eachMetaModelHasPropertyGridEditorsInstance.GetType() != typeofMetaModelHasPropertyGridEditors)
                    {                           // Derived relationships will be serialized in full-form.
                        DslModeling::DomainClassXmlSerializer derivedRelSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasPropertyGridEditorsInstance.GetDomainClass().Id);
                        global::System.Diagnostics.Debug.Assert(derivedRelSerializer != null, "Cannot find serializer for " + eachMetaModelHasPropertyGridEditorsInstance.GetDomainClass().Name + "!");
                        derivedRelSerializer.Write(serializationContext, eachMetaModelHasPropertyGridEditorsInstance, writer);
                    }
                    else
                    {                           // No need to serialize the relationship itself, just serialize the role-player directly.
                        DslModeling::ModelElement             targetElement    = eachMetaModelHasPropertyGridEditorsInstance.PropertyGridEditor;
                        DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
                        global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
                        targetSerializer.Write(serializationContext, targetElement, writer);
                    }
                }
                writer.WriteEndElement();
            }
        }
Exemple #24
0
        /// <summary>
        /// Helper method to find shapes for either end of a connector by looking for shapes associated with either end of the relationship mapped to the connector.
        /// </summary>
        private DslDiagrams::NodeShape[] GetEndShapesForConnector(DslDiagrams::BinaryLinkShape connector)
        {
            DslModeling::ElementLink link = connector.ModelElement as DslModeling::ElementLink;
            DslDiagrams::NodeShape   sourceShape = null, targetShape = null;

            if (link != null)
            {
                global::System.Collections.ObjectModel.ReadOnlyCollection <DslModeling::ModelElement> linkedElements = link.LinkedElements;
                if (linkedElements.Count == 2)
                {
                    DslDiagrams::Diagram currentDiagram = this.Diagram;
                    DslModeling::LinkedElementCollection <DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[0]);
                    foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
                    {
                        DslDiagrams::NodeShape shape = presentationElement as DslDiagrams::NodeShape;
                        if (shape != null && shape.Diagram == currentDiagram)
                        {
                            sourceShape = shape;
                            break;
                        }
                    }

                    presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[1]);
                    foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
                    {
                        DslDiagrams::NodeShape shape = presentationElement as DslDiagrams::NodeShape;
                        if (shape != null && shape.Diagram == currentDiagram)
                        {
                            targetShape = shape;
                            break;
                        }
                    }
                }
            }

            return(new DslDiagrams::NodeShape[] { sourceShape, targetShape });
        }
Exemple #25
0
        internal Call(global::Truesight.Parser.Impl.MethodBody source, global::System.IO.BinaryReader reader, global::System.Collections.ObjectModel.ReadOnlyCollection <global::Truesight.Parser.Impl.ILOp> prefixes)
            : base(source, AssertSupportedOpCode(reader), (int)reader.BaseStream.Position - global::System.Linq.Enumerable.Sum(global::System.Linq.Enumerable.Select(prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()), prefix => prefix.Size)), prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()))
        {
            // this is necessary for further verification
            var origPos = reader.BaseStream.Position;

            // initializing _methodToken
            switch ((ushort)OpSpec.OpCode.Value)
            {
            case 0x28:     //call
            case 0x6f:     //callvirt
                _methodToken = ReadMetadataToken(reader);
                break;

            case 0x29:     //calli
                _methodToken = default(int);
                break;

            default:
                throw global::XenoGears.Assertions.AssertionHelper.Fail();
            }

            // initializing _signatureToken
            switch ((ushort)OpSpec.OpCode.Value)
            {
            case 0x28:     //call
            case 0x6f:     //callvirt
                _signatureToken = default(int);
                break;

            case 0x29:     //calli
                _signatureToken = ReadMetadataToken(reader);
                break;

            default:
                throw global::XenoGears.Assertions.AssertionHelper.Fail();
            }

            // verify that we've read exactly the amount of bytes we should
            var bytesRead = reader.BaseStream.Position - origPos;

            global::XenoGears.Assertions.AssertionHelper.AssertTrue(bytesRead == SizeOfOperand);

            // now when the initialization is completed verify that we've got only prefixes we support
            global::XenoGears.Assertions.AssertionHelper.AssertAll(Prefixes, prefix =>
            {
                var constrained_ok = prefix is Constrained;
                var tail_ok        = prefix is Tail;
                return(constrained_ok || tail_ok || false);
            });
        }
Exemple #26
0
        /// <summary>
        /// Reroute a connector when the role players of its underlying relationship change
        /// </summary>
        public override void RolePlayerChanged(DslModeling::RolePlayerChangedEventArgs e)
        {
            if (e == null)
            {
                throw new global::System.ArgumentNullException("e");
            }

            global::System.Collections.ObjectModel.ReadOnlyCollection <DslDiagrams::PresentationViewsSubject> connectorLinks = DslDiagrams::PresentationViewsSubject.GetLinksToPresentation(e.ElementLink);
            foreach (DslDiagrams::PresentationViewsSubject connectorLink in connectorLinks)
            {
                // Fix up any binary link shapes attached to the element link.
                DslDiagrams::BinaryLinkShape linkShape = connectorLink.Presentation as DslDiagrams::BinaryLinkShape;
                if (linkShape != null)
                {
                    global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerDiagram diagram = linkShape.Diagram as global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerDiagram;
                    if (diagram != null)
                    {
                        if (e.NewRolePlayer != null)
                        {
                            DslDiagrams::NodeShape fromShape;
                            DslDiagrams::NodeShape toShape;
                            diagram.GetSourceAndTargetForConnector(linkShape, out fromShape, out toShape);
                            if (fromShape != null && toShape != null)
                            {
                                if (!object.Equals(fromShape, linkShape.FromShape))
                                {
                                    linkShape.FromShape = fromShape;
                                }
                                if (!object.Equals(linkShape.ToShape, toShape))
                                {
                                    linkShape.ToShape = toShape;
                                }
                            }
                            else
                            {
                                // delete the connector if we cannot find an appropriate target shape.
                                linkShape.Delete();
                            }
                        }
                        else
                        {
                            // delete the connector if the new role player is null.
                            linkShape.Delete();
                        }
                    }
                }
            }
        }
Exemple #27
0
                private static global::System.Exception _ShowEditableIssueStatusSetGrid_CanInvoke(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args, global::System.Exception ex)
                {
                    bool result = true;

                    d.Application.EditableIssueStatusSetGrid_CanRun(ref result);
                    return(result ? null : ex);
                }
Exemple #28
0
        internal Throw(global::Truesight.Parser.Impl.MethodBody source, global::System.IO.BinaryReader reader, global::System.Collections.ObjectModel.ReadOnlyCollection <global::Truesight.Parser.Impl.ILOp> prefixes)
            : base(source, AssertSupportedOpCode(reader), (int)reader.BaseStream.Position - global::System.Linq.Enumerable.Sum(global::System.Linq.Enumerable.Select(prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()), prefix => prefix.Size)), prefixes ?? global::XenoGears.Functional.EnumerableExtensions.ToReadOnly(global::System.Linq.Enumerable.Empty <global::Truesight.Parser.Impl.ILOp>()))
        {
            // this is necessary for further verification
            var origPos = reader.BaseStream.Position;

            // verify that we've read exactly the amount of bytes we should
            var bytesRead = reader.BaseStream.Position - origPos;

            global::XenoGears.Assertions.AssertionHelper.AssertTrue(bytesRead == SizeOfOperand);

            // now when the initialization is completed verify that we've got only prefixes we support
            global::XenoGears.Assertions.AssertionHelper.AssertAll(Prefixes, prefix =>
            {
                return(false);
            });
        }
Exemple #29
0
        /// <summary>
        /// Returns an enumeration of all the Types supported by a given Adapter.
        /// </summary>
        /// <param name="adapterId">Id of the adapter</param>
        /// <returns>Supported types by the Adapter</returns>
        public override global::System.Collections.Generic.IEnumerable<DslIntegration::SupportedType> GetExposedElementTypes(string adapterId)
        {
            // Do we support this type of adapter?
            if (!this.GetSupportedLogicalAdapterIds().Contains(adapterId))
            {
                return new DslIntegration::SupportedType[] { };
            }

            // Cache management
            if (exposedElementTypes == null)
            {
                global::System.Collections.Generic.List<DslIntegration::SupportedType> types = new global::System.Collections.Generic.List<DslIntegration::SupportedType>();
                types.Add(
                    new DslIntegration::SupportedType(typeof(SubProcess), "SubProcess"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(WorkflowRule), "WorkflowRule"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(CloudcoreUser), "CloudcoreUser"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(DatabaseEvent), "DatabaseEvent"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(Stop), "Stop"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(DatabasePark), "DatabasePark"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(ToProcessConnector), "ToProcessConnector"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(FromProcessConnector), "FromProcessConnector"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(CloudCustom), "CloudCustom"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(PostageApp), "PostageApp"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(Clickatell), "Clickatell"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(DatabaseCosting), "DatabaseCosting"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(CloudCosting), "CloudCosting"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(DatabaseBatchStart), "DatabaseBatchStart"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(CloudBatchStart), "CloudBatchStart"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(CloudBatchWait), "CloudBatchWait"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(CloudPark), "CloudPark"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(Corticon), "Corticon"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(CustomUser), "CustomUser"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(DatabaseBatchWait), "DatabaseBatchWait"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(Email), "Email"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(MobileActivity), "MobileActivity"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(HybridActivity), "HybridActivity"));
                types.Add(
                    new DslIntegration::SupportedType(typeof(UserActivity), "UserActivity"));
                 exposedElementTypes = types.AsReadOnly();
           }

            return exposedElementTypes;
        }
Exemple #30
0
                private static void _ShowWorkItemsListDetail_InvokeMethod(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args)
                {
                    bool handled = false;

                    d.Application.WorkItemsListDetail_Run(ref handled);
                    if (!handled)
                    {
                        d.ShowScreen("LightSwitchApplication:WorkItemsListDetail", () => global::LightSwitchApplication.WorkItemsListDetail.CreateInstance(), args);
                    }
                }
Exemple #31
0
        /// <summary>
        /// Called to initialize the view after the corresponding document has been loaded.
        /// </summary>
        protected override bool LoadView()
        {
            base.LoadView();

            ReadOnlyCollection <DataLayer> models = this.DocData.Store.ElementDirectory.FindElements <global::DSLFactory.Candle.SystemModel.DataLayer>();

            if (models.Count == 0)
            {
                return(false);
            }

            DataLayer model = models[0];

            global::System.Diagnostics.Debug.Assert(this.DocData.RootElement != null);
            if (this.DocData.RootElement == null)
            {
                return(false);
            }

            // Penser à rajouter le diagramme dans GetCustomDomainModelTypes de SystemModel
            global::System.Collections.ObjectModel.ReadOnlyCollection <global::DSLFactory.Candle.SystemModel.DataLayerDiagram> diagrams = this.DocData.Store.ElementDirectory.FindElements <global::DSLFactory.Candle.SystemModel.DataLayerDiagram>();
            if (diagrams.Count > 0)
            {
                //global::System.Diagnostics.Debug.Assert( diagrams.Count == 1, "Found more than one diagram, using the first one found." );
                this.Diagram = (DslDiagrams::Diagram)diagrams[0];
            }
            else
            {
                // Sinon on le crée
                DataLayerDiagram diagram;
                using (Transaction transaction = this.DocData.Store.TransactionManager.BeginTransaction("Load models view"))
                {
                    diagram = new DataLayerDiagram(DocData.Store);
                    diagram.Associate(model);
                    transaction.Commit();
                }

                if (diagram != null)
                {
                    base.Diagram = diagram;
                }
            }
            SynchronizeDiagram(model);

            return(base.Diagram != null);
        }
Exemple #32
0
        /// <summary>
        /// Called to initialize the view after the corresponding document has been loaded.
        /// </summary>
        protected override bool LoadView()
        {
            base.LoadView();

            global::System.Diagnostics.Debug.Assert(this.DocData.RootElement != null);
            if (this.DocData.RootElement == null)
            {
                return(false);
            }


            // The diagram should exist in the diagram partition by now, just need to find it and connect it to this view.
            EFModelDocDataBase docData = this.DocData as EFModelDocDataBase;

            global::System.Diagnostics.Debug.Assert(docData != null, "DocData for EFModelDocViewBase should be an EFModelDocDataBase!");
            var l_diagramName = string.IsNullOrEmpty(this.diagramName) ? global::System.IO.Path.GetFileNameWithoutExtension(docData.FileName) : this.diagramName;
            DslModeling::Partition diagramPartition = docData.GetDiagramPartition();

            if (diagramPartition != null)
            {
                global::System.Collections.ObjectModel.ReadOnlyCollection <global::Sawczyn.EFDesigner.EFModel.EFModelDiagram> diagrams = docData.GetDiagramPartition().ElementDirectory.FindElements <global::Sawczyn.EFDesigner.EFModel.EFModelDiagram>();
                if (diagrams.Count > 0)
                {
                    var l_diagram = diagrams.FirstOrDefault(diagram => diagram.Name.Equals(l_diagramName, global::System.StringComparison.Ordinal));
                    if (null == l_diagram && !string.IsNullOrEmpty(this.diagramName))
                    {
                        return(false);
                    }
                    this.Diagram = l_diagram ?? diagrams[0];
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }


            return(true);
        }
Exemple #33
0
        /// <summary>
        /// Get the modelbus refrences of all the model elements of a given Type
        /// </summary>
        /// <param name="dataContract">Type of interest</param>
        /// <returns>Collection of modelbus refrences on all the instances of this type</returns>
        protected override global::System.Collections.Generic.IEnumerable <DslIntegration::ModelBusReference> GetElementReferences(global::System.Type dataContract)
        {
            if (dataContract == null)
            {
                throw new global::System.ArgumentNullException("dataContract");
            }

            global::System.Collections.ObjectModel.ReadOnlyCollection <DslModeling::ModelElement> mels = null;
            if (ModelRoot != null)
            {
                DslModeling::Store store = ModelRoot.Store;
                mels = this.ModelRoot.Store.ElementDirectory.FindElements(this.ModelRoot.Store.DomainDataDirectory.GetDomainClass(dataContract), true);
                if (mels != null)
                {
                    foreach (DslModeling::ModelElement mel in mels)
                    {
                        yield return(this.GetElementReference(mel));
                    }
                }
            }
        }
                private static void _ShowStartup_InvokeMethod(global::LightSwitchApplication.Application.DetailsClass d, global::System.Collections.ObjectModel.ReadOnlyCollection <object> args)
                {
                    bool handled = false;

                    d.Application.Startup_Run(ref handled);
                    if (!handled)
                    {
                        d.ShowScreen("LightSwitchApplication.HelpDeskCS.DesktopClient:Startup", () => global::LightSwitchApplication.Startup.CreateInstance(), args);
                    }
                }
        /// <summary>
        /// Returns an enumeration of all the Types supported by a given Adapter.
        /// </summary>
        /// <param name="adapterId">Id of the adapter</param>
        /// <returns>Supported types by the Adapter</returns>
        public override global::System.Collections.Generic.IEnumerable<DslIntegration::SupportedType> GetExposedElementTypes(string adapterId)
		{
            // Do we support this type of adapter?
            if (!this.GetSupportedLogicalAdapterIds().Contains(adapterId))
			{
                return new DslIntegration::SupportedType[] { };
			}

            // Cache management
            if (exposedElementTypes == null)
            {
				global::System.Collections.Generic.List<DslIntegration::SupportedType> types = new global::System.Collections.Generic.List<DslIntegration::SupportedType>();
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(ServiceContractModel), "ServiceContractModel"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(ServiceContract), "ServiceContract"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(Operation), "Operation"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(Service), "Service"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(Message), "Message"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractMessagePart), "DataContractMessagePart"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(PrimitiveMessagePart), "PrimitiveMessagePart"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(XsdMessage), "XsdMessage"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(DataContractFault), "DataContractFault"));
			
                types.Add(
                    new DslIntegration::SupportedType(typeof(XsdElementFault), "XsdElementFault"));
 				exposedElementTypes = types.AsReadOnly();
           }

            return exposedElementTypes;
        }