コード例 #1
0
 /// <summary>
 /// Default constructor for the class
 /// </summary>
 /// <param name="ownerOfAddIn">OwnerofAddIn</param>
 /// <param name="form">Parent form</param>
 public ExceptionCatcher(Ferda.FrontEnd.AddIns.IOwnerOfAddIn ownerOfAddIn, 
     WaitDialog parent)
 {
     this.projectManager = ownerOfAddIn.ProjectManager;
     this.ownerOfAddIn = ownerOfAddIn;
     this.parentDialog = parent;
 }
コード例 #2
0
        public CommonComments(ProjectWorkbook projectWorkbook)
        {
            Excel.Workbook wb = _app.ActiveWorkbook;
            _projectWorkbook = projectWorkbook;
            _SheetUrv12      = ExcelHelper.GetSheet(wb, "Урв12");

            _projectManager = new ProjectManager.ProjectManager();
            _project        = _projectManager.ActiveProject;
            _AnalisysSheet  = ExcelHelper.GetSheet(wb, _project.AnalysisSheetName);
        }
コード例 #3
0
        public Pivot(IProgressBarWithLogUI pb)
        {
            this.pb = pb;
            Excel.Workbook wb = _app.ActiveWorkbook;
            SheetUrv12      = ExcelHelper.GetSheet(wb, "Урв12");
            SheetUrv11      = ExcelHelper.GetSheet(wb, "Урв11");
            _SheetPalette   = ExcelHelper.GetSheet(wb, "Палитра");
            _projectManager = new ProjectManager.ProjectManager();
            _project        = _projectManager.ActiveProject;
            string analisysSheetName = _project.AnalysisSheetName;

            _AnalisysSheet = ExcelHelper.GetSheet(wb, analisysSheetName);
        }
コード例 #4
0
ファイル: FormManagerKP.cs プロジェクト: AlexeyZheltov/ACO
        public FormManagerKP()
        {
            InitializeComponent();

            _projectManager      = new ProjectManager.ProjectManager();
            _manager             = new OfferManager();
            _mappingColumnsOffer = new List <OfferColumnMapping>();

            //  ListKP.FullRowSelect = true;
            // ListKP.MultiSelect = false;
            TableColumns.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;

            ListKP.View = View.List;
            LoadData();
        }
コード例 #5
0
        ///<summary>
        /// Default constructor for FerdaArchive class.
        ///</summary>
        public FerdaArchive(Menu.ILocalizationManager locManager,
            Menu.IMenuDisplayer menuDisp, IFerdaClipboard clipboard,
            ProjectManager.Archive arch, IIconProvider iconProvider,
            Menu.IMenuDisplayer toolBar,
            ProjectManager.ProjectManager projManager)
            : base()
        {
            //setting the icon
            naIcon = iconProvider.GetIcon("NAIcon");
            this.iconProvider = iconProvider;

            //setting the localization
            localizationManager = locManager;
            ResManager = localizationManager.ResManager;

            //setting the menu displayer
            menuDisplayer = menuDisp;
            this.toolBar = toolBar;

            //setting the archive
            Archive = arch;

            //setting the projectManager
            projectManager = projManager;

            InitializeComponent();

            //Setting the texts of the radiobuttons
            RBAlong.Text = ResManager.GetString("ArchiveAlongText");
            RBAgainst.Text = ResManager.GetString("ArchiveAgainstText");
            RBAlong.Checked = true;

            //Setting the clipboard
            this.Clipboard = clipboard;

            //events
            GotFocus += new EventHandler(FerdaArchive_GotFocus);
            TVArchive.GotFocus += new EventHandler(FerdaArchive_GotFocus);
            TVArchive.MouseDown += new MouseEventHandler(TVArchive_MouseDown);
            TVArchive.MouseMove += new MouseEventHandler(TVArchive_MouseMove);

            //the labelEdit property
            TVArchive.LabelEdit = true;
            TVArchive.AfterLabelEdit += new NodeLabelEditEventHandler(TVArchive_AfterLabelEdit);

            CBCategories.SelectedIndexChanged += new EventHandler(CBArchive_SelectedIndexChanged);
            CBTypes.SelectedIndexChanged += new EventHandler(CBTypes_SelectedIndexChanged);
            RBAlong.CheckedChanged += new EventHandler(RBAlong_CheckedChanged);
            TVArchive.AfterSelect += new TreeViewEventHandler(TVArchive_AfterSelect);

            ArchiveSetupAfterLoadProject();
        }
コード例 #6
0
        /// <summary>
        /// This method should be always called after the constructor, because
        /// without this method FerdaForm wont work at all. It contains all the
        /// necessary setup for the form.
        /// </summary>
        /// <param name="pm">Project Manager of the application</param>
        /// <param name="prescreen">Prescreen where text about application
        /// loading is displayed</param>
        public void RightAfterConstructor(ProjectManager.ProjectManager pm, 
            FerdaPrescreen prescreen)
        {
            projectManager = pm;

            //fills the projectManager with some stuff
            FillPM();

            SizeChanged += new EventHandler(FormSizeChanged);
            Closing += new CancelEventHandler(FerdaForm_Closing);

            //loading the recent projects
            LoadRecentProjects();

            prescreen.DisplayText(ResManager.GetString("LoadingIcons"));
            LoadIcons();
            this.Icon = iconProvider["FerdaIcon"];

            prescreen.DisplayText(ResManager.GetString("LoadingSVG"));
            SetupSVG();
            prescreen.DisplayText(ResManager.GetString("LoadingMenus"));
            SetupStripes();

            prescreen.DisplayText(ResManager.GetString("LoadingContextHelp"));
            SetupContextHelp();
            prescreen.DisplayText(ResManager.GetString("LoadingProperties"));
            SetupProperties();

            prescreen.DisplayText(ResManager.GetString("LoadingArchive"));
            SetupArchive();
            prescreen.DisplayText(ResManager.GetString("LoadingNewBox"));
            SetupNewBox();
            SetupUserNote();
            prescreen.DisplayText(ResManager.GetString("LoadingDesktop"));
            SetupDesktop();

            //Because when the program is setting up the menu, all the views(desktops)
            //are closed. Thus it would put all the views into the open group. After
            //the inicialization of the desktops, all the dekstops are open - and
            //the behaviour is correct.
            menu.SetupDesktop();

            prescreen.DisplayText(ResManager.GetString("LoadingDocking"));
            SetupDocking();

            //Name and title of the application
            Name = "FerdaForm";
            Text = "Ferda DataMiner";

            //this command should be the last one, otherwise the window is not
            //maximized correctly
            WindowState = FormWindowState.Maximized;
        }
コード例 #7
0
        static void Main(string [] args)
        {
            prescreen = new FerdaPrescreen();

            prescreen.Show();
            prescreen.Refresh();

            //tries to load the config
            try
            {
                iceConfig = FrontEndConfig.Load();
            }
            catch
            {
                prescreen.Hide();
                MessageBox.Show("Could not locate the FrontEndConfig.xml configuration file",
                    "Invalid config file",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            //loading the form
            FerdaForm form = new FerdaForm();
            form.SetupResources(iceConfig);

            //switching to the "bin" directory
            string previousDir = FrontEndCommon.SwitchToBinDirectory();

            prescreen.DisplayText(form.ResManager.GetString("LoadingProjectManager"));
            //loading the project manager
            ProjectManager.ProjectManager pm =
                new ProjectManager.ProjectManager(
                args,
                iceConfig.ProjectManagerOptions,
                new Ferda.FrontEnd.OutputI());

            //setting the form for the project manager
            form.RightAfterConstructor(pm, prescreen);

            prescreen.DisplayText(form.ResManager.GetString("LoadingAddIns"));
            //loading the add ins
            loadAddIns(form, pm.ModulesManager.Helper.ObjectAdapter, pm.ModulesManager, form.propertyGrid);
            pm.ModulesManager.AddModuleServices(iceConfig.FrontEndIceObjects);

            //switching to the directory from where it was executed
            FrontEndCommon.SwitchToPreviousDirectory(previousDir);

            //loading the associated file (if there is one)
            if (args.Length > 0 && !(args[0].StartsWith("--")))
            {
                FrontEndCommon.LoadProject(args[0], form, form.ResManager, ref pm,
                    form);
                form.AddToRecentProjects(args[0]);
                form.menu.SetupDesktop();
                form.WindowState = FormWindowState.Maximized;
            }

            prescreen.Hide();
            try
            {
                //running the application
                Application.Run(form);
            }
            finally
            {
                //clearing the add in and project manager resources
                addIns.Clear();
                pm.DestroyProjectManager();
            }

            form.SaveRecentProjects();

            //tries to save the config
            try
            {
                FrontEndConfig.Save(iceConfig);
            }
            catch
            {
                MessageBox.Show("Could not save the FrontEndConfig.xml configuration file",
                    "Invalid config file",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
        }
コード例 #8
0
        /// <summary>
        /// Constructor that sets the Box property
        /// </summary>
        /// <param name="box">box that will be represented by this node</param>
        /// <param name="alongDirection">the direction of expanding</param>
        /// <param name="arch">Archive where this box belongs</param>
        /// <param name="parent">Parent component of the archive</param>
        /// <param name="iconDictionary">Icon dictionary containing all the icons
        /// for the box visualization</param>
        /// <param name="list">Some image list</param>
        /// <param name="provider">Control providing access to all the icons</param>
        /// <param name="projManager">Project manager of the application</param>
        public FerdaTreeNode(ModulesManager.IBoxModule box, bool alongDirection, 
            ProjectManager.Archive arch, FerdaArchive parent, Dictionary<string, int> iconDictionary,
            ImageList list, IIconProvider provider, ProjectManager.ProjectManager projManager)
            : base()
        {
            Box = box;
            Text = box.UserName;
            AlongDirection = alongDirection;
            Archive = arch;
            ParentTreeView = parent;

            //icon provider for the menu
            this.provider = provider;

            //setting the projectManager
            projectManager = projManager;

            //setting the icon
            if (box.MadeInCreator.Icon.Length == 0)
            {
                this.ImageIndex = iconDictionary["naIcon"];
                this.SelectedImageIndex = iconDictionary["naIcon"];
            }
            else
            {
                string label = box.MadeInCreator.Label;

                if (iconDictionary.ContainsKey(label))
                {
                    this.ImageIndex = iconDictionary[label];
                    this.SelectedImageIndex = iconDictionary[label];
                }
                else
                {
                    MemoryStream stream = new MemoryStream(box.MadeInCreator.Icon);
                    Icon icon = new Icon(stream);
                    int count = list.Images.Count;
                    list.Images.Add(icon);
                    iconDictionary.Add(label, count);

                    this.ImageIndex = count;
                    this.SelectedImageIndex = count;
                }
            }

            //sets the child nodes for this node
            if (AlongDirection)
            {
                //sets the boxes as ConnectionTo
                foreach(ModulesManager.IBoxModule b in Archive.ConnectedTo(Box))
                {
                    Nodes.Add(new FerdaTreeNode(b, AlongDirection, Archive,
                        ParentTreeView, iconDictionary, list, provider, projectManager));
                }
            }
            else
            {
                //sets the boxes as ConnectionFrom
                foreach(ModulesManager.IBoxModule b in Archive.ConnectionsFrom(Box))
                {
                    Nodes.Add(new FerdaTreeNode(b, AlongDirection, Archive,
                        ParentTreeView, iconDictionary, list, provider, projectManager));
                }
            }
        }
コード例 #9
0
        ///<summary>
        /// Default constructor for FerdaArchive class. Initializes all menu controls
        /// and adds them to the menu.
        ///</summary>
        public FerdaMenu(
            IDockingManager dockManager, ILocalizationManager lockManager,
            ProjectManager.ProjectManager pm, IControlsManager contMan,
            IIconProvider provider)
            : base()
        {
            //setting the iconProvider
            iconProvider = provider;

            //filling the private fields
            dockingManager = dockManager;
            localizationManager = lockManager;
            ResManager = localizationManager.ResManager;
            projectManager = pm;
            controlsManager = contMan;

            //adding the main group of the menu
            SetupMainMenuGroup();

            //adding the file group of the menu
            SetupFile();

            //adding the edit group of the menu
            SetupEdit();

            //adding the view group of the menu
            SetupView();

            //SetupDesktop();

            //adding the actions group of the menu, will be done dynamically
            //probably calling some function

            SetupTools();
            SetupHelp();
        }
コード例 #10
0
        ///<summary>
        /// Default constructor for FerdaView class.
        ///</summary>
        ///<param name="locManager">
        /// Interface that takes care of the 
        ///localizacion in the application
        /// </param>
        ///<param name="svgMan">
        /// Interface for providing SVG graphics
        ///</param>
        ///<param name="menuDisp">Menu displayer</param>
        ///<param name="view">The view thath should be connected to this desktop</param>
        ///<param name="pm">The project manager of the application</param>
        ///<param name="arch">Control that displays the archive</param>
        ///<param name="provider">Provider of the icons</param>
        ///<param name="toolBar">Toolbar control</param>
        public FerdaDesktop(Menu.ILocalizationManager locManager,
            SVGManager svgMan, IMenuDisplayer menuDisp, ProjectManager.View view,
            ProjectManager.ProjectManager pm, Archive.IArchiveDisplayer arch,
            IIconProvider provider, IMenuDisplayer toolBar)
            : base()
        {
            //setting the icon
            this.provider = provider;

            //adding the localization
            localizationManager = locManager;
            ResManager = localizationManager.ResManager;

            //adding the svgManager
            svgManager = svgMan;

            //setting the menu displayer
            menuDisplayer = menuDisp;
            archiveDisplayer = arch;
            this.toolBar = toolBar;

            //Current view
            this.view = view;
            projectManager = pm;

            //name of the desktop
            Name = view.Name;

            //properties od the GraphControl to work propertly
            AllowMoveShape = true;
            AllowAddConnection = true;
            AllowAddShape = true;
            AllowDeleteShape = true;
            AllowDrop = true;
            AutoScroll = true;
            EnableContextMenu = true;
            EnableLayout = false;
            ShowGrid = false;
            Zoom = 1;
            RestrictToCanvas = false;
            this.ImeMode = System.Windows.Forms.ImeMode.On;

            //for now trial stuff
            BackgroundType = Netron.GraphLib.CanvasBackgroundTypes.Gradient;
            GradientTop = System.Drawing.Color.SkyBlue;

            //EventHandlers
            GotFocus += new EventHandler(FerdaDesktop_GotFocus);
            OnContextMenu += new MouseEventHandler(FerdaDesktop_ContextMenu);
            OnNewConnection += new NewConnection(FerdaDesktop_OnNewConnection);
            KeyPress += new KeyPressEventHandler(FerdaDesktop_KeyPress);
            OnFerdaMouseUp += new MouseEventHandler(FerdaDesktop_OnFerdaMouseUp);
            OnFerdaDeleteConnection += new FerdaConnection(FerdaDesktop_OnFerdaDeleteConnection);
            OnShapeRemoved += new NewShape(FerdaDesktop_OnShapeRemoved);

            //Setting the arrow for connections
            DefaultLineEnd = ConnectionEnds.RightFilledArrow;

            //Creation of the boxes and connections
            Adapt();
        }