• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PropertySet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PropertySet的典型用法代码示例。如果您正苦于以下问题:C# PropertySet类的具体用法?C# PropertySet怎么用?C# PropertySet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PropertySet类属于命名空间,在下文中一共展示了PropertySet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CheckMail

        public void CheckMail()
        {
            try
            {
                string processLoc = dataActionsObject.getProcessingFolderLocation();
                StreamWriter st = new StreamWriter("C:\\Test\\_testings.txt");
                string emailId = "[email protected]";// ConfigurationManager.AppSettings["UserName"].ToString();
                if (emailId != string.Empty)
                {
                    st.WriteLine(DateTime.Now + " " + emailId);
                    st.Close();
                    ExchangeService service = new ExchangeService();
                    service.Credentials = new WebCredentials(emailId, "Sea2013");
                    service.UseDefaultCredentials = false;
                    service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
                    Folder inbox = Folder.Bind(service, WellKnownFolderName.Inbox);
                    SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));
                    if (inbox.UnreadCount > 0)
                    {
                        ItemView view = new ItemView(inbox.UnreadCount);
                        FindItemsResults<Item> findResults = inbox.FindItems(sf, view);
                        PropertySet itempropertyset = new PropertySet(BasePropertySet.FirstClassProperties, EmailMessageSchema.From, EmailMessageSchema.ToRecipients);
                        itempropertyset.RequestedBodyType = BodyType.Text;
                        //inbox.UnreadCount
                        ServiceResponseCollection<GetItemResponse> items = service.BindToItems(findResults.Select(item => item.Id), itempropertyset);
                        MailItem[] msit = getMailItem(items, service);

                        foreach (MailItem item in msit)
                        {
                            item.message.IsRead = true;
                            item.message.Update(ConflictResolutionMode.AlwaysOverwrite);
                            foreach (Attachment attachment in item.attachment)
                            {
                                if (attachment is FileAttachment)
                                {
                                    string extName = attachment.Name.Substring(attachment.Name.LastIndexOf('.'));
                                    FileAttachment fileAttachment = attachment as FileAttachment;
                                    FileStream theStream = new FileStream(processLoc + fileAttachment.Name, FileMode.OpenOrCreate, FileAccess.ReadWrite);
                                    fileAttachment.Load(theStream);
                                    byte[] fileContents;
                                    MemoryStream memStream = new MemoryStream();
                                    theStream.CopyTo(memStream);
                                    fileContents = memStream.GetBuffer();
                                    theStream.Close();
                                    theStream.Dispose();
                                    Console.WriteLine("Attachment name: " + fileAttachment.Name + fileAttachment.Content + fileAttachment.ContentType + fileAttachment.Size);
                                }
                            }
                        }
                    }
                    DeleteMail(emailId);
                }
            }
            catch (Exception ex)
            {

            }
        }
开发者ID:virtuoso-pra,项目名称:ReadEmail,代码行数:58,代码来源:CheckEmail.cs


示例2: Bind

 /// <summary>
 /// Binds to an existing e-mail message and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the e-mail message.</param>
 /// <param name="id">The Id of the e-mail message to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>An EmailMessage instance representing the e-mail message corresponding to the specified Id.</returns>
 public static new EmailMessage Bind(
     ExchangeService service,
     ItemId id,
     PropertySet propertySet)
 {
     return service.BindToItem<EmailMessage>(id, propertySet);
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:15,代码来源:EmailMessage.cs


示例3: ExportItem

        internal void ExportItem()
        {
            if (this.ItemToExport.GetType().Name.ToString() != "EmailMessage")
                throw new InvalidOperationException("Please provide item typeof EmailMessage.");

            ExchangeService ewsSession = this.GetSessionVariable();
            PropertySet propertySet = new PropertySet(EmailMessageSchema.MimeContent);
            propertySet.Add(EmailMessageSchema.ConversationTopic);

            EmailMessage emailMessage = EmailMessage.Bind(ewsSession, this.ItemToExport.Id, propertySet);

            Random rNumber = new Random();
            string directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "EmailExport");

            if (!Directory.Exists(directory))
                Directory.CreateDirectory(directory);

            if (string.IsNullOrEmpty(this.fileName))
            {
                int subjectLenght = emailMessage.ConversationTopic.Length > 10 ? 10 : emailMessage.ConversationTopic.Length;
                fileName = String.Format( "Email-{0}-{1}" , emailMessage.ConversationTopic.Substring( 0 , subjectLenght ) , rNumber.Next( 1 , 10 ) );
            }

            fileName = Path.Combine(directory, string.Format("{0}.eml", fileName));

            using (FileStream fileStream = new FileStream(fileName, FileMode.Create, FileAccess.Write))
            {
                fileStream.Write(emailMessage.MimeContent.Content, 0, emailMessage.MimeContent.Content.Length);
            }
        }
开发者ID:IvanFranjic,项目名称:XEws,代码行数:30,代码来源:XEwsExportCmdlet.cs


示例4: axMapControl1_OnMouseDown

        private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
        {
            //IMapDocument mxd;
            string x;
            x = e.mapX.ToString("#########.########");
            string y;
            y = e.mapY.ToString("#########.########");

            string data;
            data = "";
            data += string.Format("The map has x coordinate {0} \n y coordinate {1}", x, y);

            Form1 msgForm = new Form1();
            msgForm.label1.Text = data;
            //msgForm.ShowDialog();
            IPropertySet location = new PropertySet();
            location.SetProperty("ps","C:\\Users\\AlexanderN\\Documents\\ArcGIS\\Points.gdb");
            string featureBuffer = "C:\\Users\\AlexanderN\\Documents\\ArcGIS\\Points.gdb\\Buffer";
            string featurePoint = "C:\\Users\\AlexanderN\\Documents\\ArcGIS\\Points.gdb\\AdditionalPoint";
            IFeatureWorkspace ws;
            IFeature newPoint = ws.OpenFeatureClass(featurePoint) as IFeature;
            IFeature newBuffer = ws.OpenFeatureClass(featureBuffer) as IFeature;

                Geom.IPoint point = new Geom.PointClass();
                point.PutCoords(e.mapX, e.mapY);
                newPoint.Shape = point;
                IFeatureClass pointFC = newPoint as IFeatureClass;
                newPoint.Store();
        }
开发者ID:nohe427,项目名称:MyAddins,代码行数:29,代码来源:MainForm.cs


示例5: Bind

 /// <summary>
 /// Binds to an existing meeting request and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the meeting request.</param>
 /// <param name="id">The Id of the meeting request to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>A MeetingRequest instance representing the meeting request corresponding to the specified Id.</returns>
 public static new MeetingRequest Bind(
     ExchangeService service,
     ItemId id,
     PropertySet propertySet)
 {
     return service.BindToItem<MeetingRequest>(id, propertySet);
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:15,代码来源:MeetingRequest.cs


示例6: Bind

 /// <summary>
 /// Binds to an existing task and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the task.</param>
 /// <param name="id">The Id of the task to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>A Task instance representing the task corresponding to the specified Id.</returns>
 public static new Task Bind(
     ExchangeService service,
     ItemId id,
     PropertySet propertySet)
 {
     return service.BindToItem<Task>(id, propertySet);
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:15,代码来源:Task.cs


示例7: GetCalendarEvents

        /// <summary>
        /// Returns a list of events given the start and end time, inclusive.
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public IEnumerable<ICalendarEvent> GetCalendarEvents(DateTimeOffset startDate, DateTimeOffset endDate)
        {
            // Initialize the calendar folder object with only the folder ID.
            var propertiesToGet = new PropertySet(PropertySet.IdOnly);
            propertiesToGet.RequestedBodyType = BodyType.Text;

            var calendar = CalendarFolder.Bind(_exchangeService, WellKnownFolderName.Calendar, propertiesToGet);
            
            // Set the start and end time and number of appointments to retrieve.
            var calendarView = new CalendarView(
                startDate.ToOffset(_exchangeService.TimeZone.BaseUtcOffset).DateTime,
                endDate.ToOffset(_exchangeService.TimeZone.BaseUtcOffset).DateTime,
                MAX_EVENTS_TO_RETRIEVE);

            // Retrieve a collection of appointments by using the calendar view.
            var appointments = calendar.FindAppointments(calendarView);

            // Get specific properties.
            var appointmentSpecificPropertiesToGet = new PropertySet(PropertySet.FirstClassProperties);
            appointmentSpecificPropertiesToGet.AddRange(NonFirstClassAppointmentProperties);
            appointmentSpecificPropertiesToGet.RequestedBodyType = BodyType.Text;
            _exchangeService.LoadPropertiesForItems(appointments, appointmentSpecificPropertiesToGet);

            return TransformExchangeAppointmentsToGenericEvents(appointments);
        }
开发者ID:rkeilty,项目名称:RK.Calendar.Sync,代码行数:31,代码来源:ExchangeCalendar.cs


示例8: createTestVirtualDocument

        private void createTestVirtualDocument()
        {
                // create a new DataObject to use as the parent node
                ObjectIdentity emptyIdentity = new ObjectIdentity(DefaultRepository);
                DataObject parentDO = new DataObject(emptyIdentity);
                parentDO.Type = "dm_document";
                PropertySet parentProperties = new PropertySet();
                parentProperties.Set("object_name", SampleContentManager.testVdmObjectName);
                parentDO.Properties = parentProperties;

                // link into a folder
                ObjectPath objectPath = new ObjectPath(SampleContentManager.sourcePath);
                ObjectIdentity sampleFolderIdentity = new ObjectIdentity(objectPath, DefaultRepository);
                ReferenceRelationship sampleFolderRelationship = new ReferenceRelationship();
                sampleFolderRelationship.Name = Relationship.RELATIONSHIP_FOLDER;
                sampleFolderRelationship.Target = sampleFolderIdentity;
                sampleFolderRelationship.TargetRole = Relationship.ROLE_PARENT;
                parentDO.Relationships.Add(sampleFolderRelationship);

                // get id of document to use for first child node
                ObjectIdentity child0Id = new ObjectIdentity();
                child0Id.RepositoryName = DefaultRepository;
                child0Id.Value = new Qualification(SampleContentManager.gifImageQualString);

                // get id of document to use for second child node
                ObjectIdentity child1Id = new ObjectIdentity();
                child1Id.RepositoryName = DefaultRepository;
                child1Id.Value = new Qualification(SampleContentManager.gifImage1QualString);

                ObjectIdentitySet childNodes = new ObjectIdentitySet();
                childNodes.AddIdentity(child0Id);
                childNodes.AddIdentity(child1Id);

                virtualDocumentServiceDemo.AddChildNodes(parentDO, childNodes);
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:35,代码来源:TVirtualDocumentServiceDemo.cs


示例9: ShowNumberProperties

        public void ShowNumberProperties()
        {
            PropertySet propertySet = new PropertySet();

            //Create instances of NumberProperty
            propertySet.Set("TestShortName", (short) 10);
            propertySet.Set("TestIntegerName", 10);
            propertySet.Set("TestLongName", 10L);
            propertySet.Set("TestDoubleName", 10.10);

            //Create instance of DateProperty
            propertySet.Set("TestDateName", new DateTime());

            //Create instance of BooleanProperty
            propertySet.Set("TestBooleanName", false);

            //Create instance of ObjectIdProperty
            propertySet.Set("TestObjectIdName", new ObjectId("10"));

            List<Property> properties = propertySet.Properties;
            foreach (Property p in properties)
            {
                Console.WriteLine(typeof(Property).ToString() +
                                  " = " +
                                  p.GetValueAsString());
            }
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:27,代码来源:PropertyDemo.cs


示例10: Bind

 /// <summary>
 /// Binds to an existing meeting cancellation message and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the meeting cancellation message.</param>
 /// <param name="id">The Id of the meeting cancellation message to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>A MeetingCancellation instance representing the meeting cancellation message corresponding to the specified Id.</returns>
 public static new MeetingCancellation Bind(
     ExchangeService service,
     ItemId id, 
     PropertySet propertySet)
 {
     return service.BindToItem<MeetingCancellation>(id, propertySet);
 }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:15,代码来源:MeetingCancellation.cs


示例11: Bind

 /// <summary>
 /// Binds to an existing appointment and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the appointment.</param>
 /// <param name="id">The Id of the appointment to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>An Appointment instance representing the appointment corresponding to the specified Id.</returns>
 public static new Appointment Bind(
     ExchangeService service,
     ItemId id,
     PropertySet propertySet)
 {
     return service.BindToItem<Appointment>(id, propertySet);
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:15,代码来源:Appointment.cs


示例12: Bind

 /// <summary>
 /// Binds to an existing contact and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the contact.</param>
 /// <param name="id">The Id of the contact to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>A Contact instance representing the contact corresponding to the specified Id.</returns>
 public static new Contact Bind(
     ExchangeService service,
     ItemId id,
     PropertySet propertySet)
 {
     return service.BindToItem<Contact>(id, propertySet);
 }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:15,代码来源:Contact.cs


示例13: Bind

 /// <summary>
 /// Binds to an existing calendar folder and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the calendar folder.</param>
 /// <param name="id">The Id of the calendar folder to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>A CalendarFolder instance representing the calendar folder corresponding to the specified Id.</returns>
 public static new CalendarFolder Bind(
     ExchangeService service,
     FolderId id,
     PropertySet propertySet)
 {
     return service.BindToFolder<CalendarFolder>(id, propertySet);
 }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:15,代码来源:CalendarFolder.cs


示例14: TestPackage

 /// <summary>
 /// Creates an empty test package.
 /// </summary>
 public TestPackage()
 {
     files = new List<FileInfo>();
     hintDirectories = new List<DirectoryInfo>();
     excludedTestFrameworkIds = new List<string>();
     properties = new PropertySet();
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:10,代码来源:TestPackage.cs


示例15: Bind

 /// <summary>
 /// Binds to an existing item, whatever its actual type is, and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the item.</param>
 /// <param name="id">The Id of the item to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>An Item instance representing the item corresponding to the specified Id.</returns>
 public static Item Bind(
     ExchangeService service,
     ItemId id,
     PropertySet propertySet)
 {
     return service.BindToItem<Item>(id, propertySet);
 }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:15,代码来源:Item.cs


示例16: Bind

 /// <summary>
 /// Binds to an existing Persona and loads the specified set of properties.
 /// Calling this method results in a call to EWS.
 /// </summary>
 /// <param name="service">The service to use to bind to the Persona.</param>
 /// <param name="id">The Id of the Persona to bind to.</param>
 /// <param name="propertySet">The set of properties to load.</param>
 /// <returns>A Persona instance representing the Persona corresponding to the specified Id.</returns>
 public static new Persona Bind(
     ExchangeService service,
     ItemId id,
     PropertySet propertySet)
 {
     return service.BindToItem<Persona>(id, propertySet);
 }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:15,代码来源:Persona.cs


示例17: CreateHandler

        /// <inheritdoc />
        public IHandler CreateHandler(IObjectDependencyResolver dependencyResolver, Type contractType, Type objectType, PropertySet properties)
        {
            if (! contractType.IsInstanceOfType(instance))
                throw new RuntimeException(string.Format("Could not satisfy contract of type '{0}' using pre-manufactured instance of type '{1}'.",
                    contractType, instance.GetType()));

            return new Handler(instance);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:9,代码来源:InstanceHandlerFactory.cs


示例18: CreateHandler

        /// <inheritdoc />
        public IHandler CreateHandler(IObjectDependencyResolver dependencyResolver, Type contractType, Type objectType, PropertySet properties)
        {
            if (! contractType.IsAssignableFrom(objectType))
                throw new RuntimeException(string.Format("Could not satisfy contract of type '{0}' by creating an instance of type '{1}'.",
                    contractType, objectType));

            var objectFactory = new ObjectFactory(dependencyResolver, objectType, properties);
            return new SingletonHandler(objectFactory);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:10,代码来源:SingletonHandlerFactory.cs


示例19: ProcessMails

        public void ProcessMails()
        {
            // Get the inbox folder and load all properties. This results in a GetFolder call to EWS. 
            Folder folder = Folder.Bind(service, WellKnownFolderName.Inbox);
            PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject, ItemSchema.Body, ItemSchema.TextBody, ItemSchema.NormalizedBody);
            //propSet.RequestedBodyType = BodyType.Text;
            //propSet.BasePropertySet = BasePropertySet.FirstClassProperties;
            ItemView view = new ItemView(1);
            SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));
            var items = folder.FindItems(sf, view);

            foreach (var item in items)
            {
                Item mailItem = Item.Bind(service, item.Id, propSet);
                Console.WriteLine(mailItem.Subject);
                Console.WriteLine("*********************************************************");
                Console.WriteLine(mailItem.Body);
                Console.WriteLine("*********************************************************");
                Console.WriteLine(mailItem.TextBody ?? "");
                Console.WriteLine("*********************************************************");
                Console.WriteLine(mailItem.NormalizedBody ?? "");
                Console.WriteLine("*********************************************************");
                Console.WriteLine("\n\n\n\n\n\n\n\n\n\n\n");

                HtmlDocument htmlDoc = new HtmlDocument();
                htmlDoc.LoadHtml(mailItem.NormalizedBody);

                if (htmlDoc.ParseErrors != null && htmlDoc.ParseErrors.Count() > 0)
                {
                    // TODO: Handle any parse errors as required
                }
                else
                {

                    if (htmlDoc.DocumentNode != null)
                    {
                        var nodes = htmlDoc.DocumentNode.SelectNodes("//table");
                        for (int i = 0; i < nodes.Count; i++)
                        {
                            var node = nodes[i];
                            if (i == 0)
                            {

                            }
                            else if (i == 1)
                            {
                                var table = Utilities.GetDataTable(node);
                            }
                            else
                            {
                                break; //TODO: raise error? continue silently?
                            }
                        }
                    }
                }
            }
        }
开发者ID:heimanhon,项目名称:researchwork,代码行数:57,代码来源:RecapSplitter.cs


示例20: AgsConnect_Works

        public void AgsConnect_Works()
        {
            var connectionFactory = (IAGSServerConnectionFactory2) new AGSServerConnectionFactory();
            IPropertySet connectionProps = new PropertySet();
            connectionProps.SetProperty("URL", address);

            IAGSServerConnection gisServer = connectionFactory.Open(connectionProps, 0);
            Assert.That(gisServer, Is.Not.Null);
        }
开发者ID:baens,项目名称:Esri2011,代码行数:9,代码来源:ApplicationAgsCorHandlerFixture.cs



注:本文中的PropertySet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PropertyType类代码示例发布时间:2022-05-24
下一篇:
C# PropertyRule类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap