Ejemplo n.º 1
0
        protected override void RenderContent(RenderComposer composer)
        {
            if (ImGui.Button("Choose File"))
            {
                _status = "Waiting for file...";
                var explorer = new FileExplorer <OtherAsset>(LoadFile);
                Parent.AddWindow(explorer);
            }

            ImGui.Text(_status);
        }
Ejemplo n.º 2
0
        async Task AddToFolder(FileExplorer fileEx)
        {
            var group  = FileExplorersGrouped.FirstOrDefault(x => (RootFolderType)x.Key == fileEx.Type);
            var exists = group.Any((FileExplorer fe) => fileEx.Name == fe.Name && fileEx.RootMediaType == fe.RootMediaType);

            if (exists)
            {
                return;
            }
            await DispatchHelper.InvokeAsync(CoreDispatcherPriority.Normal, () => group.Add(fileEx));
        }
Ejemplo n.º 3
0
        }       //skończone

        private void SearchProgramPathButton_Click(object sender, RoutedEventArgs e)
        {
            FileExplorer file     = new FileExplorer("EXE (*.exe)|*.exe", false);
            var          filename = file.Open(Environment.SpecialFolder.MyComputer);

            if (file.verificate)
            {
                isDataDirty = true;
                SaveOptionButton.IsEnabled       = true;
                SourceEditingProgramTextBox.Text = filename.FileName;
            }
        }
Ejemplo n.º 4
0
 protected override void MenuBarButtons()
 {
     if (ImGui.Button("Open .tmx"))
     {
         var explorer = new FileExplorer <TextAsset>(file =>
         {
             _map           = new TileMap(file);
             _selectedLayer = 0;
         });
         _toolsRoot.AddLegacyWindow(explorer);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// force everything to redraw to apply a new theme
        /// </summary>
        public static void RefreshApplicationWithTheme(Theme theme)
        {
            Current = theme;
            Config.Instance.AccentColor = theme.AccentColor;

            // force the autocomplete to redraw
            AutoComplete.ForceClose();
            CodeExplorer.ApplyColorSettings();
            FileExplorer.ApplyColorSettings();
            Application.DoEvents();
            Appli.Refresh();
        }
    public void BrowseImageLocation()
    {
        Action <string> onComplete = (string path) =>
        {
            if (path != null)
            {
                FilePathField.text = path;
            }
        };

        FileExplorer.SetFilters("*", "PSD", "TIFF", "JPG", "TGA", "PNG", "GIF", "BMP", "IFF", "PICT");
        FileExplorer.BrowseFile(onComplete);
    }
Ejemplo n.º 7
0
 async Task AddToFolder(FileExplorer fileEx)
 {
     await DispatchHelper.InvokeInUIThread(CoreDispatcherPriority.Normal, () =>
     {
         var group  = FileExplorersGrouped.FirstOrDefault(x => (RootFolderType)x.Key == fileEx.Type);
         var exists = group.Any((FileExplorer fe) => fileEx.Name.Equals(fe.Name, StringComparison.OrdinalIgnoreCase) && fileEx.RootMediaType == fe.RootMediaType);
         if (exists)
         {
             return;
         }
         group.Add(fileEx);
     });
 }
Ejemplo n.º 8
0
 public FileExplorer ShowLoadModel()
 {
     if (_activeMainMenu != null)
     {
         _activeMainMenu.Close();
     }
     if (_activeFileExplorer != null)
     {
         _activeFileExplorer.Close();
     }
     _activeFileExplorer = FileManager.LoadModel(PrepreparedFileExplorer());
     return(_activeFileExplorer);
 }
Ejemplo n.º 9
0
        public CreditsScreen(Game game) : base("", 255)
        {
            this.game = game;

            lineData = File.ReadAllLines(FileExplorer.FindIn(FileExplorer.Rules, "Credits", ".yaml"));

            lineHeight = FontManager.Default.MaxHeight * 2;

            wsImage = new UIImage(new BatchObject(UISpriteManager.Get("logo")[0]))
            {
                Color = new Color(0, 0, 0, 0)
            };
        }
        //poprawić wyciąganie danych z pliku

        #region Photo

        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void AddPhotoButton_Click(object sender, RoutedEventArgs e)
        {
            FileExplorer fileExplorer = new FileExplorer("JPG (*.jpg)|*.jpg|TIFF (*.tiff)|*.tiff|PNG (*.png)|*.png", true);

            Microsoft.Win32.OpenFileDialog file = fileExplorer.Open(Environment.SpecialFolder.Desktop);
            if (fileExplorer.verificate)
            {
                foreach (string item in file.FileNames)
                {
                    string s = Convert.ToString(item);
                    MessageBox.Show(s);
                }
            }
        }
Ejemplo n.º 11
0
        private void GenerateButtonClicked(object sender, RoutedEventArgs routedEventArgs)
        {
            MessageBoxResult messageBoxResult = MessageBox.Show("¿Seguro desea generar el documento?", "Confirmación", MessageBoxButton.YesNo, MessageBoxImage.Question);

            try
            {
                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    CreatePatialReportFromInputData();
                    CreateActivityMadesFromInputData();
                    if (ValidateDataPatialReport())
                    {
                        string routeDestination = FileExplorer.Show("Guardar reporte parcial");
                        if (!string.IsNullOrWhiteSpace(routeDestination))
                        {
                            ProfessionalPracticesContext professionalPracticesContext = new ProfessionalPracticesContext();
                            UnitOfWork unitOfWork = new UnitOfWork(professionalPracticesContext);
                            if (RegisternewPartialReport(unitOfWork))
                            {
                                _partialReportTemplate = new PartialReportTemplate();
                                MyDataTemplate();
                                PartialReportGenerator partialReportGenerator = new PartialReportGenerator();
                                partialReportGenerator.CreatePartialReportDocument($"{routeDestination}", _partialReportTemplate);
                                Thread.Sleep(3500);
                                MessageBox.Show("El documento se genero correctamente", "Documento Generado", MessageBoxButton.OK, MessageBoxImage.Information);
                                PracticionerMenu practicionerMenu = new PracticionerMenu(_practicioner.Enrollment);
                                practicionerMenu.Show();
                                Close();
                            }
                        }
                        else
                        {
                            MessageBox.Show("Por favor, Ingrese el nombre del documento", "Datos Incorrectos", MessageBoxButton.OK, MessageBoxImage.Warning);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Por favor, Complete todos los campos", "Datos Incorrectos", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                }
            }
            catch (EntityException)
            {
                MessageBox.Show("No se pudo generar el reporte. Intente más tarde", "Genración Fallida", MessageBoxButton.OK, MessageBoxImage.Error);
                PracticionerMenu practicionerMenu = new PracticionerMenu(_practicioner.Enrollment);
                practicionerMenu.Show();
                Close();
            }
        }
Ejemplo n.º 12
0
 public void QuitApp()
 {
     if (popup != null)
     {
         popup.Close();
     }
     popup           = UIController.Instance.ShowYesNoPopup(gameObject, "Do you wish to save your work before leaving?");
     popup.OnAccept += () =>
     {
         FileExplorer explorer = UIController.Instance.ShowSaveModel();
         explorer.OnAccepted += (file) => CloseAppication();
     };
     popup.OnCancel  += () => popup.Close();
     popup.OnDecline += () => CloseAppication();
 }
Ejemplo n.º 13
0
 public void NewFile()
 {
     if (popup != null)
     {
         popup.Close();
     }
     popup           = UIController.Instance.ShowYesNoPopup(gameObject, "Do you wish to save your work?");
     popup.OnAccept += () =>
     {
         FileExplorer explorer = UIController.Instance.ShowSaveModel();
         explorer.OnAccepted += (file) => LayerManager.Instance.ResetLayers();
     };
     popup.OnCancel  += () => popup.Close();
     popup.OnDecline += () => LayerManager.Instance.ResetLayers();
 }
Ejemplo n.º 14
0
 public static FileExplorer ExportModel(FileExplorer script)
 {
     script.mode = FileExplorerMode.Save;
     script.UpdateDirectory();
     script.OnAccepted += (text) =>
     {
         if (System.String.IsNullOrWhiteSpace(text))
         {
             return;
         }
         TranslateModelToObj(text);
         script.Close();
     };
     return(script);
 }
Ejemplo n.º 15
0
 public static FileExplorer SaveModel(FileExplorer script)
 {
     script.mode = FileExplorerMode.Save;
     script.UpdateDirectory();
     script.OnAccepted += (text) =>
     {
         if (System.String.IsNullOrWhiteSpace(text))
         {
             return;
         }
         JsonSerializer.Serialize(text);
         script.Close();
     };
     return(script);
 }
Ejemplo n.º 16
0
 private void explore(ITypeCache cache, Editor editor)
 {
     _ctx.Post((s) =>
     {
         if (_exploreForm == null || !_exploreForm.Visible)
         {
             _exploreForm = new FileExplorer(
                 cache,
                 _defaultLanguage,
                 (file, line, column) => { editor.GoTo(file, line, column); },
                 () => { editor.SetFocus(); });
             _exploreForm.Show(this);
         }
         setToForeground(_exploreForm);
     }, null);
 }
Ejemplo n.º 17
0
 public static FileExplorer LoadModel(FileExplorer script)
 {
     script.mode = FileExplorerMode.Open;
     script.SetExtensionsArray(new string[] { ".abs" });
     script.UpdateDirectory();
     script.OnAccepted += (text) =>
     {
         if (System.String.IsNullOrWhiteSpace(text))
         {
             return;
         }
         JsonSerializer.Deserialize(text);
         script.Close();
     };
     return(script);
 }
Ejemplo n.º 18
0
        private void CreateNewFromTexture(bool gridMode, AnimatedSprite data)
        {
            var explorer = new FileExplorer <TextureAsset>(f =>
            {
                if (f.Texture == null)
                {
                    return;
                }

                SpriteAnimationFrameSource source;
                if (gridMode)
                {
                    source = new SpriteGridFrameSource(f.Texture.Size);
                }
                else
                {
                    source = new SpriteArrayFrameSource(f.Texture);
                }

                data.AssetFile   = f.Name;
                data.FrameSource = source;
                data.Animations  = new Dictionary <string, SpriteAnimationData>
                {
                    { "Default", new SpriteAnimationData("Default", 0) }
                };

                _currentAssetTexture = f.Texture;
                _controller          = new SpriteAnimationController(data);

                ResetEditors();
                _selectedAnimation = "Default";

                GLThread.ExecuteGLThreadAsync(() =>
                {
                    if (_textureFb == null)
                    {
                        _textureFb = new FrameBuffer(_currentAssetTexture.Size).WithColor();
                    }
                    else
                    {
                        _textureFb.Resize(_currentAssetTexture.Size);
                    }
                });
            });

            _toolsRoot.AddLegacyWindow(explorer);
        }
Ejemplo n.º 19
0
    IEnumerator _Load()
    {
        if (!EditCheck())
        {
            yield break;
        }

        while (currentSong.isSaving)
        {
            yield return(null);
        }

        if (SaveErrorCheck())
        {
            yield break;
        }

        Song backup = currentSong;

        try
        {
            currentFileName = FileExplorer.OpenFilePanel("Chart files (*.chart, *.mid)\0*.chart;*.mid", "chart,mid");
        }
        catch (FileExplorer.FileExplorerExitException e)
        {
            // Most likely closed the window explorer, just ignore for now.
            currentSong = backup;
            Debug.Log(e.Message);

            // Immediate exit
            yield break;
        }
        catch (System.Exception e)
        {
            currentSong = backup;
            Logger.LogException(e, "Error when getting file to open");

            // Immediate exit
            yield break;
        }

        Debug.Log("Loading song: " + System.IO.Path.GetFullPath(currentFileName));

        yield return(StartCoroutine(_Load(currentFileName)));

        currentSelectedObject = null;
    }
Ejemplo n.º 20
0
    void Start()
    {
        textChild = gameObject.transform.GetChild(0);

        fileExplorer = FindObjectOfType <FileExplorer>();

        SetCurrentType(gameObject.tag);

        iconAdress = FileExplorer.currentAdress.FullName + "\\" + iconCompleteName;

        isAccessible = FolderIsAcessible(iconAdress);

        if (iconType == IconType.Folder && !isAccessible)
        {
            prohibitedGameObject.SetActive(true);
        }
    }
Ejemplo n.º 21
0
 public void UpdateImage()
 {
     if (explorer != null)
     {
         explorer.Close();
     }
     explorer             = UIController.Instance.ShowRefPicture();
     explorer.OnAccepted += (text) =>
     {
         if (string.IsNullOrWhiteSpace(text))
         {
             return;
         }
         SetPicture(text);
         explorer.Close();
     };
 }
Ejemplo n.º 22
0
 private void Connect()
 {
     MediaFileExplorer.Reconnect();
     if (MediaFileExplorer.IsConnected)
     {
         if (!DoOnce)
         {
             if (!string.IsNullOrEmpty(InitialDirectory))
             {
                 FileExplorer.SetSelectedFolder(InitialDirectory);
             }
             DoOnce = true;
         }
         LbErrorMessage.Visible = false;
         BtOK.Enabled           = true;
     }
 }
Ejemplo n.º 23
0
        public static Piece ReloadPiece(string name)
        {
            var existingPiece = Pieces.FirstOrDefault(p => p.InnerName == name);

            if (existingPiece != null)
            {
                Pieces.Remove(existingPiece);
            }

            var path  = FileExplorer.FindPath(FileExplorer.Pieces, name, ".yaml");
            var nodes = TextNodeLoader.FromFile(path, name + ".yaml");

            var piece = new Piece(name, path, nodes);

            Pieces.Add(piece);

            return(piece);
        }
    string GetAudioFile()
    {
        string audioFilepath = string.Empty;
        string defExt        = string.Empty;

        foreach (string extention in validAudioExtensions)
        {
            if (defExt != string.Empty)
            {
                defExt += ",";
            }

            defExt += extention;
        }

        FileExplorer.OpenFilePanel(audioExFilter, defExt, out audioFilepath);
        return(audioFilepath);
    }
Ejemplo n.º 25
0
 private void DownloadFileButtonClicked(object sender, RoutedEventArgs routedEventArgs)
 {
     if (!string.IsNullOrWhiteSpace(LabelNameDocument.Content.ToString()))
     {
         try
         {
             string routeDestination = FileExplorer.ShowExplorer("Guardar documento");
             if (!string.IsNullOrWhiteSpace(routeDestination))
             {
                 WebClient myWebClient = new WebClient();
                 myWebClient.DownloadFile(_route, routeDestination);
                 MessageBox.Show("El archivo se descargo", "Descarga", MessageBoxButton.OK, MessageBoxImage.Information);
             }
         }catch (NullReferenceException exception) {
             MessageBox.Show("No se pudo descargar", "Descarga fallida", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
 }
Ejemplo n.º 26
0
        public void FileExplorerPrintTreePrintsCorrectOutput()
        {
            DirectoryInfo directoryInfo = new DirectoryInfo("../../../directory/");
            FileExplorer  explorer      = new FileExplorer();

            string expectedOutput = ProduceExpectedPrintTreeOutput(directoryInfo, 0);

            ConsoleAssert.WritesOut(() => explorer.PrintTree(directoryInfo), expectedOutput);

            // TestTools Code
            UnitTest test = Factory.CreateTest();
            TestVariable <FileExplorer> _explorer = test.CreateVariable <FileExplorer>();

            test.Arrange(_explorer, Expr(() => new FileExplorer()));
            test.ConsoleAssert.WritesOut(
                Lambda(Expr(_explorer, e => e.PrintTree(directoryInfo))),
                Const(expectedOutput));
            test.Execute();
        }
Ejemplo n.º 27
0
        private void SelectOnClick(object sender, RoutedEventArgs routedEventArgs)
        {
            if (Explorer == null)
            {
                Explorer = new FileExplorer
                {
                    SelectionMode = FileExplorerUniversal.Control.Interop.SelectionMode.FileWithOpen,
                    StorageTarget = StorageTarget.InstalledLocation,
                    Width         = ActualWidth,
                    Height        = ActualHeight
                };

                Explorer.OnDismiss            += FileExplorerOnDismiss;
                Explorer.ExtensionRestrictions = ExtensionRestrictions.Custom;
                Explorer.Extensions            = new[] { ".wav", ".wave", ".seq" }.ToList();
            }

            Explorer.Show();
        }
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorGUILayout.PropertyField(_inputProperties, true);
        serializedObject.ApplyModifiedProperties();

        InputConfigBuilder.InputProperties inputProperties = ((InputConfigBuilder)target).inputProperties;

        if (s_shouldReset)
        {
            inputProperties.shortcutInputs = new ShortcutInputConfig[0];
            s_shouldReset = false;
        }

        if (GUILayout.Button("Load Config From File"))
        {
            string filename;
            if (FileExplorer.OpenFilePanel(new ExtensionFilter("Config files", "json"), "json", out filename))
            {
                InputConfig inputConfig = new InputConfig();
                InputConfig.LoadFromFile(filename, inputConfig);
                inputProperties.shortcutInputs = inputConfig.shortcutInputs;
            }
        }
        if (GUILayout.Button("Save Config To File"))
        {
            string filename;

            if (inputProperties.shortcutInputs.Length > 0)
            {
                if (FileExplorer.SaveFilePanel(new ExtensionFilter("Config files", "json"), "InputPropertiesConfig", "json", out filename))
                {
                    InputConfig inputConfig = new InputConfig();
                    inputConfig.shortcutInputs = inputProperties.shortcutInputs;
                    InputConfig.Save(inputConfig, filename);
                }
            }
            else
            {
                Debug.LogError("Trying to save empty input properties. This is not allowed.");
            }
        }
    }
Ejemplo n.º 29
0
    void Start()
    {
        SysSoftware = GameObject.Find("System");
        com         = SysSoftware.GetComponent <Computer>();
        defalt      = SysSoftware.GetComponent <Defalt>();
        fp          = SysSoftware.GetComponent <FileExplorer>();
        appman      = SysSoftware.GetComponent <AppMan>();

        PosCheck();

        native_height = Customize.cust.native_height;
        native_width  = Customize.cust.native_width;

        windowRect.width  = 300;
        windowRect.height = 300;

        ContextwindowRect.width = 100;

        CloseButton = new Rect(windowRect.width - 23, 2, 21, 21);
    }
Ejemplo n.º 30
0
    public void ExportCHPackage()
    {
        string saveDirectory;

        if (FileExplorer.OpenFolderPanel(out saveDirectory))
        {
            Song song = editor.currentSong;

            saveDirectory = saveDirectory.Replace('\\', '/');

            if (!saveDirectory.EndsWith("/"))
            {
                saveDirectory += '/';
            }

            saveDirectory += song.name + "/";

            StartCoroutine(ExportCHPackage(saveDirectory, song, exportOptions));
        }
    }
Ejemplo n.º 31
0
    void Start()
    {
        //display loading text
        loadingText = GameObject.Find("LoadingText").GetComponent<GUIText>();
        loadingText.enabled = true;
        loadingText.text = "Loading...";

        fileExplorer = gameObject.GetComponent<FileExplorer> ();

        //load obj file from path specified by objfilename
        if (objFileName != "")
                        ObjReader.use.ConvertFile (objFileName, true, standardMat, transparentMat);
                else
                        Debug.Log ("Must either enter file path or select obj from menu");

        //disable loading text
        loadingText.enabled = false;
        displayError = false;
    }
Ejemplo n.º 32
0
    //private bool statusSplash = false;
    /*bool update_status ()
     	{
         	statusSplash = splash.WaitingSplash;
         	return true;
     	}*/
    public MainWindow(string[] arguments)
        : base(Gtk.WindowType.Toplevel)
    {
        this.HeightRequest = this.Screen.Height;//-50;
        this.WidthRequest = this.Screen.Width;//-50;

        bool showSplash = true;
        bool openFileFromArg = false;
        string openFileAgument = "";
        for (int i = 0; i < arguments.Length; i++){
            Logger.LogDebugInfo("arg->{0}",arguments[i]);

            string arg = arguments[i];
            if (arg.StartsWith("-nosplash")){
                if (arg == "-nosplash")
                    showSplash = false;
            }
            if(!arg.EndsWith(".exe")){ // argument file msw
                if(File.Exists(arg)){
                    openFileAgument =arg;
                    if(arg.ToLower().EndsWith(".msw"))
                        openFileFromArg = true;
                }
            }
        }

        StringBuilder sbError = new StringBuilder();
        if(!File.Exists(MainClass.Settings.FilePath)){

            if(showSplash)
                splash = new SplashScreenForm(false);

            //statusSplash = true;
            Moscrif.IDE.Tool.Logger.LogDebugInfo(String.Format("Setting inicialize -{0}",DateTime.Now));
            string file = System.IO.Path.Combine(MainClass.Paths.SettingDir, "keybinding");
            if(MainClass.Platform.IsMac){
                Moscrif.IDE.Iface.KeyBindings.CreateKeyBindingsMac(file);
            } else{
                Moscrif.IDE.Iface.KeyBindings.CreateKeyBindingsWin(file);
            }
            MainClass.Settings.SaveSettings();

        } else {
            if(showSplash)
                splash = new SplashScreenForm(false);
        }

        if(MainClass.Platform.IsMac){
                ApplicationEvents.Quit += delegate (object sender, ApplicationQuitEventArgs e) {
                    Application.Quit ();
                    e.Handled = true;
                };

                ApplicationEvents.Reopen += delegate (object sender, ApplicationEventArgs e) {
                    MainClass.MainWindow.Deiconify ();
                    MainClass.MainWindow.Visible = true;
                    e.Handled = true;
                };
        }

        Moscrif.IDE.Tool.Logger.LogDebugInfo(String.Format("splash.show-{0}",DateTime.Now));
        Console.WriteLine(String.Format("splash.show-{0}",DateTime.Now));

        if(showSplash)
            splash.ShowAll();
        StockIconsManager.Initialize();
        Moscrif.IDE.Tool.Logger.LogDebugInfo(String.Format("mainwindow.build.start-{0}",DateTime.Now));
        Build();
        this.Maximize();

        Moscrif.IDE.Tool.Logger.LogDebugInfo(String.Format("mainwindow.build.end-{0}",DateTime.Now));

        this.llcLogin = new LoginLogoutControl();
        this.llcLogin.Events = ((Gdk.EventMask)(256));
        this.llcLogin.Name = "llcLogin";
        this.statusbar1.Add (this.llcLogin);
        Gtk.Box.BoxChild w14 = ((Gtk.Box.BoxChild)(this.statusbar1 [this.llcLogin]));
        w14.Position = 2;
        w14.Expand = false;
        w14.Fill = false;

        SetSettingColor();

        lblMessage1.Text="";
        lblMessage2.Text="";
        if (String.IsNullOrEmpty(MainClass.Paths.TempDir))
        {

            MessageDialogs md =
                new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("cannot_create_temp"),MainClass.Paths.TempDir, Gtk.MessageType.Error,null);
            md.ShowDialog();
            return;
        }
        string fullpath = MainClass.Paths.StylesDir;

        bool success = true;

        if (!Directory.Exists(fullpath))
            try {
                Directory.CreateDirectory(fullpath);
            } catch {
                success = false;
            }
        if (success){
            try {
                Mono.TextEditor.Highlighting.SyntaxModeService.LoadStylesAndModes(fullpath);
            } catch(Exception ex) {
                sbError.AppendLine("ERROR: " + ex.Message);
                Logger.Log(ex.Message);
            }
        }

        ActionUiManager.UI.AddWidget += new AddWidgetHandler(OnWidgetAdd);
        ActionUiManager.UI.ConnectProxy += new ConnectProxyHandler(OnProxyConnect);
        ActionUiManager.LoadInterface();
        this.AddAccelGroup(ActionUiManager.UI.AccelGroup);

        WorkspaceTree = new WorkspaceTree();
        FrameworkTree = new FrameworkTree();

        FileExplorer = new FileExplorer();

        FileNotebook.AppendPage(WorkspaceTree, new NotebookLabel("workspace-tree.png",MainClass.Languages.Translate("projects")));
        FileNotebook.BorderWidth = 2;

        FileNotebook.AppendPage(FrameworkTree, new NotebookLabel("libs.png",MainClass.Languages.Translate("libs")));
        FileNotebook.BorderWidth = 2;

        FileNotebook.AppendPage(FileExplorer, new NotebookLabel("workspace-tree.png",MainClass.Languages.Translate("files")));
        FileNotebook.BorderWidth = 2;

        FileNotebook.CurrentPage = 1;

        hpBodyMidle.Pack1(FileNotebook, false, true);
        hpRight = new HPaned();
        //hpRight.Fi

        hpRight.Pack1(EditorNotebook, true, true);
        hpRight.Pack2(PropertisNotebook, false, true);
        hpBodyMidle.Pack2(hpRight, true, true);
        FileNotebook.WidthRequest = 500;
        hpBodyMidle.ResizeMode = ResizeMode.Queue;

        try {
            ActionUiManager.SocetServerMenu();
            ActionUiManager.RecentAll(MainClass.Settings.RecentFiles.GetFiles(),
                                      MainClass.Settings.RecentFiles.GetProjects(),
                                                      MainClass.Settings.RecentFiles.GetWorkspace());
        } catch {
        }

        ddbProject = new DropDownButton();
        ddbProject.Changed+= OnChangedProject;
        ddbProject.WidthRequest = 175;
        ddbProject.SetItemSet(projectItems);

        ddbDevice = new DropDownButton();
        ddbDevice.Changed+= OnChangedDevice;
        ddbDevice.WidthRequest = 175;
        ddbDevice.SetItemSet(deviceItems);

        ddbResolution = new DropDownButton();
        ddbResolution.Changed+= OnChangedResolution;
        ddbResolution.WidthRequest = 175;
        ddbResolution.SetItemSet(resolutionItems);

        ReloadSettings(false);
        OpenFile("StartPage",false);

        PageIsChanged("StartPage");

        if ((MainClass.Settings.Account != null) && (MainClass.Settings.Account.Remember)){
            MainClass.User = MainClass.Settings.Account;
        } else {
            MainClass.User = null;
        }

        SetLogin();

        OutputConsole = new OutputConsole();

        Gtk.Menu outputMenu = new Gtk.Menu();
        GetOutputMenu(ref outputMenu);

        BookmarkOutput = new BookmarkOutput();

        OutputNotebook.AppendPage(OutputConsole, new NotebookMenuLabel("console.png",MainClass.Languages.Translate("console"),outputMenu));
        OutputNotebook.AppendPage(FindReplaceControl, new NotebookLabel("find.png",MainClass.Languages.Translate("find")));
        OutputNotebook.AppendPage(BookmarkOutput, new NotebookLabel("bookmark.png",MainClass.Languages.Translate("bookmarks")));

        LogMonitor = new LogMonitor();
        Gtk.Menu monMenu = new Gtk.Menu();
        GetOutputMenu(ref monMenu, LogMonitor);

        OutputNotebook.AppendPage(LogMonitor, new NotebookMenuLabel("log.png",MainClass.Languages.Translate("Monitor"),monMenu));

        LogGarbageCollector = new LogGarbageCollector();
        Gtk.Menu gcMenu = new Gtk.Menu();
        GetOutputMenu(ref gcMenu, LogGarbageCollector);

        garbageColectorLabel =new NotebookMenuLabel("garbage-collector.png",MainClass.Languages.Translate("garbage_collector",0),gcMenu);

        OutputNotebook.AppendPage(LogGarbageCollector,garbageColectorLabel );

        hpOutput.Add1(OutputNotebook);

        ProcessOutput = new ProcessOutput();
        Gtk.Menu taskMenu = new Gtk.Menu();
        GetOutputMenu(ref taskMenu, ProcessOutput);
        TaskNotebook.AppendPage(ProcessOutput, new NotebookMenuLabel("task.png",MainClass.Languages.Translate("process"),taskMenu));

        ErrorOutput = new ErrorOutput();
        Gtk.Menu errorMenu = new Gtk.Menu();
        GetOutputMenu(ref errorMenu, ErrorOutput);
        TaskNotebook.AppendPage(ErrorOutput, new NotebookMenuLabel("error.png",MainClass.Languages.Translate("errors"),errorMenu));

        LogOutput = new LogOutput();
        Gtk.Menu logMenu = new Gtk.Menu();
        GetOutputMenu(ref logMenu, LogOutput);
        TaskNotebook.AppendPage(LogOutput, new NotebookMenuLabel("log.png",MainClass.Languages.Translate("logs"),logMenu));

        TodoOutput = new TodoOutput();
        TaskNotebook.AppendPage(TodoOutput, new NotebookLabel("task.png",MainClass.Languages.Translate("task")));

        FindOutput = new FindOutput();
        Gtk.Menu findMenu = new Gtk.Menu();
        GetOutputMenu(ref findMenu, FindOutput);
        TaskNotebook.AppendPage(FindOutput, new NotebookMenuLabel("find.png",MainClass.Languages.Translate("find_result"),findMenu));

        hpOutput.Add2(TaskNotebook);
        FirstShow();

        EditorNotebook.PageIsChanged +=PageIsChanged;

        if (openFileFromArg){ // open workspace from argument file
         	Workspace workspace = Workspace.OpenWorkspace(openFileAgument);
            Console.WriteLine("Open File From Arg");
            if (workspace != null){
                ReloadWorkspace(workspace, false,false);
                Console.WriteLine("RecentFiles");
                MainClass.Settings.RecentFiles.AddWorkspace(workspace.FilePath, workspace.FilePath);
                ActionUiManager.RefreshRecentAll(MainClass.Settings.RecentFiles.GetFiles(),
                                      MainClass.Settings.RecentFiles.GetProjects(),
                                         MainClass.Settings.RecentFiles.GetWorkspace());
            } else
                openFileFromArg = false;
        } else if((MainClass.Settings.OpenLastOpenedWorkspace) && !openFileFromArg ){
            if(String.IsNullOrEmpty(MainClass.Workspace.FilePath) && (String.IsNullOrEmpty(MainClass.Settings.CurrentWorkspace) ) ){
                /*MessageDialogs md =
                new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("workspace_is_corrupted"), null, Gtk.MessageType.Error,null);
                    md.ShowDialog();*/
                MainClass.Settings.CurrentWorkspace = "";
            } else{
                ReloadWorkspace(MainClass.Workspace, false,false);
            }
        } else if(!MainClass.Settings.OpenLastOpenedWorkspace && (!openFileFromArg) ){
            MainClass.Workspace = new Workspace();
            MainClass.Settings.CurrentWorkspace = "";
        }

        if(!String.IsNullOrEmpty(openFileAgument)){
            if(!openFileAgument.ToLower().EndsWith(".msw"))
                OpenFile(openFileAgument,true);
        }

        EditorNotebook.Page=0;

        WorkspaceTree.FileIsSelected+= delegate(string fileName, int fileType,string appFileName) {

            if(String.IsNullOrEmpty(fileName)){
                SetSensitiveMenu(false);
                return;
            }
            ActionUiManager.SetSensitive("propertyall",true);

            SetSensitiveMenu(true);

            if(MainClass.Settings.AutoSelectProject){

                if((TypeFile)fileType == TypeFile.AppFile)
                    SetActualProject(fileName);
                else if (!String.IsNullOrEmpty(appFileName))
                    SetActualProject(appFileName);
            }//PropertisNotebook
            PropertisNotebook.RemovePage(0);
            if((TypeFile)fileType == TypeFile.SourceFile || ((TypeFile)fileType == TypeFile.StartFile )
               || ((TypeFile)fileType == TypeFile.ExcludetFile ) ){
                string file = "";
                string appfile = "";
                int typ = -1;
                Gtk.TreeIter ti = new Gtk.TreeIter();
                WorkspaceTree.GetSelectedFile(out file, out typ, out ti);

                if (String.IsNullOrEmpty(file))
                    return;

                appfile = WorkspaceTree.GetSelectedProjectApp();

                Project p = MainClass.Workspace.FindProject_byApp(appfile, true);
                if (p == null)
                    return;

                FilePropertisData fpd = new FilePropertisData();
                fpd.Filename = MainClass.Workspace.GetRelativePath(file);
                fpd.Project = p;

                FilePropertyWidget fpw = new FilePropertyWidget( fpd);
                PropertisNotebook.AppendPage(fpw,new Label("Properties"));

            }else  if ((TypeFile)fileType == TypeFile.Directory){

                string file = "";
                string appfile = "";
                int typ = -1;
                Gtk.TreeIter ti = new Gtk.TreeIter();
                WorkspaceTree.GetSelectedFile(out file, out typ, out ti);

                if (String.IsNullOrEmpty(file)) return;

                appfile = WorkspaceTree.GetSelectedProjectApp();

                Project p = MainClass.Workspace.FindProject_byApp(appfile, true);
                if (p == null)
                    return;

                FilePropertisData fpd = new FilePropertisData();
                fpd.Filename = MainClass.Workspace.GetRelativePath(file);
                fpd.Project = p;

                DirPropertyWidget fpw = new DirPropertyWidget( fpd);
                PropertisNotebook.AppendPage(fpw,new Label("Properties"));

            }else  if ((TypeFile)fileType == TypeFile.AppFile){

                string file = "";
                int typ = -1;
                Gtk.TreeIter ti = new Gtk.TreeIter();
                WorkspaceTree.GetSelectedFile(out file, out typ, out ti);

                if (String.IsNullOrEmpty(file)) return;

                Project p = MainClass.Workspace.FindProject_byApp(file, true);
                if (p == null)
                    return;

                ProjectPropertyWidget fpw = new ProjectPropertyWidget( p);
                PropertisNotebook.AppendPage(fpw,new Label("Properties"));

            } else{

            }
        };

        SetSensitiveMenu(false);

        string newUpdater = System.IO.Path.Combine(MainClass.Paths.AppPath,"moscrif-updater.exe.new");

        if(System.IO.File.Exists(newUpdater)){

            string oldUpdater = System.IO.Path.Combine(MainClass.Paths.AppPath,"moscrif-updater.exe");
            try{
                if(File.Exists(oldUpdater))
                    File.Delete(oldUpdater);

                  File.Copy(newUpdater,oldUpdater);

                  File.Delete(newUpdater);
            }catch(Exception ex){
                sbError.AppendLine("WARNING: " + ex.Message);
                Logger.Error(ex.Message);
            }
        }

        Gtk.Drag.DestSet (this, 0, null, 0);
        this.DragDrop += delegate(object o, DragDropArgs args) {

            Gdk.DragContext dc=args.Context;

            foreach (object k in dc.Data.Keys){
                Console.WriteLine(k);
            }
            foreach (object v in dc.Data.Values){
                Console.WriteLine(v);
            }

            Atom [] targets = args.Context.Targets;
            foreach (Atom a in targets){
                if(a.Name == "text/uri-list")
                    Gtk.Drag.GetData (o as Widget, dc, a, args.Time);
            }
        };

        this.DragDataReceived += delegate(object o, DragDataReceivedArgs args) {

            if(args.SelectionData != null){
                string fullData = System.Text.Encoding.UTF8.GetString (args.SelectionData.Data);

                foreach (string individualFile in fullData.Split ('\n')) {
                    string file = individualFile.Trim ();
                    if (file.StartsWith ("file://")) {
                        file = new Uri(file).LocalPath;

                        try {
                            OpenFile(file,true);
                        } catch (Exception e) {
                            sbError.AppendLine("ERROR: " + String.Format("unable to open file {0} exception was :\n{1}", file, e.ToString()));
                            Logger.Error(String.Format("unable to open file {0} exception was :\n{1}", file, e.ToString()));
                        }
                    }
                }
            }
        };
        //table1.Attach(ddbSocketIP,2,3,0,1,AttachOptions.Shrink,AttachOptions.Shrink,0,0);
        this.ShowAll();
        //this.Maximize();

        int x, y, w, h, d = 0;
        hpOutput.Parent.ParentWindow.GetGeometry(out x, out y, out w, out h, out d);
        hpOutput.Position = w / 2;

        //vpMenuRight.Parent.ParentWindow.GetGeometry(out x, out y, out w, out h, out d);
        tblMenuRight.Parent.ParentWindow.GetGeometry(out x, out y, out w, out h, out d);
        tblMenuRight.RowSpacing = 0;
        tblMenuRight.ColumnSpacing = 0;
        tblMenuRight.BorderWidth = 0;
        if(w<1200){
            //vpMenuRight.WidthRequest =125;
            tblMenuRight.WidthRequest =220;
        } else {
            if(MainClass.Platform.IsMac)
                tblMenuRight.WidthRequest =320;
            else
                tblMenuRight.WidthRequest =300;
        }

        if (MainClass.Platform.IsMac) {
            try{
                ActionUiManager.CreateMacMenu(mainMenu);

            } catch (Exception ex){
                sbError.AppendLine(String.Format("ERROR: Mac IGE Main Menu failed."+ex.Message));
                Logger.Error("Mac IGE Main Menu failed."+ex.Message,null);
            }
        }
        ReloadPanel();
        Moscrif.IDE.Tool.Logger.LogDebugInfo(String.Format("splash.hide-{0}",DateTime.Now));
        // Send message to close splash screen on win
        Console.WriteLine(String.Format("splash.hide-{0}",DateTime.Now));

        if(showSplash)
            splash.HideAll();

        EditorNotebook.OnLoadFinish = true;

        OutputConsole.WriteError(sbError.ToString());

        Moscrif.IDE.Iface.SocketServer.OutputClientChanged+= delegate(object sndr, string message) {
            Gtk.Application.Invoke(delegate{
                    this.OutputConsole.WriteText(message);
                    Console.WriteLine(message);
                });
        };

        Thread ExecEditorThreads = new Thread(new ThreadStart(ExecEditorThreadLoop));

        ExecEditorThreads.Name = "ExecEditorThread";
        ExecEditorThreads.IsBackground = true;
        ExecEditorThreads.Start();
        //LoadDefaultBanner();

        toolbarBanner = new Toolbar ();
        toolbarBanner.WidthRequest = 220;
        tblMenuRight.Attach(toolbarBanner,0,1,0,2,AttachOptions.Fill,AttachOptions.Expand|AttachOptions.Fill,0,0);

        bannerImage.WidthRequest = 200;
        bannerImage.HeightRequest = 40;

        toolbarBanner.Add(bannerImage);//(bannerButton);
        toolbarBanner.ShowAll();
        LoadDefaultBanner();

        //bannerImage.GdkWindow.Cursor = new Gdk.Cursor(Gdk.CursorType.Hand2);

        Thread BannerThread = new Thread(new ThreadStart(BannerThreadLoop));

        BannerThread.Name = "BannerThread";
        BannerThread.IsBackground = true;
        BannerThread.Start();
    }