Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            foreach (var resource in typeof(LabyrinthMain).Assembly.GetManifestResourceNames())
            {
                Debug.WriteLine(resource);
            }

            try
            {
                StartupData sd        = new StartupData();
                ArrayList   arrayList = new ArrayList((ICollection)args);
                if (arrayList.Count != 0)
                {
                    int index1 = arrayList.IndexOf((object)"/addin");
                    if (index1 != -1)
                    {
                        sd.AddInPath = arrayList[index1 + 1] as string;
                        arrayList.RemoveRange(index1, 2);
                    }
                    if (arrayList.Count != 0)
                    {
                        int index2 = arrayList.Count - 1;
                        sd.FileName = arrayList[index2] as string;
                        arrayList.RemoveAt(index2);
                    }
                }
                Application.Run((Form) new MainForm(sd));
            }
            catch (Exception ex)
            {
                LabyrinthData.Log((object)ex);
                int num = (int)MessageBox.Show(ex.Message + "\n" + (object)ex.InnerException, "Labyrinth", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Ejemplo n.º 2
0
        public static Image GetImage(Annotation a)
        {
            int imageIndex = LabyrinthData.GetImageIndex(a);

            if (imageIndex != -1)
            {
                return(LabyrinthData.ElementImages.Images[imageIndex]);
            }
            return((Image)null);
        }
Ejemplo n.º 3
0
 public static int GetImageIndex(object obj)
 {
     if (obj is ElementPage)
     {
         return(LabyrinthData.GetImageIndex((obj as ElementPage).Element.Type));
     }
     if (obj is Element)
     {
         return(LabyrinthData.GetImageIndex((obj as Element).Type));
     }
     if (obj is AnnotationPage)
     {
         return(14);
     }
     if (obj is Annotation)
     {
         return(LabyrinthData.GetImageIndex(obj as Annotation));
     }
     if (obj is Labyrinth.Plot.Link)
     {
         return(17);
     }
     if (obj is Structure || obj is StructurePage)
     {
         return(18);
     }
     if (obj is Timeline || obj is TimelinePage)
     {
         return(19);
     }
     if (obj is SearchPage)
     {
         return(20);
     }
     if (obj is TaskPage)
     {
         return(21);
     }
     if (obj is Task)
     {
         return(LabyrinthData.GetImageIndex(obj as Task));
     }
     if (obj is CalendarPage)
     {
         return(24);
     }
     if (obj is Note || obj is NotePage)
     {
         return(25);
     }
     return(obj is IPage ? 26 : 0);
 }