Ejemplo n.º 1
0
        internal static bool SaveAs()
        {
            if (MainForm.Instance.RootNode is GenericWrapper)
            {
#if !DEBUG
                try
                {
#endif
                GenericWrapper w = MainForm.Instance.RootNode as GenericWrapper;
                string path      = w.Export();
                if (path != null)
                {
                    _rootPath = path;
                    MainForm.Instance.UpdateName();
                    w.Resource.IsDirty = false;
                    return(true);
                }
#if !DEBUG
            }
            catch (Exception x) { Say(x.Message); }
            //finally { }
#endif
            }
            return(false);
        }
Ejemplo n.º 2
0
        internal static bool SaveAs()
        {
            bool restoreHex = false;

            if (MainForm.Instance.RootNode is GenericWrapper)
            {
                #if !DEBUG
                try
                {
                #endif
                if (MainForm.Instance.ShowHex == true)
                {
                    MainForm.Instance.ShowHex = false;
                    MainForm.Instance.Invalidate();
                    MainForm.Instance.resourceTree_SelectionChanged(MainForm.Instance, EventArgs.Empty);
                    restoreHex = true;
                }

                GenericWrapper w = MainForm.Instance.RootNode as GenericWrapper;
                string path      = w.Export();
                if (path != null)
                {
                    _rootPath = path;
                    MainForm.Instance.UpdateName();
                    w.ResourceNode.IsDirty = false;

                    if (restoreHex)
                    {
                        MainForm.Instance.ShowHex = true;
                        MainForm.Instance.Invalidate();
                        MainForm.Instance.resourceTree_SelectionChanged(MainForm.Instance, EventArgs.Empty);
                    }
                    return(true);
                }
                #if !DEBUG
            }
            catch (Exception x) { Say(x.Message); }
            //finally { }
                #endif
            }

            if (restoreHex)
            {
                MainForm.Instance.ShowHex = true;
                MainForm.Instance.Invalidate();
                MainForm.Instance.resourceTree_SelectionChanged(MainForm.Instance, EventArgs.Empty);
            }
            return(false);
        }
Ejemplo n.º 3
0
 internal static bool SaveAs()
 {
     if (MainForm.Instance.RootNode is GenericWrapper)
     {
         try
         {
             GenericWrapper w    = MainForm.Instance.RootNode as GenericWrapper;
             string         path = w.Export();
             if (path != null)
             {
                 _rootPath = path;
                 MainForm.Instance.UpdateName();
                 return(true);
             }
         }
         catch (Exception x) { MessageBox.Show(x.Message); }
     }
     return(false);
 }