Пример #1
0
        public PropertyObserver <IConfigurationObject> GetObserver(IConfigurationObject obj)
        {
            int key = obj.GetHashCode();

            if (!ContainsObserver(obj))
            {
                PropertyObserver <IConfigurationObject> pb = new PropertyObserver <IConfigurationObject>(obj);
                observers.Add(key, pb);
            }

            return(observers[key]);
        }
Пример #2
0
		public AvalonDockScreen(string name)
			: base(name)
		{
			CacheViews = false;

			observer = new PropertyObserver<AvalonDockScreen>(this);
			observer.RegisterHandler(n => n.Type, screen =>
				{
					var manager = IoC.Get<IDockScreenManager>();
					if (screen.Type == DockType.Document)
					{
						if (!manager.Documents.Contains(this))
						{
							manager.Documents.Add(this);
						}
					}
					else if (manager.Documents.Contains(this))
					{
						manager.Documents.Remove(this);
					}
				});
		}