コード例 #1
0
 //---------------------------------------------------------------------------------------------------------
 /// <summary>
 /// Чтение свойств и данных графического примитива из формата атрибутов XML
 /// </summary>
 /// <param name="prefix">Префикс имени атрибута</param>
 /// <param name="xml_reader">Средство чтения данных формата XML</param>
 //---------------------------------------------------------------------------------------------------------
 public override void ReadPrimitivFromAttribute(String prefix, XmlReader xml_reader)
 {
     mBoundsRect          = xml_reader.ReadMathRect2DfFromAttribute(prefix + "BoundsRect");
     mZIndex              = xml_reader.ReadIntegerFromAttribute(prefix + "ZIndex", mZIndex);
     mIsStroked           = xml_reader.ReadBooleanFromAttribute(prefix + "IsStroked", mIsStroked);
     mIsFilled            = xml_reader.ReadBooleanFromAttribute(prefix + "IsFilled", mIsFilled);
     mText                = xml_reader.ReadStringFromAttribute(prefix + "Text", mText);
     mBrush               = XCadBrushManager.GetFromColor(xml_reader.ReadCadColorFromAttribute(prefix + "Color"));
     mFontSize            = xml_reader.ReadSingleFromAttribute(prefix + "FontSize", mFontSize);
     mFont                = XCadFontManager.GetFromId(xml_reader.ReadLongFromAttribute(prefix + "FontID", mFont.ID));
     mHorizontalAlignment = xml_reader.ReadEnumFromAttribute(prefix + "HorizontalAlignment", mHorizontalAlignment);
     mVerticalAlignment   = xml_reader.ReadEnumFromAttribute(prefix + "VerticalAlignment", mVerticalAlignment);
     mTrimming            = xml_reader.ReadEnumFromAttribute(prefix + "Trimming", mTrimming);
 }
コード例 #2
0
            //---------------------------------------------------------------------------------------------------------
            /// <summary>
            /// Первоначальная инициализация диспетчера управления подсистемой чертежной графики
            /// </summary>
            //---------------------------------------------------------------------------------------------------------
            public static void Init()
            {
#if USE_WINDOWS
                XWindowsColorManager.Init();

                if (mGraphicsResources == null)
                {
                    mGraphicsResources        = new SharedResourceDictionary();
                    mGraphicsResources.Source = new Uri(XCadManager.UriGraphicsResources, UriKind.Absolute);
                }
#endif

                mEditor = new CCadEditor();

                //XManager.Init();
                XCadBrushManager.Init();
                XCadPenStyleManager.Init();
                XCadPenManager.Init();
                XCadLayerManager.Init();
                XCadFontManager.Init();
                XCadPaperManager.Init();

                //XManager.Editor = mEditor;
            }