Beispiel #1
0
        private static ServiceElement CreateEnglishUtf8PrimaryLanguageServiceElement()
        {
            ServiceElement englishUtf8PrimaryLanguage = LanguageBaseItem.CreateElementSequenceFromList(
                new LanguageBaseItem[] { LanguageBaseItem.CreateEnglishUtf8PrimaryLanguageItem() });

            return(englishUtf8PrimaryLanguage);
        }
Beispiel #2
0
        private static ServiceElement CreateEnglishUtf8PrimaryLanguageServiceElement()
        {
            ServiceElement englishUtf8PrimaryLanguage = LanguageBaseItem.CreateElementSequenceFromList(
                new LanguageBaseItem[] {
                new LanguageBaseItem("en", LanguageBaseItem.Utf8EncodingId, LanguageBaseItem.PrimaryLanguageBaseAttributeId)
            });

            return(englishUtf8PrimaryLanguage);
        }
Beispiel #3
0
        public ServiceRecord CreatePalmOsOppCompleteRecord()
        {
            List_ServiceAttribute attrs = new List_ServiceAttribute();
            ServiceElement        element;
            List_ServiceElement   list;

            //
            attrs.Add(new ServiceAttribute(UniversalAttributeId.ServiceRecordHandle,
                                           new ServiceElement(ElementType.UInt32, (UInt32)0x10001)));
            //
            element = new ServiceElement(ElementType.Uuid16, (UInt16)0x1105);
            list    = new List_ServiceElement();
            list.Add(element);
            element = new ServiceElement(ElementType.ElementSequence, list);
            attrs.Add(new ServiceAttribute(UniversalAttributeId.ServiceClassIdList, element));
            //
            element = ServiceRecordHelper.CreateGoepProtocolDescriptorList();
            attrs.Add(new ServiceAttribute(UniversalAttributeId.ProtocolDescriptorList, element));
            //
            const UInt16 Windows1252EncodingId = 2252;

            LanguageBaseItem[] languages =
            {
                new LanguageBaseItem("en", Windows1252EncodingId, LanguageBaseItem.PrimaryLanguageBaseAttributeId)
            };
            element = LanguageBaseItem.CreateElementSequenceFromList(languages);
            attrs.Add(new ServiceAttribute(UniversalAttributeId.LanguageBaseAttributeIdList, element));
            //
            // PalmOs really uses Windows-1252, but since the string is ASCII, UTF-8 is equivalent.
            element = new ServiceElement(ElementType.TextString, "OBEX Object Push");
            attrs.Add(new ServiceAttribute(
                          ServiceRecord.CreateLanguageBasedAttributeId(UniversalAttributeId.ServiceName,
                                                                       LanguageBaseItem.PrimaryLanguageBaseAttributeId),
                          element));
            //
            list = new List_ServiceElement();
            list.Add(new ServiceElement(ElementType.UInt8, (byte)0x1));
            list.Add(new ServiceElement(ElementType.UInt8, (byte)0x2));
            list.Add(new ServiceElement(ElementType.UInt8, (byte)0x3));
            list.Add(new ServiceElement(ElementType.UInt8, (byte)0xFF));
            element = new ServiceElement(ElementType.ElementSequence, list);
            attrs.Add(new ServiceAttribute(ObexAttributeId.SupportedFormatsList, element));
            //
            ServiceRecord record = new ServiceRecord(attrs);

            return(record);
        }