Ejemplo n.º 1
0
        private WindowProfileSerializer CreateWindowProfileSerializer()
        {
            WindowProfileSerializer profileSerializer = new WindowProfileSerializer();

            profileSerializer.MapNamespaceToAssembly(typeof(ExpressionDockGroup).Namespace, this.GetType().Assembly.GetName().Name, "ExpressionExtension");
            return(profileSerializer);
        }
Ejemplo n.º 2
0
        public void CopyConfiguration(IWorkspace sourceWorkspace)
        {
            if (sourceWorkspace == null)
            {
                throw new ArgumentNullException("sourceWorkspace");
            }
            if (sourceWorkspace == this)
            {
                throw new ArgumentException("Cannot copy configuration from itself.", "sourceWorkspace");
            }
            Workspace workspace = sourceWorkspace as Workspace;

            if (workspace == null)
            {
                throw new ArgumentException("Source workspace must be of the type Workspace. Other types are not supported.", "sourceWorkspace");
            }
            WindowProfileSerializer profileSerializer = this.CreateWindowProfileSerializer();

            this.windowProfile = workspace.WindowProfile.Copy(this.name, profileSerializer);
            if (this.content == null)
            {
                return;
            }
            NakedView nakedView = (NakedView)this.windowProfile.Find((Predicate <ViewElement>)(v => v is NakedView));

            if (nakedView == null)
            {
                return;
            }
            nakedView.Content = this.content;
        }