Example #1
0
        /// <summary>
        /// The main application window.
        /// </summary>
        ///
        public MainWindow() : base(Gtk.WindowType.Toplevel)
        {
            // Register the MainWindow as service so that it can be passed to the rest of the plugins
            // so that they could attach themselves in the menus.
            plugins.AddService((ISolidReflector)this);

            string confDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            applicationDataDir = System.IO.Path.Combine(confDir,
                                                        Assembly.GetExecutingAssembly().GetName().Name);
            pluginsDir = System.IO.Path.Combine(applicationDataDir, "plugins");

            if (!Directory.Exists(applicationDataDir))
            {
                Directory.CreateDirectory(applicationDataDir);
            }

            if (!Directory.Exists(pluginsDir))
            {
                Directory.CreateDirectory(pluginsDir);
            }

            PluginsFilePath = System.IO.Path.Combine(pluginsDir, pluginsFile);
            if (!File.Exists(PluginsFilePath))
            {
                File.Create(PluginsFilePath).Close();
            }

            layoutFile = System.IO.Path.Combine(applicationDataDir, "config.layout");

            // That's a hack because of the designer. If one needs to attach an event the designer attaches
            // it in the end of the file after the call to Initialize. Works for the most of the events
            // but not for events like Realize which happen in the initialization. This function is used
            // to attach the event handlers before the initialization part.
            PreBuild();
            Build();

            hbox1.Add(dockFrame);

            dockFrame.CurrentLayout = "BasicLayout";
            dockFrame.HandlePadding = 0;
            dockFrame.HandleSize    = 4;

            this.ShowAll();

            this.Maximize();
        }
Example #2
0
    /// <summary>
    /// The main application window.
    /// </summary>
    ///
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        // Register the MainWindow as service so that it can be passed to the rest of the plugins
        // so that they could attach themselves in the menus.
        plugins.AddService((IDataMorphose)this);

        string confDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

        applicationDataDir = System.IO.Path.Combine(confDir,
                                                    Assembly.GetExecutingAssembly().GetName().Name);
        pluginsDir = System.IO.Path.Combine(applicationDataDir, "plugins");

        if (!Directory.Exists(applicationDataDir))
        {
            Directory.CreateDirectory(applicationDataDir);
        }

        if (!Directory.Exists(pluginsDir))
        {
            Directory.CreateDirectory(pluginsDir);
        }

        PluginsFilePath = System.IO.Path.Combine(pluginsDir, pluginsFile);
        if (!File.Exists(PluginsFilePath))
        {
            File.Create(PluginsFilePath).Close();
        }

        layoutFile = System.IO.Path.Combine(applicationDataDir, "config.layout");

        Build();

        OnRealized(this, new EventArgs());
        dockFrame.CurrentLayout = "BasicLayout";
        hbox1.Add(dockFrame);

        this.ShowAll();
    }