Сессия 1C:Предприятие. Глобальный контекст (Session)
Inheritance: BaseObject
        internal EnumRef(Session session, string enumName, string valueName)
            : base(session, null)
        {
            _enumName = enumName;

            ValueName = valueName;
        }
        public XMLWriter(Session session)
            : base(session, null)
        {
            var ptr = session.NewObject("XMLWriter");

            Ptr = ptr;
        }
 internal BaseDocumentProperties(
     Session session, 
     string documentName,
     object ptr
     )
     : base(session, documentName ,ptr)
 {}
 internal CatalogObject(
     Session session,
     string catalogName,
     object ptr)
     : base(session, catalogName, ptr)
 {
 }
 internal BaseCatalogProperties(
     Session session, 
     string catalogName,
     object ptr
     )
     : base(session, catalogName, ptr)
 {
 }
 internal BaseObjectProperties(
     Session session, 
     string objectTypeName,
     object ptr)
     : base(session, ptr)
 {
     _objectTypeName = objectTypeName;
 }
 internal DocumentObject(
     Session session, 
     string documentName,
     object ptr
     )
     : base(session, documentName, ptr)
 {
 }
 internal DocumentRef(
     Session session,
     string documentName,
     string uuidStr
     )
     : base(session, documentName, null)
 {
     _uuidStr = uuidStr;
 }
 internal CatalogRef(
     Session session,
     string catalogName,
     string uuidStr
     )
     : base(session, catalogName, null)
 {
     _uuidStr = uuidStr;
 }
 internal CatalogRef(
     Session session, 
     string catalogName,
     object ptr
     )
     : base(session, catalogName, ptr)
 {
     _uuidStr = null;
 }
 internal DocumentRef(
     Session session,
     string documentName,
     object ptr
     )
     : base(session, documentName, ptr)
 {
     _uuidStr = null;
 }
        internal BaseSessionObject(Session session, object ptr)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            _session = session;

            if (ptr != null)
            {
                Ptr = ptr;
            }
        }
        /// <summary>
        /// Create
        /// </summary>
        /// <param name="session"></param>
        /// <param name="ptr"></param>
        /// <returns></returns>
        internal static MetadataObject Create(Session session, object ptr)
        {
            string fullName = GetV8Property(ptr, FullNameProperty) as string;

            MetadataObject meta;

            if (fullName.StartsWith(RussianConsts.Catalog))
            {
                meta = new MetadataObject(session, MetadataType.Catalog, ptr);
            }
            else if (fullName.StartsWith(RussianConsts.Document))
            {
                meta = new DocumentMetadata(session, ptr);
            }
            else
            {
                meta = new MetadataObject(session, MetadataType.Unknown, ptr);
            }

            meta.PutToCache(FullNameProperty, fullName);
            
            return meta;
        }
 internal MetadataObject(Session session, MetadataType metadataType, object ptr)
     : base(session, metadataType, ptr)
 { }
 internal CalculationRegisterMetadata(Session session, object ptr)
     :base(session, MetadataType.CalculationRegister,  ptr)
 {
 }
 internal Structure(Session session, object ptr)
     : base(session, ptr)
 {
 }
 internal NumberQualifiers(Session session, object ptr)
     : base(session, ptr)
 {
 }
 internal bool TryParseValueFromV8String(Session session, string strValue, out object value)
 {
     return TryParseValueFromV8String(session, LexemV8Parser.Parse(strValue), out value);
 }
 internal AccountingRegisterManager(Session session, object ptr)
     : base(session, ptr)
 {
 }
 internal DataExchangeParameters(Session session, object ptr)
     : base(session, ptr)
 {
 }
 internal DocumentMetadata(Session session, object ptr)
     : base(session, MetadataType.Document, ptr)
 {}
Exemple #22
0
 internal UUID(Session session, object ptr)
     : base(session, ptr)
 {
     _uuidStr = null;
 }
 internal QueryResultSelection(Session session, object ptr)
     :base(session, ptr)
 {
 }
        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;
        }
 internal StringQualifiers(Session session, object ptr)
     : base(session, ptr)
 {
 }
        internal bool TryParseValueFromV8String(Session session, LexemV8 lexem, out object value)
        {
            value = null;
            if (!IsPrimitiveType
                || lexem == null
                || lexem.LexemType != LexemV8Type.Brace
                || lexem.ChildLexemList == null
                || lexem.ChildLexemList.Count != 2)
            {
                return false;
            }
            string dataValue = lexem.ChildLexemList[1].Data.Trim();

            switch (Type)
            {
                case TypeEnum.Boolean:
                    value = !(dataValue == "0");
                    return true;
                case TypeEnum.Date:
                    DateTime dt;
                    if (DateTime.TryParseExact(dataValue, "yyyyMMddHHmmss", CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dt))
                    {
                        value = dt;
                        return true;
                    }
                    break;
                case TypeEnum.String:
                    if (dataValue.StartsWith("\""))
                    {
                        dataValue = dataValue.Remove(0, 1);
                    }
                    if (dataValue.EndsWith("\""))
                    {
                        dataValue = dataValue.Remove(dataValue.Length-1, 1);
                    }
                    value = dataValue;
                    return true;
                case TypeEnum.Decimal:
                    decimal dc;
                    if (decimal.TryParse(dataValue, NumberStyles.Number, CultureInfo.InvariantCulture, out dc))
                    {
                        value = dc;
                        return true;
                    }
                    break;
            }
            return false;
        }
Exemple #27
0
 internal UUID(Session session, string uuidStr)
     : base(session, null)
 {
     _uuidStr = uuidStr;
 }
 internal QueryParameterDescription(Session session, object ptr)
     : base(session, ptr)
 {
 }
 internal CalculationRegisterManager(Session session, object ptr)
     : base(session, ptr)
 {
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="session"></param>
 public Structure(Session session) :
     base(session, session.NewObject("Structure"))
 {
 }
Exemple #31
0
 protected override void OnPtrRequired()
 {
     Ptr = Session.NewObject("UUID", _uuidStr);
 }
 internal CalculationRegisterSelection(Session session, object ptr)
     : base(session, ptr)
 {
 }
 internal ExchangePlanRef(Session session, object ptr)
     : base(session, ptr)
 {
 }