示例#1
0
        public override void Initialize(IAppContext context)
        {
            _context       = context;
            _menuGenerator = context.Container.GetInstance <MenuGenerator>();
            ISecureContext secureContext = context as ISecureContext;

            _drawFence = true;
            _isDeign   = false;
            _isLayout  = false;
            if (secureContext.YutaiProject != null)
            {
                XmlPlugin xmlPlugin = secureContext.YutaiProject.FindPlugin("5e933989-b5a4-4a45-a5b7-2d9ded61df0f");
                if (xmlPlugin != null)
                {
                    string fileName = xmlPlugin.ConfigXML;
                    if (string.IsNullOrEmpty(fileName))
                    {
                        _printConfig.TemplateConnectionString = BuildDefaultConnectionString();
                    }
                    else
                    {
                        fileName = FileHelper.GetFullPath(fileName);
                        _printConfig.LoadFromXml(fileName);
                    }
                }
            }
            if (string.IsNullOrEmpty(_printConfig.TemplateConnectionString))
            {
                _printConfig.TemplateConnectionString = BuildDefaultConnectionString();
            }
            _templateGallery = new MapTemplateGallery();
            _templateGallery.SetWorkspace(_printConfig.TemplateConnectionString);

            ((IAppContextEvents)_context).OnActiveHookChanged += OnOnActiveHookChanged;
            _activeViewEvents            = ((IActiveViewEvents_Event)_context.FocusMap);
            _activeViewEvents.AfterDraw += ActiveViewEventsOnAfterDraw;

            if (_fillSymbol == null)
            {
                _fillSymbol = SymbolHelper.CreateTransparentFillSymbol(Color.Blue) as ISymbol;
                _lineSymbol = SymbolHelper.CreateSimpleLineSymbol(Color.Blue, 1.5) as ISymbol;
            }
        }
示例#2
0
 private void MapTemplateList_Load(object sender, EventArgs e)
 {
     if (mapTemplateGallery == null)
     {
         mapTemplateGallery = new MapTemplateGallery();
         this.mapTemplateGallery.Init();
     }
     foreach (MapTemplateClass class2 in this.mapTemplateGallery.MapTemplateClass)
     {
         class2.Load();
         foreach (MapTemplate template in class2.MapTemplate)
         {
             template.IsTest = false;
             if (this.bool_0)
             {
                 if (template.MapFramingType == MapFramingType.StandardFraming)
                 {
                     this.listBox1.Items.Add(template);
                 }
             }
             else if (this.mapTemplateApplyHelp.FixDataRange)
             {
                 if (template.MapFramingType == MapFramingType.AnyFraming)
                 {
                     this.listBox1.Items.Add(template);
                 }
             }
             else if (!string.IsNullOrEmpty(this.mapTemplateApplyHelp.MapNo))
             {
                 int scale = this.GetScale(this.mapTemplateApplyHelp.MapNo);
                 if (((scale != 0) && (template.MapFramingType == MapFramingType.StandardFraming)) &&
                     ((template.MapFrameType == MapFrameType.MFTTrapezoid) && (scale == template.Scale)))
                 {
                     this.listBox1.Items.Add(template);
                 }
             }
         }
     }
 }
示例#3
0
 public frmMapTemplateApplyWizard(MapTemplateGallery templateGallery)
 {
     this.InitializeComponent();
     _mapTemplateGallery = templateGallery;
 }
示例#4
0
 public MapTemplateList(MapTemplateGallery tempGallery)
 {
     this.InitializeComponent();
     mapTemplateGallery = tempGallery;
 }