示例#1
0
        private async Task <bool> SaveCurrentUserFile()
        {
            StorageFile localfile;
            StorageFile localscript;

            if (CurrentUserFilename == "")
            {
                NamingDialog dialog = new NamingDialog(GetUserFilenames());
                await dialog.ShowAsync();

                if (dialog.Result != true)
                {
                    return(false);
                }

                CurrentUserFilename = dialog.TheName;
            }
            else
            {
                CanShowDeviceUpdateDialog = true;
                ShowDeviceUpdateDialogOrNot();
            }

            Log.Debug("[SaveCurrentUserFile] Save file name : " + CurrentUserFilename);
            SpacePage.ClearTempDeviceData();
            localfile = await m_LocalUserFileFolder.CreateFileAsync(CurrentUserFilename + ".xml", CreationCollisionOption.OpenIfExists);

            localscript = await m_LocalUserScriptFolder.CreateFileAsync(CurrentUserFilename + ".xml", CreationCollisionOption.OpenIfExists);
            await SaveFile(localfile, GetUserData());
            await SaveFile(localscript, GetLastScript());

            Log.Debug("[SaveCurrentUserFile] Save successfully");

            return(true);
        }
示例#2
0
        private async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            Log.Debug("[MainPage_Loaded] Intialize ...");

            await IntializeFileOperations();

            SpaceFrame.Navigate(typeof(SpacePage));
            SpacePage = SpacePage.Self;

            LayerFrame.Navigate(typeof(LayerPage));
            LayerPage = LayerPage.Self;

            //Start SocketClient
            MaskManager.GetInstance().ShowMask(MaskType.NoSupportDevice);
            Log.Debug("[MainPage_Loaded] Start client thread");
            startclient();
            Log.Debug("[MainPage_Loaded] Start client thread complete");
            LoadSettings();
            Log.Debug("[MainPage_Loaded] LoadSettings complete");
            DeviceUpdatesPage.Self.UpdateButton_Click(null, null);

            var visibleBounds = ApplicationView.GetForCurrentView().VisibleBounds;

            ResizeButton(visibleBounds.Width);
        }
示例#3
0
 private void Clean()
 {
     savedUndoCommand             = null;
     SetLayerButton.IsEnabled     = true;
     SetLayerRectangle.Visibility = Visibility.Collapsed;
     LayerPage.Clean();
     SpacePage.Clean();
 }
示例#4
0
 private void ResetToDefault()
 {
     SetLayerCounter = 1;
     Clean();
     CurrentUserFilename = "";
     SpacePage.FillCurrentIngroupDevices();
     ReUndoManager.Clear();
 }
示例#5
0
        private async Task LoadUserFile(string filename)
        {
            StorageFile localfile = await m_LocalUserFileFolder.CreateFileAsync(filename + ".xml", CreationCollisionOption.OpenIfExists);

            Clean();
            LoadContent(await LoadFile(localfile));

            SpacePage.SendSyncStateToService();
            SpacePage.RefreshStage();

            ReUndoManager.Clear();
        }
示例#6
0
        private async void ExportButton_Click(object sender, RoutedEventArgs e)
        {
            StorageFile saveFile = await ShowFileSavePickerAsync();

            if (saveFile != null)
            {
                SpacePage.ClearTempDeviceData();
                await SaveFile(saveFile, GetUserData());

                Log.Debug("[ExportButton] SaveFile : " + saveFile.Path);
            }
        }
示例#7
0
 private void SaveSettings()
 {
     g_LocalSettings.Values["SpaceZooming"] = SpacePage.GetSpaceZoomPercent().ToString();
     g_LocalSettings.Values["LayerLevel"]   = LayerPage.LayerZoomSlider.Value.ToString();
     g_LocalSettings.Values["RecentColor1"] = g_RecentColor[0].HexColor;
     g_LocalSettings.Values["RecentColor2"] = g_RecentColor[1].HexColor;
     g_LocalSettings.Values["RecentColor3"] = g_RecentColor[2].HexColor;
     g_LocalSettings.Values["RecentColor4"] = g_RecentColor[3].HexColor;
     g_LocalSettings.Values["RecentColor5"] = g_RecentColor[4].HexColor;
     g_LocalSettings.Values["RecentColor6"] = g_RecentColor[5].HexColor;
     g_LocalSettings.Values["RecentColor7"] = g_RecentColor[6].HexColor;
     g_LocalSettings.Values["RecentColor8"] = g_RecentColor[7].HexColor;
 }
示例#8
0
        private string GetUserData()
        {
            XmlNode root = CreateXmlNode("root");

            XmlNode versionNode = CreateXmlNode("version");

            versionNode.InnerText = "1.0";
            root.AppendChild(versionNode);

            root.AppendChild(SpacePage.ToXmlNodeForUserData());
            root.AppendChild(LayerPage.ToXmlNodeForUserData());

            return(root.OuterXml);
        }
示例#9
0
        public void ShowMask(MaskType type)
        {
            LayerPage layerPage = LayerPage.Self;
            SpacePage spacePage = SpacePage.Self;
            MainPage  mainPage  = MainPage.Self;

            mainPage.ActionBarMask.Visibility           = Visibility.Collapsed;
            mainPage.SettingRelativePanel.Visibility    = Visibility.Visible;
            mainPage.LiveServiceUpdatingMask.Visibility = Visibility.Collapsed;
            mainPage.NoSupportedDeviceGrid.Visibility   = Visibility.Collapsed;
            spacePage.NoSyncDeviceMask.Visibility       = Visibility.Collapsed;
            layerPage.PlayingMask.Visibility            = Visibility.Collapsed;
            mainPage.EditBarRelativePanel.Visibility    = Visibility.Collapsed;
            mainPage.ActionBarRelativePanel.Visibility  = Visibility.Visible;
            mainPage.AvailableButtonMask.Visibility     = Visibility.Collapsed;
            mainPage.FileComboboxMask.Visibility        = Visibility.Collapsed;
            mainPage.EffectBlockMask.Visibility         = Visibility.Collapsed;
            mainPage.EffectInfoMask.Visibility          = Visibility.Collapsed;

            switch (type)
            {
            case MaskType.None:
                break;

            case MaskType.NoSupportDevice:
                mainPage.NoSupportedDeviceGrid.Visibility = Visibility.Visible;
                break;

            case MaskType.NoSyncDevice:
                spacePage.NoSyncDeviceMask.Visibility = Visibility.Visible;
                break;

            case MaskType.Editing:
                mainPage.SettingRelativePanel.Visibility = Visibility.Collapsed;
                layerPage.PlayingMask.Visibility         = Visibility.Visible;
                Canvas.SetZIndex(layerPage.PlayingMask, 5);
                mainPage.EditBarRelativePanel.Visibility   = Visibility.Visible;
                mainPage.ActionBarRelativePanel.Visibility = Visibility.Collapsed;
                mainPage.AvailableButtonMask.Visibility    = Visibility.Visible;
                mainPage.FileComboboxMask.Visibility       = Visibility.Visible;
                mainPage.EffectBlockMask.Visibility        = Visibility.Visible;
                mainPage.EffectInfoMask.Visibility         = Visibility.Visible;
                break;

            case MaskType.Playing:
                mainPage.ActionBarMask.Visibility = Visibility.Visible;
                layerPage.PlayingMask.Visibility  = Visibility.Visible;
                Canvas.SetZIndex(layerPage.PlayingMask, 3);
                mainPage.EditBarRelativePanel.Visibility   = Visibility.Collapsed;
                mainPage.ActionBarRelativePanel.Visibility = Visibility.Visible;
                mainPage.AvailableButtonMask.Visibility    = Visibility.Visible;
                mainPage.FileComboboxMask.Visibility       = Visibility.Visible;
                mainPage.EffectBlockMask.Visibility        = Visibility.Visible;
                mainPage.EffectInfoMask.Visibility         = Visibility.Visible;
                break;

            case MaskType.LiveServiceUpdate:
                mainPage.LiveServiceUpdatingMask.Visibility = Visibility.Visible;
                break;
            }
        }