ДокументСсылка (DocumentRef)
Inheritance: BaseDocumentProperties, IObjectRef
Ejemplo n.º 1
0
 /// <summary>
 /// УстановитьСсылкуНового (SetNewObjectRef)
 /// </summary>
 /// <param name="docRef"></param>
 public void SetNewObjectRef(DocumentRef docRef)
 {
     InvokeV8Method("SetNewObjectRef", docRef.Ptr);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// УстановитьСсылкуНового (SetNewObjectRef)
 /// </summary>
 /// <param name="docRef"></param>
 public void SetNewObjectRef(DocumentRef docRef)
 {
     InvokeV8Method("SetNewObjectRef", docRef.Ptr);
 }
Ejemplo n.º 3
0
        internal bool TryParseValueFromV8Xml(Session session, string strValue, out object value)
        {
            value = null;

            switch (Type)
            {
                case TypeEnum.Boolean:
                    {
                        bool bv;
                        if (bool.TryParse(strValue, out bv))
                        {
                            value = bv;
                            return true;
                        }
                    }
                    break;
                case TypeEnum.Date:
                    {
                        DateTime dt;
                        if (DateTime.TryParse(strValue, out dt))
                        {
                            value = dt;
                            return true;
                        }
                    }
                    break;
                case TypeEnum.String:
                    value = strValue;
                    return true;

                case TypeEnum.Decimal:
                    {
                        decimal dc;
                        if (decimal.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out dc))
                        {
                            value = dc;
                            return true;
                        }
                    }
                    break;

                case TypeEnum.CatalogRef:
                    {
                        if (string.IsNullOrEmpty(strValue))
                        {
                            value = null;
                            return true;
                        }

                        value = new CatalogRef(session, ReferenceTypeName, strValue);
                    }
                    return true;
                case TypeEnum.DocumentRef:
                    {
                        if (string.IsNullOrEmpty(strValue))
                        {
                            value = null;
                            return true;
                        }

                        value = new DocumentRef(session, ReferenceTypeName, strValue);
                    }
                    return true;
                case TypeEnum.EnumRef:
                    {
                        if (string.IsNullOrEmpty(strValue))
                        {
                            value = null;
                            return true;
                        }

                        value = new EnumRef(session, ReferenceTypeName, strValue);
                    }
                    return true;
            }
            
            return false;
        }
Ejemplo n.º 4
0
        internal bool TryParseValueFromV8Xml(Session session, string strValue, out object value)
        {
            value = null;

            switch (Type)
            {
            case TypeEnum.Boolean:
            {
                bool bv;
                if (bool.TryParse(strValue, out bv))
                {
                    value = bv;
                    return(true);
                }
            }
            break;

            case TypeEnum.Date:
            {
                DateTime dt;
                if (DateTime.TryParse(strValue, out dt))
                {
                    value = dt;
                    return(true);
                }
            }
            break;

            case TypeEnum.String:
                value = strValue;
                return(true);

            case TypeEnum.Decimal:
            {
                decimal dc;
                if (decimal.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out dc))
                {
                    value = dc;
                    return(true);
                }
            }
            break;

            case TypeEnum.CatalogRef:
            {
                if (string.IsNullOrEmpty(strValue))
                {
                    value = null;
                    return(true);
                }

                value = new CatalogRef(session, ReferenceTypeName, strValue);
            }
                return(true);

            case TypeEnum.DocumentRef:
            {
                if (string.IsNullOrEmpty(strValue))
                {
                    value = null;
                    return(true);
                }

                value = new DocumentRef(session, ReferenceTypeName, strValue);
            }
                return(true);

            case TypeEnum.EnumRef:
            {
                if (string.IsNullOrEmpty(strValue))
                {
                    value = null;
                    return(true);
                }

                value = new EnumRef(session, ReferenceTypeName, strValue);
            }
                return(true);
            }

            return(false);
        }