Ejemplo n.º 1
0
        void SaveDocument(string uxmlPath, string ussPath)
        {
            var viewportWindow = m_PaneWindow as IBuilderViewportWindow;

            if (viewportWindow == null)
            {
                return;
            }

            // Set asset.
            var needFullRefresh = document.SaveNewDocument(
                uxmlPath, ussPath, viewportWindow.documentRootElement, m_IsDialogSaveAs);

            // Update any uses out there of the currently edited and saved USS.
            RetainedMode.FlagStyleSheetChange();

            // Save last save path.
            m_LastSavePath = Path.GetDirectoryName(uxmlPath);

            // Set doc field value.
            SetViewportSubTitle();

            m_SaveDialog.Hide();

            if (needFullRefresh)
            {
                m_PaneWindow.OnEnableAfterAllSerialization();
            }
            else
            {
                m_Selection.NotifyOfHierarchyChange(document);
            }
        }
Ejemplo n.º 2
0
        internal void SaveDocument(bool isSaveAs)
        {
            var viewportWindow = m_PaneWindow as IBuilderViewportWindow;

            if (viewportWindow == null)
            {
                return;
            }

            m_Explorer.elementHierarchyView.RegisterTreeState();

            // Set asset.
            var userConfirmed = document.SaveNewDocument(viewportWindow.documentRootElement, isSaveAs, out var needFullRefresh);

            if (!userConfirmed)
            {
                return;
            }

            // Update any uses out there of the currently edited and saved USS.
            RetainedMode.FlagStyleSheetChange();

            // Save last save path.
            m_LastSavePath = Path.GetDirectoryName(document.uxmlPath);

            // Set doc field value.
            UpdateHasUnsavedChanges();

            // Only updating UI to remove "*" from file names.
            m_Selection.ResetUnsavedChanges();

            if (needFullRefresh)
            {
                m_PaneWindow.OnEnableAfterAllSerialization();
            }
            else
            {
                m_Selection.NotifyOfHierarchyChange(document);
            }
        }