private void CreateTab()
        {
            EncodingType SelectedEncoding = (EncodingType)EncodingList.SelectedItem;

            if (CurrentSelectedIDs.ID_Tab != 0)
            {
                StorageListTypes SelectedType = ((StorageTypeDefinition)TabStorageType.SelectedValue).Type;

                switch (TabsAccessManager.GetTabViaID(GlobalVariables.CurrentIDs).TabContentType)
                {
                case ContentType.File:
                    TabsCreatorAssistant.CreateNewTab(CurrentSelectedIDs.ID_TabsList, TextBoxNewFileProject.Text, Encoding.GetEncoding(SelectedEncoding.EncodingCodepage), SelectedEncoding.EncodingBOM, SelectedType, TabTemplateContent);
                    break;

                //Create file in the selected folder !
                case ContentType.Folder:
                    TabsCreatorAssistant.CreateNewTabInFolder(GlobalVariables.CurrentIDs.ID_TabsList, CurrentSelectedIDs, TextBoxNewFileProject.Text, Encoding.GetEncoding(SelectedEncoding.EncodingCodepage), SelectedEncoding.EncodingBOM, SelectedType, TabTemplateContent);
                    break;
                }
            }
            else
            {
                TabsCreatorAssistant.CreateNewTab(CurrentSelectedIDs.ID_TabsList, TextBoxNewFileProject.Text, Encoding.GetEncoding(SelectedEncoding.EncodingCodepage), SelectedEncoding.EncodingBOM, StorageListTypes.LocalStorage, TabTemplateContent);
            }


            TextBoxNewFileProject.Text = "";
        }
Exemple #2
0
        private async void CreateTab()
        {
            await TabsCreatorAssistant.CreateNewTab(CurrentSelectedIDs.ID_TabsList, TextBoxNewTab.Text, Encoding.UTF8, StorageListTypes.LocalStorage, "");

            NewTabCreatorGrid.Visibility = Visibility.Collapsed;
            TextBoxNewTab.Text           = "";
        }
 private async void Tabs_Drop(object sender, DragEventArgs e)
 {
     if (e.DataView.Contains(StandardDataFormats.StorageItems))
     {
         await TabsCreatorAssistant.OpenFilesAlreadyOpenedAndCreateNewTabsFiles(GlobalVariables.CurrentIDs.ID_TabsList, await e.DataView.GetStorageItemsAsync());
     }
 }
        private async void OpenFolderButton_Click(object sender, RoutedEventArgs e)
        {
            LoadingGrid.IsLoading = true;
            await TabsCreatorAssistant.OpenFolder(CurrentSelectedIDs.ID_TabsList, StorageListTypes.LocalStorage);

            LoadingGrid.IsLoading = false;
            ShowCreatorGrid(false);
        }
        private async void OpenFiles()
        {
            StorageListTypes SelectedType = ((StorageTypeDefinition)TabStorageType.SelectedValue).Type;

            LoadingGrid.IsLoading = true;
            await TabsCreatorAssistant.OpenFilesAndCreateNewTabsFiles(CurrentSelectedIDs.ID_TabsList, SelectedType);

            LoadingGrid.IsLoading = false;
            ShowCreatorGrid(false);
        }
Exemple #6
0
        private async void ContentViewer_EditorCodeLoaded(object sender, EventArgs e)
        {
            if (!EditorIsReady)
            {
                EditorIsReady = true;
            }

            if (FilesWasOpened)
            {
                await TabsCreatorAssistant.OpenFilesAlreadyOpenedAndCreateNewTabsFiles(GlobalVariables.CurrentIDs.ID_TabsList, OpenedFiles);

                FilesWasOpened = false;
            }
        }
Exemple #7
0
        private void CreateTab()
        {
            switch (TabsAccessManager.GetTabViaID(CurrentSelectedIDs).TabContentType)
            {
            case ContentType.File:
                TabsCreatorAssistant.CreateNewTab(CurrentSelectedIDs.ID_TabsList, TextBoxNewFileProject.Text, Encoding.UTF8, StorageListTypes.LocalStorage, TabTemplateContent);
                break;

            //Create file in the selected folder !
            case ContentType.Folder:
                TabsCreatorAssistant.CreateNewTabInFolder(CurrentSelectedIDs.ID_TabsList, CurrentSelectedIDs, TextBoxNewFileProject.Text, Encoding.UTF8, StorageListTypes.LocalStorage, TabTemplateContent);
                break;
            }

            TextBoxNewFileProject.Text = "";
        }
Exemple #8
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            var args = e.Parameter as Windows.ApplicationModel.Activation.IActivatedEventArgs;

            if (args != null)
            {
                if (args.Kind == Windows.ApplicationModel.Activation.ActivationKind.File)
                {
                    var fileArgs = args as Windows.ApplicationModel.Activation.FileActivatedEventArgs;

                    if (EditorIsReady)
                    {
                        await TabsCreatorAssistant.OpenFilesAlreadyOpenedAndCreateNewTabsFiles(GlobalVariables.CurrentIDs.ID_TabsList, fileArgs.Files);
                    }
                    else
                    {
                        OpenedFiles    = fileArgs.Files;
                        FilesWasOpened = true;
                    }
                }
            }
        }
Exemple #9
0
        public async void ManageQueueTabs()
        {
            while (!CanManageQueue)
            {
                await Task.Delay(20);
            }

            if (CanManageQueue)
            {
                CanManageQueue = false;

                try
                {
                    if (GlobalVariables.CurrentIDs.ID_Tab != 0)
                    {
                        //Code content
                        string content = await ContentViewer.GetCode();

                        SerrisModulesServer.Manager.AsyncHelpers.RunSync(() => TabsWriteManager.PushTabContentViaIDAsync(GlobalVariables.CurrentIDs, content, false));

                        //Cursor position
                        PositionSCEE CursorPosition = await ContentViewer.GetCursorPosition();

                        InfosTab Tab = TabsAccessManager.GetTabViaID(GlobalVariables.CurrentIDs);
                        Tab.TabCursorPosition = new CursorPosition {
                            column = CursorPosition.column, row = CursorPosition.row
                        };
                        await TabsWriteManager.PushUpdateTabAsync(Tab, GlobalVariables.CurrentIDs.ID_TabsList, false);
                    }
                }
                catch { }

                foreach (CoreApplicationView view in CoreApplication.Views)
                {
                    if (Dispatcher != view.Dispatcher)
                    {
                        await view.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            Messenger.Default.Send(new STSNotification {
                                Type = TypeUpdateTab.TabUpdated, ID = GlobalVariables.CurrentIDs
                            });
                        });
                    }
                }

                GlobalVariables.CurrentIDs = new TabID {
                    ID_Tab = Queue_Tabs[0].tabID, ID_TabsList = Queue_Tabs[0].tabsListID
                };
                ContentViewer.MonacoModelID        = Queue_Tabs[0].monacoModelID;
                ContentViewer.CursorPositionColumn = Queue_Tabs[0].cursorPositionColumn;
                ContentViewer.CursorPositionRow    = Queue_Tabs[0].cursorPositionLineNumber;
                ContentViewer.CodeLanguage         = Queue_Tabs[0].typeLanguage;
                ContentViewer.Code = Queue_Tabs[0].code;
                ChangePushed       = false;

                Queue_Tabs.RemoveAt(0);

                //Files opened with files associations
                if (FilesWasOpened && Queue_Tabs.Count == 0)
                {
                    await TabsCreatorAssistant.OpenFilesAlreadyOpenedAndCreateNewTabsFiles(GlobalVariables.CurrentIDs.ID_TabsList, OpenedFiles);

                    FilesWasOpened = false; OpenedFiles = null;
                }

                CanManageQueue = true;
            }
        }
Exemple #10
0
 public async void createNewTabInTheCurrentList(string fileName, string content)
 => await TabsCreatorAssistant.CreateNewTab(getCurrentSelectedTabAndTabsListID().listID, fileName, Encoding.UTF8, SerrisTabsServer.Storage.StorageListTypes.LocalStorage, content);
        protected override async void OnFileActivated(FileActivatedEventArgs args)
        {
            var rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                GlobalVariables.GlobalizationRessources = new ResourceLoader();
                SMSInitialize.InitializeSMSJson();
                GlobalVariables.CurrentTheme = await new ThemeReader(ModulesAccessManager.GetCurrentThemeID()).GetThemeBrushesContent();

                Messenger.Default.Register <SMSNotification>(this, async(notification) =>
                {
                    try
                    {
                        switch (notification.Type)
                        {
                        case TypeUpdateModule.CurrentThemeUpdated:
                            GlobalVariables.CurrentTheme = await new ThemeReader(notification.ID).GetThemeBrushesContent();
                            Messenger.Default.Send(new EditorViewNotification {
                                ID = 0, type = EditorViewNotificationType.UpdateUI
                            });
                            break;
                        }
                    }
                    catch { }
                });

                Messenger.Default.Register <TempContentNotification>(this, (notification) =>
                {
                    try
                    {
                        switch (notification.type)
                        {
                        case TempContentType.currentIDs when !notification.answerNotification:
                            Messenger.Default.Send(new TempContentNotification {
                                answerNotification = true, type = TempContentType.currentIDs, content = GlobalVariables.CurrentIDs
                            });
                            break;

                        case TempContentType.currentDevice when !notification.answerNotification:
                            Messenger.Default.Send(new TempContentNotification {
                                answerNotification = true, type = TempContentType.currentDevice, content = GlobalVariables.CurrentDevice
                            });
                            break;

                        case TempContentType.currentTheme when !notification.answerNotification:
                            Messenger.Default.Send(new TempContentNotification {
                                answerNotification = true, type = TempContentType.currentTheme, content = GlobalVariables.CurrentTheme
                            });
                            break;
                        }
                    }
                    catch { }
                });

                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                Window.Current.Content = rootFrame;

                if (rootFrame.Content == null)
                {
                    rootFrame.Navigate(typeof(EditorView), args);
                }
                Window.Current.Activate();
            }
            else
            {
                await TabsCreatorAssistant.OpenFilesAlreadyOpenedAndCreateNewTabsFiles(GlobalVariables.CurrentIDs.ID_TabsList, args.Files);
            }
        }
        /* =============
         * = FUNCTIONS =
         * =============
         */


        private void CreateDefaultTab()
        => TabsCreatorAssistant.CreateNewTab(CurrentSelectedIDs.ID_TabsList, GlobalVariables.GlobalizationRessources.GetString("tabslist-defaulttabname"), Encoding.GetEncoding(EncodingsHelper.EncodingsAvailable[0].EncodingCodepage), EncodingsHelper.EncodingsAvailable[0].EncodingBOM, StorageListTypes.LocalStorage, "");
Exemple #13
0
        /* =============
         * = FUNCTIONS =
         * =============
         */


        private async void CreateDefaultTab()
        => await TabsCreatorAssistant.CreateNewTab(CurrentSelectedIDs.ID_TabsList, "New tab", Encoding.UTF8, StorageListTypes.LocalStorage, "");
Exemple #14
0
 private async void OpenButton_Click(object sender, RoutedEventArgs e)
 {
     await TabsCreatorAssistant.OpenFilesAndCreateNewTabsFiles(CurrentSelectedIDs.ID_TabsList, StorageListTypes.LocalStorage);
 }
Exemple #15
0
        /* =============
         * = FUNCTIONS =
         * =============
         */


        private void CreateDefaultTab()
        => TabsCreatorAssistant.CreateNewTab(CurrentSelectedIDs.ID_TabsList, GlobalVariables.GlobalizationRessources.GetString("tabslist-defaulttabname"), Encoding.UTF8, StorageListTypes.LocalStorage, "");
 public int createNewTabInTheCurrentList(string fileName, string content)
 {
     return(TabsCreatorAssistant.CreateNewTabReturn(getCurrentSelectedTabAndTabsListID().listID, fileName, Encoding.UTF8, false, SerrisTabsServer.Storage.StorageListTypes.LocalStorage, content));
 }