Exemple #1
0
    void SetDataSource(LineCapEx selected)
    {
      if (_lineCaps == null)
        SetDefaultValues();
      if (!_lineCaps.ContainsKey(selected.Name))
        _lineCaps.Add(selected.Name, selected);

      this.BeginUpdate();

      Items.Clear();

      foreach (KeyValuePair<string,LineCapEx> o in _lineCaps)
        Items.Add(o.Value);

      SelectedItem = LineCapEx.FromName(selected.Name);

      this.EndUpdate();
    }
Exemple #2
0
 public LineCapComboBox(bool isForEndCap, LineCapEx selected)
   : this()
 {
   _isForEndCap = isForEndCap;
   SetDataSource(selected);
 }
Exemple #3
0
    /// <summary>
    /// Copies the properties of another instance to this instance.
    /// </summary>
    /// <param name="pen">the PenHolder object to copy</param>
    public void CopyFrom(PenX pen)
    {
      _SetPenVariable(null);

      this.m_ConfiguredProperties = pen.m_ConfiguredProperties;
      this.m_PenType = pen.PenType;
      this.m_Alignment = pen.Alignment;

      if (0 != (this.m_ConfiguredProperties & Configured.Brush))
        this.m_Brush = new BrushX(pen.m_Brush);

      this.m_Color = pen.Color;

      if (null != pen.m_CompoundArray)
        this.m_CompoundArray = (float[])pen.CompoundArray.Clone();
      else
        this.m_CompoundArray = null;

      this.m_DashCap = pen.DashCap;
      this.m_DashOffset = pen.DashOffset;

      if (null != pen.m_DashPattern)
        this.m_DashPattern = (float[])pen.DashPattern.Clone();
      else
        this.m_DashPattern = null;

      this.m_DashStyle = pen.DashStyle;
      this.m_EndCap = pen.EndCap;
      this.m_LineJoin = pen.LineJoin;
      this.m_MiterLimit = pen.MiterLimit;
      this.m_StartCap = pen.StartCap;

      if (null != pen.m_Transform)
        this.m_Transform = pen.Transform.Clone();
      else
        this.m_Transform = null;

      this.m_Width = pen.Width;

      // note: there is an problem with Pen.Clone() : if the Color of the pen
      // was set to a known color, the color of the cloned pen is the same, but no longer a known color
      // therefore we avoid the cloning of the pen here

      // if(m_CachedMode && null!=pen.m_Pen)
      //   _SetPenVariable( (Pen)pen.m_Pen.Clone() );
      // else
      //   _SetPenVariable(null);
    }
Exemple #4
0
 public static LineCapEx[] GetValues()
 {
   LineCapEx[] arr = new LineCapEx[_registeredStyles.Count];
   int i = 0;
   foreach (LineCapExtension ex in _registeredStyles.Values)
     arr[i++] = new LineCapEx(ex);
   return arr;
 }
Exemple #5
0
 public LineCapEx(LineCapEx from, float size)
 {
   _size = 0;
   _currentStyle = null;
   CopyFrom(from);
   _size = size;
 }
Exemple #6
0
 public void CopyFrom(LineCapEx from)
 {
   this._size = from._size;
   this._currentStyle = from._currentStyle;
 }
Exemple #7
0
 public LineCapEx(LineCapEx from)
 {
   _size = 0;
   _currentStyle = null;
   CopyFrom(from);
 }