/// <include file='doc\OtherStylePage.uex' path='docs/doc[@for="OtherStylePage.LoadStyles"]/*' /> /// <devdoc> /// Loads the style attributes into the UI. Also initializes /// the state of the UI, and the preview to reflect the values. /// </devdoc> protected override void LoadStyles() { SetInitMode(true); // create the attributes if they've not been created already if (cursorAttribute == null) { cursorAttribute = new CSSAttribute(CSSAttribute.CSSATTR_CURSOR); behaviorAttribute = new CSSAttribute(CSSAttribute.CSSATTR_BEHAVIOR, true); filterAttribute = new CSSAttribute(CSSAttribute.CSSATTR_FILTER); bordersAttribute = new CSSAttribute(CSSAttribute.CSSATTR_BORDERCOLLAPSE); layoutAttribute = new CSSAttribute(CSSAttribute.CSSATTR_TABLELAYOUT); } // load the attributes IStyleBuilderStyle[] styles = GetSelectedStyles(); cursorAttribute.LoadAttribute(styles); behaviorAttribute.LoadAttribute(styles); filterAttribute.LoadAttribute(styles); bordersAttribute.LoadAttribute(styles); layoutAttribute.LoadAttribute(styles); // initialize the ui with the attributes loaded InitCursorUI(); InitFilterUI(); InitBehaviorUI(); InitBordersUI(); InitLayoutUI(); SetInitMode(false); }
/// <include file='doc\ListsStylePage.uex' path='docs/doc[@for="ListsStylePage.LoadStyles"]/*' /> /// <devdoc> /// Loads the style attributes into the UI. Also initializes /// the state of the UI, and the preview to reflect the values. /// </devdoc> protected override void LoadStyles() { SetInitMode(true); // create the attributes if they've not already been created if (bulletStyleAttribute == null) { bulletStyleAttribute = new CSSAttribute(CSSAttribute.CSSATTR_LISTSTYLETYPE); bulletImageAttribute = new CSSAttribute(CSSAttribute.CSSATTR_LISTSTYLEIMAGE, true); bulletPositionAttribute = new CSSAttribute(CSSAttribute.CSSATTR_LISTSTYLEPOSITION); } // load the attributes IStyleBuilderStyle[] styles = GetSelectedStyles(); bulletStyleAttribute.LoadAttribute(styles); bulletImageAttribute.LoadAttribute(styles); bulletPositionAttribute.LoadAttribute(styles); // initialize the ui with the loaded attributes InitListTypeUI(); InitBulletStyleUI(); InitBulletImageUI(); InitBulletPositionUI(); SetEnabledState(); SetInitMode(false); }
/////////////////////////////////////////////////////////////////////////// // Functions to persist attributes private void SaveDimension(CSSAttribute ai, UnitControl unitDim) { string value = SaveDimensionUI(unitDim); Debug.Assert(value != null, "saveDimensionUI returned null!"); ai.SaveAttribute(GetSelectedStyles(), value); }
private void SavePageBreak(CSSAttribute ai, UnsettableComboBox cbxPgBr) { string value = SavePageBreakUI(cbxPgBr); Debug.Assert(value != null, "savePageBreakUI returned null!"); ai.SaveAttribute(GetSelectedStyles(), value); }
/////////////////////////////////////////////////////////////////////////// // Functions to initialize the UI with values private void InitDimensionUI(CSSAttribute ai, UnitControl unitDim) { Debug.Assert(IsInitMode() == true, "initDimensionUI called when page is not in init mode"); unitDim.Value = null; Debug.Assert(ai != null, "Expected ai to be non-null"); string value = ai.Value; if ((value != null) && (value.Length != 0)) { unitDim.Value = value; } }
/// <include file='doc\LayoutStylePage.uex' path='docs/doc[@for="LayoutStylePage.LoadStyles"]/*' /> /// <devdoc> /// Loads the style attributes into the UI. Also initializes /// the state of the UI, and the preview to reflect the values. /// </devdoc> protected override void LoadStyles() { SetInitMode(true); // create the attributes if they've not been created already if (visibilityAttribute == null) { visibilityAttribute = new CSSAttribute(CSSAttribute.CSSATTR_VISIBILITY); displayAttribute = new CSSAttribute(CSSAttribute.CSSATTR_DISPLAY); floatAttribute = new CSSAttribute(CSSAttribute.CSSATTR_FLOAT); clearAttribute = new CSSAttribute(CSSAttribute.CSSATTR_CLEAR); clipAttribute = new CSSAttribute(CSSAttribute.CSSATTR_CLIP); overflowAttribute = new CSSAttribute(CSSAttribute.CSSATTR_OVERFLOW); pageBreakBeforeAttribute = new CSSAttribute(CSSAttribute.CSSATTR_PAGEBREAKBEFORE); pageBreakAfterAttribute = new CSSAttribute(CSSAttribute.CSSATTR_PAGEBREAKAFTER); } // load the attributes IStyleBuilderStyle[] styles = GetSelectedStyles(); visibilityAttribute.LoadAttribute(styles); displayAttribute.LoadAttribute(styles); floatAttribute.LoadAttribute(styles); clearAttribute.LoadAttribute(styles); clipAttribute.LoadAttribute(styles); overflowAttribute.LoadAttribute(styles); pageBreakBeforeAttribute.LoadAttribute(styles); pageBreakAfterAttribute.LoadAttribute(styles); // initialize the ui with the attributes loaded InitVisibilityUI(); InitDisplayUI(); InitFloatUI(); InitClearUI(); InitClippingUI(); InitOverflowUI(); InitPageBreakUI(pageBreakBeforeAttribute, pageBreakBeforeCombo); InitPageBreakUI(pageBreakAfterAttribute, pageBreakAfterCombo); SetInitMode(false); }
/// <include file='doc\PositionStylePage.uex' path='docs/doc[@for="PositionStylePage.LoadStyles"]/*' /> /// <devdoc> /// Loads the style attributes into the UI. Also initializes /// the state of the UI, and the preview to reflect the values. /// </devdoc> protected override void LoadStyles() { SetInitMode(true); // create the attributes if they've not been created already if (positionAttribute == null) { positionAttribute = new CSSAttribute(CSSAttribute.CSSATTR_POSITION); leftAttribute = new CSSAttribute(CSSAttribute.CSSATTR_LEFT); topAttribute = new CSSAttribute(CSSAttribute.CSSATTR_TOP); widthAttribute = new CSSAttribute(CSSAttribute.CSSATTR_WIDTH); heightAttribute = new CSSAttribute(CSSAttribute.CSSATTR_HEIGHT); zIndexAttribute = new CSSAttribute(CSSAttribute.CSSATTR_ZINDEX); } // load the attributes IStyleBuilderStyle[] styles = GetSelectedStyles(); positionAttribute.LoadAttribute(styles); leftAttribute.LoadAttribute(styles); topAttribute.LoadAttribute(styles); widthAttribute.LoadAttribute(styles); heightAttribute.LoadAttribute(styles); zIndexAttribute.LoadAttribute(styles); // initialize the ui with the attributes loaded InitPositionModeUI(); InitDimensionUI(leftAttribute, leftUnit); InitDimensionUI(topAttribute, topUnit); InitDimensionUI(widthAttribute, widthUnit); InitDimensionUI(heightAttribute, heightUnit); InitZIndexUI(); SetEnabledState(); SetInitMode(false); }
private void InitPageBreakUI(CSSAttribute ai, UnsettableComboBox cbxPgBr) { Debug.Assert(IsInitMode() == true, "initPageBreakUI called when page is not in init mode"); cbxPgBr.SelectedIndex = -1; Debug.Assert(ai != null, "Expected ai to be non-null"); string value = ai.Value; if ((value != null) && (value.Length != 0)) { for (int i = 1; i < PAGEBREAK_VALUES.Length; i++) { if (PAGEBREAK_VALUES[i].Equals(value)) { cbxPgBr.SelectedIndex = i; break; } } } }