/// <summary> /// Returns an ExplorerBarInfo that contains the deserialized ExplorerBarInfoSurrogate data /// </summary> /// <returns>An ExplorerBarInfo that contains the deserialized ExplorerBarInfoSurrogate data</returns> public ExplorerBarInfo Save() { ExplorerBarInfo explorerBarInfo = new ExplorerBarInfo(); explorerBarInfo.TaskPane = this.TaskPaneInfoSurrogate.Save(); explorerBarInfo.TaskItem = this.TaskItemInfoSurrogate.Save(); explorerBarInfo.Expando = this.ExpandoInfoSurrogate.Save(); explorerBarInfo.Header = this.HeaderInfoSurrogate.Save(); return(explorerBarInfo); }
/// <summary> /// Populates the ExplorerBarInfoSurrogate with data that is to be /// serialized from the specified ExplorerBarInfo /// </summary> /// <param name="explorerBarInfo">The ExplorerBarInfo that contains the data /// to be serialized</param> public void Load(ExplorerBarInfo explorerBarInfo) { this.TaskPaneInfoSurrogate = new TaskPaneInfoSurrogate(); this.TaskPaneInfoSurrogate.Load(explorerBarInfo.TaskPane); this.TaskItemInfoSurrogate = new TaskItemInfoSurrogate(); this.TaskItemInfoSurrogate.Load(explorerBarInfo.TaskItem); this.ExpandoInfoSurrogate = new ExpandoInfoSurrogate(); this.ExpandoInfoSurrogate.Load(explorerBarInfo.Expando); this.HeaderInfoSurrogate = new HeaderInfoSurrogate(); this.HeaderInfoSurrogate.Load(explorerBarInfo.Header); }
static ExplorerBarInfo() { //if (Tools.DesignModeTool.IsDesignMode) { // XmlSerializer xmlSerializer = new XmlSerializer(typeof(ExplorerBarInfoSurrogate)); // var surrogate = (ExplorerBarInfoSurrogate)xmlSerializer.Deserialize(new System.IO.StringReader(Resources.LunaExplorerBarTheme)); // _default = surrogate.Save(); //} else { // _default = // XmlProvider // .ReadFromString<ExplorerBarInfoSurrogate>(Resources.LunaExplorerBarTheme) // .Save(); //} _default = XmlProvider .ReadFromString <ExplorerBarInfoSurrogate>(Resources.LunaExplorerBarTheme) .Save(); }
///// <summary> ///// ///// </summary> //private Win32.DrawTextFlags drawTextFlags; #endregion #region Constructor /// <summary> /// Initializes a new instance of the TaskItem class with default settings /// </summary> public TaskItem() : base() { // set control styles this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.Selectable, true); this.TabStop = true; this.BackColor = Color.Transparent; // get the system theme settings this.systemSettings = ExplorerBarInfo.Default; this.customSettings = new TaskItemInfo(); this.customSettings.TaskItem = this; this.customSettings.SetDefaultEmptyValues(); // preferred size this.preferredWidth = -1; this.preferredHeight = -1; // unfocused item this.focusState = FocusStates.None; this.Cursor = Cursors.Hand; this.textRect = new Rectangle(); this.TextAlign = ContentAlignment.TopLeft; this.showFocusCues = false; this.InitStringFormat(); this.InitDrawTextFlags(); }