Exemple #1
0
        /// <summary>
        /// Rebuilds the recipients list.
        /// </summary>
        void RebuildRecipientsList()
        {
            SuppressListForCurrentWord = false;

            recipients.Clear();

            DocumentWalker walker = new DocumentWalker();

            walker.VisualVisited += delegate(object sender, object visitedObject, bool start)
            {
                if (visitedObject is ContentControl)
                {
                    ContentControl contentControl = (ContentControl)visitedObject;
                    object         content        = contentControl.Content;

                    if (content is SourceAddress)
                    {
                        recipients.Add(content as SourceAddress);
                    }

                    if (content is Profile)
                    {
                        var profile = (content as Profile);
                        var address = profile.SourceAddress;

                        address.SetChannel(profile.SourceChannel);

                        recipients.Add(address);
                    }
                }
            };
            walker.Walk(Editor.Document);
        }
        /// <summary>
        /// Adds the specified channel.
        /// </summary>
        /// <param name="channel">The channel.</param>
        public static ChannelInstance Add(ChannelConfiguration channel)
        {
            var channelInstance = new ChannelInstance(channel);

            _Channels.Add(channelInstance);

            return(channelInstance);
        }
        void AttachFiles(string[] fileNames)
        {
            if (fileNames != null && fileNames.Length > 0)
            {
                foreach (var filename in fileNames)
                {
                    FileInfo fi = new FileInfo(filename);

                    if (fi.Exists)
                    {
                        attachedFiles.Add(new AttachmentDataHelper(fi.Name, fi.FullName));
                    }
                }
            }
        }
Exemple #4
0
        public bool Listen(string name, RoutedEventHandler o)
        {
            RoutedEvent re = Get(name);

            if (re == null)
            {
                Events.Add(EventManager.RegisterRoutedEvent(key + name, RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(DirectorEvent)));
                re = Get(name);
            }
            AddActive(new RoutedEventConnection(re, o));
            AddHandler(
                re
                , o);
            return(true);
        }
Exemple #5
0
 public void AddActive(RoutedEventConnection rec)
 {
     RemoveActive(rec);
     ActiveEvents.Add(rec);
 }