public ClearingSystemIdentification2Choice(
     string clearingSystemIdentification,
     ItemChoiceType codedOrPropietary)
 {
     this.itemField = clearingSystemIdentification;
     this.itemElementNameField = codedOrPropietary;
 }
Example #2
0
 public static OpenDataType_Type Serialize(object value, out ItemChoiceType choiceType)
 {
     Type valueType = value.GetType();
      if (valueType == typeof(TabularType))
      {
     choiceType = ItemChoiceType.TabularDataType;
     return new TabularDataType_Type((TabularType) value);
      }
      if (valueType == typeof(CompositeType))
      {
     choiceType = ItemChoiceType.CompositeDataType;
     return new CompositeDataType_Type((CompositeType)value);
      }
      if (valueType == typeof(ArrayType))
      {
     choiceType = ItemChoiceType.ArrayDataType;
     return new ArrayDataType_Type((ArrayType)value);
      }
      if (valueType == typeof(SimpleType))
      {
     choiceType = ItemChoiceType.SimpleDataType;
     return new OpenDataType_Type((SimpleType) value);
      }
      throw new NotSupportedException("Not supported open type: "+valueType);
 }
 public AccountSchemeName1Choice(
     string accountSchemeName,
     ItemChoiceType codedOrPropietary)
 {
     this.itemField = accountSchemeName;
     this.itemElementNameField = codedOrPropietary;
 }
Example #4
0
        public static OpenDataType_Type Serialize(object value, out ItemChoiceType choiceType)
        {
            Type valueType = value.GetType();

            if (valueType == typeof(TabularType))
            {
                choiceType = ItemChoiceType.TabularDataType;
                return(new TabularDataType_Type((TabularType)value));
            }
            if (valueType == typeof(CompositeType))
            {
                choiceType = ItemChoiceType.CompositeDataType;
                return(new CompositeDataType_Type((CompositeType)value));
            }
            if (valueType == typeof(ArrayType))
            {
                choiceType = ItemChoiceType.ArrayDataType;
                return(new ArrayDataType_Type((ArrayType)value));
            }
            if (valueType == typeof(SimpleType))
            {
                choiceType = ItemChoiceType.SimpleDataType;
                return(new OpenDataType_Type((SimpleType)value));
            }
            throw new NotSupportedException("Not supported open type: " + valueType);
        }
 public ServiceLevel8Choice(
     string serviceLevel,
     ItemChoiceType codedOrPropietary)
 {
     this.itemField = serviceLevel;
     this.itemElementNameField = codedOrPropietary;
 }
 public LocalInstrument2Choice(
     string localInstrument,
     ItemChoiceType codeOrPropietary)
 {
     this.itemField = localInstrument;
     this.itemElementNameField = codeOrPropietary;
 }
 public CategoryPurpose1Choice(
     string categoryPurpose,
     ItemChoiceType codedOrPropietary)
 {
     this.itemField = categoryPurpose;
     this.itemElementNameField = codedOrPropietary;
 }
Example #8
0
        static void FindLeiInfo(ItemChoiceType itemElementName, string item)
        {
            using (var svc = new getLeiCodeInfo_pttClient())
            {
                var tp = itemElementName == ItemChoiceType.cmp_name ? "имени организации" :
                         (itemElementName == ItemChoiceType.lei      ? "коду LEI" :
                          (itemElementName == ItemChoiceType.reg_num  ? "рег.номеру" : ""));

                Console.WriteLine($"Поиск информации по {tp} \"{item}\"");
                var resp = svc.getLeiCodeInfo(new GetLeiCodeInfoRequest
                {
                    ItemElementName = itemElementName,
                    Item            = item
                });

                Console.WriteLine($"Найдено: {resp.LEIData.LEIHeader.RecordCount}");

                if (int.Parse(resp.LEIData.LEIHeader.RecordCount) > 0)
                {
                    var LEIRecord = resp.LEIData.LEIRecords.LEIRecord[0];

                    Console.WriteLine($"Наименование: {LEIRecord.Entity.LegalName.Value}");
                    Console.WriteLine($"ОГРН: {LEIRecord.Entity.RegistrationAuthority.RegistrationAuthorityEntityID}");
                    Console.WriteLine($"LEI: {LEIRecord.LEI} ({LEIRecord.Registration.RegistrationStatus})");
                    Console.WriteLine($"Страна: {LEIRecord.Entity.LegalJurisdiction}");
                    Console.WriteLine($"Адрес: {LEIRecord.Entity.LegalAddress.MailRouting}");
                }
            }
            Console.WriteLine();
            Console.ReadKey();
            Console.WriteLine();
        }
 public FinancialIdentificationSchemeName1Choice(
     string financialIdentificationSchemeName,
     ItemChoiceType codedOrPropietary)
 {
     this.itemField = financialIdentificationSchemeName;
     this.itemElementNameField = codedOrPropietary;
 }
Example #10
0
        public static Response CreateResponse(ItemChoiceType itemChoiceType, object item)
        {
            var response = DefaultResponse;

            response.ItemElementName = itemChoiceType;
            response.Item            = item;

            return(response);
        }
 private static AttributeValueType GetDateValueType(JProperty property, ItemChoiceType type)
 {
     var result = new AttributeValueType();
     if (property.Value.Type == JTokenType.Null)
         result.Item = null;
     else
         result.Item = property.Value.Value<DateTime>();
     result.ItemElementName = type;
     return result;
 }
Example #12
0
        public void Clone_Valid_CorrectType(
            [Values(ItemChoiceType.URNIdentifikator, ItemChoiceType.UUID)] ItemChoiceType type)
        {
            var unikId = new UnikIdType()
            {
                ItemElementName = type
            };
            var result = UnikIdType.Clone(unikId);

            Assert.AreEqual(type, result.ItemElementName);
        }
Example #13
0
        public void Clone_Valid_CorrectType(
            [Values(ItemChoiceType.URNIdentifikator, ItemChoiceType.UUID)] ItemChoiceType type,
            [Values("fjkjhfjkh", "uiyyuyui")] string value)
        {
            var unikId = new UnikIdType()
            {
                ItemElementName = type, Item = value
            };
            var result = UnikIdType.Clone(unikId);

            Assert.AreEqual(value, result.Item);
        }
Example #14
0
 public XmlSerializerAttributes()
 {
     XmlElementProperty               = 1;
     XmlAttributeProperty             = 2;
     XmlArrayProperty                 = new string[] { "one", "two", "three" };
     EnumType                         = ItemChoiceType.Word;
     MyChoice                         = "String choice value";
     XmlIncludeProperty               = ItemChoiceType.DecimalNumber;
     XmlEnumProperty                  = new ItemChoiceType[] { ItemChoiceType.DecimalNumber, ItemChoiceType.Number, ItemChoiceType.Word, ItemChoiceType.None };
     XmlTextProperty                  = "<xml>Hello XML</xml>";
     XmlNamespaceDeclarationsProperty = "XmlNamespaceDeclarationsPropertyValue";
 }
 private static AttributeValueType GetValueType(JProperty property, ItemChoiceType type, object item, JsonSerializer serializer)
 {
     var result = new AttributeValueType();
     if (property.Value.Type == JTokenType.Null)
         result.Item = null;
     else
     {
         serializer.Populate(property.Value.CreateReader(), item);
         result.Item = item;
     }
     result.ItemElementName = type;
     return result;
 }
Example #16
0
        private static AttributeValueType GetDateValueType(JProperty property, ItemChoiceType type)
        {
            var result = new AttributeValueType();

            if (property.Value.Type == JTokenType.Null)
            {
                result.Item = null;
            }
            else
            {
                result.Item = property.Value.Value <DateTime>();
            }
            result.ItemElementName = type;
            return(result);
        }
Example #17
0
        public SerializableDictionary <string, string> Validate(tUserData userData)
        {
            var validationErrors = new SerializableDictionary <string, string>();

            if (userData == null)
            {
                validationErrors.Add(LambdaHelper <tUserData> .GetPropertyName(x => x), "UserData is a mandatory field.");
            }
            else
            {
                if (userData.ShData == null)
                {
                    validationErrors.Add(LambdaHelper <tShData> .GetPropertyName(x => x), "ShData is a mandatory field.");
                }
                else
                {
                    if (userData.ShData.RepositoryData == null)
                    {
                        validationErrors.Add(LambdaHelper <tTransparentData> .GetPropertyName(x => x), "RepositoryData is a mandatory field.");
                    }
                    else
                    {
                        if (string.IsNullOrWhiteSpace(userData.ShData.RepositoryData.ServiceIndication))
                        {
                            validationErrors.Add("ServiceIndication", "ServiceIndication is a mandatory field.");
                        }

                        if (userData.ShData.RepositoryData.ServiceData == null)
                        {
                            ItemChoiceType gggg = userData.ShData.RepositoryData.ServiceData.Item.ItemElementName;
                            validationErrors.Add(LambdaHelper <tServiceData> .GetPropertyName(x => x), "ServiceData is a mandatory field.");
                        }
                        else
                        {
                            if (userData.ShData.RepositoryData.ServiceData.Item == null)
                            {
                                validationErrors.Add(LambdaHelper <tMetaSwitchData> .GetPropertyName(x => x), "MetaSwitchData is a mandatory field.");
                            }
                            else
                            {
                            }
                        }
                    }
                }
            }

            return(validationErrors);
        }
Example #18
0
        private static AttributeValueType GetValueType(JProperty property, ItemChoiceType type, object item, JsonSerializer serializer)
        {
            var result = new AttributeValueType();

            if (property.Value.Type == JTokenType.Null)
            {
                result.Item = null;
            }
            else
            {
                serializer.Populate(property.Value.CreateReader(), item);
                result.Item = item;
            }
            result.ItemElementName = type;
            return(result);
        }
 public PersonIdentificationSchemeName1Choice(string identificationSchemeName, ItemChoiceType codedOrPropietary)
 {
     this.itemField = identificationSchemeName;
     this.itemElementNameField = codedOrPropietary;
 }
 public Purpose2Choice(string purpose, ItemChoiceType codedOrPropietary)
 {
     this.itemField = purpose;
     this.itemElementNameField = codedOrPropietary;
 }
Example #21
0
        private scormenginewsproto.ws020110.SetValueRequestType CreateSetValueRequest_020110(ItemChoiceType dataModelElement, object value, Form1 frm)
        {
            SetValueRequestType setRequest1 = new SetValueRequestType();

            setRequest1.RequestID = frm.GetNextRequestId();

            setRequest1.cmiDataModelElement = new cmiDataModelElement();

            setRequest1.cmiDataModelElement.ItemElementName = dataModelElement;
            setRequest1.cmiDataModelElement.Item            = value;

            return(setRequest1);
        }
Example #22
0
 public GenericValueType(object value)
 {
     if (value == null)
     {
         Item            = new NullType();
         ItemElementName = ItemChoiceType.Null;
     }
     else
     {
         Type valueType = value.GetType();
         if (valueType == typeof(byte[]))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Base64Binary;
         }
         else if (valueType == typeof(bool))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Boolean;
         }
         else if (valueType == typeof(sbyte))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Byte;
         }
         else if (valueType == typeof(ushort))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Character;
         }
         else if (valueType == typeof(DateTime))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.DateTime;
         }
         else if (valueType == typeof(float))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Float;
         }
         else if (valueType == typeof(decimal))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Decimal;
         }
         else if (valueType == typeof(double))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Double;
         }
         else if (valueType == typeof(int))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Int;
         }
         else if (valueType == typeof(long))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Long;
         }
         else if (valueType == typeof(short))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.Short;
         }
         else if (valueType == typeof(string))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.String;
         }
         else if (valueType == typeof(Uri))
         {
             Item            = value.ToString();
             ItemElementName = ItemChoiceType.URI;
         }
         else if (valueType == typeof(Guid))
         {
             Item            = value.ToString();
             ItemElementName = ItemChoiceType.UUID;
         }
         else if (valueType == typeof(TimeSpan))
         {
             Item            = value.ToString();
             ItemElementName = ItemChoiceType.Duration;
         }
         else if (valueType.GetInterface("IDictionary`2") != null)
         {
             Item            = new TypedMapType((IDictionary)value);
             ItemElementName = ItemChoiceType.TypedMap;
         }
         else if (typeof(IDictionary).IsAssignableFrom(valueType))
         {
             Item            = new MapType((IDictionary)value);
             ItemElementName = ItemChoiceType.Map;
         }
         else if (valueType.GetInterface("ICollection`1") != null)
         {
             Item            = new TypedMultipleValueType((ICollection)value);
             ItemElementName = ItemChoiceType.TypedList;
         }
         else if (typeof(ICollection).IsAssignableFrom(valueType))
         {
             Item            = new MultipleValueType((ICollection)value);
             ItemElementName = ItemChoiceType.List;
         }
         else if (valueType == typeof(XmlQualifiedName))
         {
             Item            = value;
             ItemElementName = ItemChoiceType.QName;
         }
         else if (valueType == typeof(ObjectName))
         {
             Item            = ObjectNameSelector.CreateEndpointAddress((ObjectName)value);
             ItemElementName = ItemChoiceType.EndpointReference;
         }
         else if (valueType == typeof(RoleInfo))
         {
             Item            = new ManagedResourceRoleInfo((RoleInfo)value);
             ItemElementName = ItemChoiceType.ManagedResourceRoleInfo;
         }
         else if (valueType == typeof(RoleResult))
         {
             Item            = new ManagedResourceRoleResult((RoleResult)value);
             ItemElementName = ItemChoiceType.ManagedResourceRoleResult;
         }
         else if (typeof(ITabularData).IsAssignableFrom(valueType))
         {
             Item            = new TabularDataValueType((ITabularData)value);
             ItemElementName = ItemChoiceType.TabularDataValue;
         }
         else if (typeof(ICompositeData).IsAssignableFrom(valueType))
         {
             Item            = new CompositeDataValueType((ICompositeData)value);
             ItemElementName = ItemChoiceType.CompositeDataValue;
         }
         else if (typeof(OpenType).IsAssignableFrom(valueType))
         {
             Item = OpenDataType_Type.Serialize(value, out itemElementNameField);
         }
         else
         {
             throw new NotSupportedException("Not supported type in serialization: " + valueType);
         }
     }
 }
        private scormenginewsproto.ws020110.SetValueRequestType CreateSetValueRequest_020110(ItemChoiceType dataModelElement, object value, Form1 frm)
        {
            SetValueRequestType setRequest1 = new SetValueRequestType();
            setRequest1.RequestID = frm.GetNextRequestId();

            setRequest1.cmiDataModelElement = new cmiDataModelElement();

            setRequest1.cmiDataModelElement.ItemElementName = dataModelElement;
            setRequest1.cmiDataModelElement.Item = value;

            return setRequest1;
        }